Skip to content

Commit a124ded

Browse files
committed
Merge branch 'release/v1.5.2'
2 parents fa3024d + 032e570 commit a124ded

85 files changed

Lines changed: 993 additions & 10557 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Changelog
22
All notable changes to this project are/will be documented in this file.
33

4+
## [1.5.2] - 2023-06-07
5+
- Added Jazzmin integration as an option
6+
- Added settings for custom dashboard base template, admin_site_access_permission, report_access_function
7+
- Simplified creating a widget for a report
8+
- Simplified integrating erp framework with your project
9+
- Align own ReportView to Slick Reporting ReportView
10+
- Removed ReportList View, top_search app, and unused js plugins
11+
- Changed report URL to be app_label/report_lug
12+
- Enhanced demo app and documentation
13+
14+
## [1.5.0] - 2023-05-28
15+
- A makeover and renaming the project to django-erp-framework.
16+
417

518
## [1.2.0] - 2020-11-24
619
- Update slick_reporting to version >= 0.4

docs/source/Walkthrough.rst

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,36 @@ Walkthrough
44
=============
55

66

7-
Log in to My Shop demo site "My Shop" https://my-shop.django-erp-framework.com/ with the following credentials:
7+
Log in to "My Shop", our demo site https://my-shop.django-erp-framework.com/ with the following credentials:
88

99
Username `test`
1010

1111
Password `testuser123`
1212

1313
This is a custom admin site with a dashboard and reporting. :ref:`erp_admin`
1414

15-
In the dashboard You see reports displayed as widgets:
15+
The demo site contains 3 dashboards:
16+
17+
1. The default dashboard, with jazzmin theme (https://my-shop.django-erp-framework.com/)
18+
The dashboard is for a sample ERP site, with a few widgets and reports.
19+
20+
2. A custom dashboard with a custom index template (https://my-shop.django-erp-framework.com/requests-dashboard/)
21+
This dashboard is for the requests app https://github.com/django-request/django-request
22+
It's using a custom base template, like what you'd need to integrate this project into your own site.
23+
24+
3. A custom dashboard created without the erp admin site.
25+
A demo of how to use the framework in your own views and templates.
26+
27+
28+
In the default dashboard You see reports displayed as widgets:
1629

1730
#. Expense total
18-
#. Profitability Monthly
31+
#. Profitability Monthly (A time series report)
1932
#. Sales list
33+
#. Product Movement Statement (debit and credit transactions)
34+
#. A custom success call back to display the ajax json response of the report
35+
#. Product Client Sales Comparision (A cross tab report)
36+
2037

2138

2239
.. image:: _static/widgets.png
@@ -33,7 +50,7 @@ In the dashboard You see reports displayed as widgets:
3350

3451
Apps
3552
----
36-
My Shop is composed of 3 apps to demo django erp framework
53+
My Shop default dashboard is composed of 3 apps to demo django erp framework
3754
Expense, Sales & Purchase
3855

3956
#. Expense:

docs/source/getting_started/index.rst

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,24 @@ Usage
2020
.. code-block:: python
2121
2222
INSTALLED_APPS = {
23-
# ...
2423
2524
26-
'crequest',
27-
'crispy_forms',
25+
'crequest', # Need access to the request object in places where request
26+
27+
'crispy_forms', # For the reports forms,
2828
'crispy_bootstrap4',
2929
30-
'reversion', # needed only when you add the admin app
31-
'tabular_permissions',
30+
'reversion', # needed only when you use the admin app
31+
'tabular_permissions', # better a permission widget , Optional
3232
3333
'erp_framework',
34+
"erp_framework.admin.jazzmin_integration", # if you want to use jazzmin theme, otherwise remove this line
3435
'erp_framework.admin',
35-
'erp_framework.activity',
3636
'erp_framework.reporting',
3737
'slick_reporting',
3838
39-
'jazzmin',
39+
'jazzmin', # optional
4040
'django.contrib.admin', # comes at the end because the theme is replaced
41-
4241
}
4342
4443
@@ -53,7 +52,7 @@ Usage
5352
5453
5554
56-
* Django-erp-framework uses django-crispy-forms for the reporting forms. So we need to add this:
55+
* Django-erp-framework uses django-crispy-forms for the reporting forms. So we need to add this to our settings.py:
5756

5857
.. code-block:: python
5958
@@ -69,8 +68,6 @@ Usage
6968
"site_name": "ERP Framework System",
7069
"site_header": "ERP Framework System",
7170
"index_title": "ERP Framework Dashboard",
72-
73-
# .. todo
7471
}
7572
7673
@@ -97,21 +94,11 @@ We need to hook the Django ERP admin site in ``urls.py``, like so:
9794
9895
With this configuration in place, you are ready to run ``./manage.py migrate``
9996

100-
User accounts
101-
-------------
102-
103-
Superuser accounts receive automatic access to the Django ERP framework Dashboard interface; use ``./manage.py createsuperuser`` if you don't already have one.
104-
105-
Start developing
106-
----------------
107-
108-
You're now ready to add a new app to your Django project via ``./manage.py startapp``.
10997

11098
Follow to the tutorial to create sample erp system which tracks sales and expense and profitability. :ref:`tutorial_root`
11199

112100

113101

114-
115102
Running the tests
116103
-----------------
117104

docs/source/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
Welcome to Django ERP framework documentation
22
=============================================
33

4-
A light-weight effective framework to create business application equipped with a reporting engine and a responsive dashboard written in `Python <https://www.python.org/>`_ and built on the `Django web framework <https://www.djangoproject.com/>`_.
4+
A light-weight effective framework to create reports, dashboards and diverse business and ERP applications written in `Python <https://www.python.org/>`_ and built on top of `Django web framework <https://www.djangoproject.com/>`_.
55

66
Features
77
--------
88

99
- A Reporting Engine that can generate reports like time series , crosstab , and more. from any model.
1010
- Charting capabilities built in to turn reports into attractive charts.
1111
- Widget system to display bits of the reports results or its charts on any page you want.
12+
- A Dashboard system allowing you to create different dashboards for different users/ cases .
1213
- Customizable and easily extensible.
1314
- Django Jazzmin theme ready (& can be used with any django admin theme)
1415
- Python 3.8 / 3.9 / 3.10
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
V1.5.2 (07 June 2023)
2+
====================
3+
4+
- Added Jazzmin integration as an option
5+
- Added settings for custom dashboard base template, admin_site_access_permission, report_access_function
6+
- Simplified creating a widget for a report
7+
- Simplified integrating erp framework with your project
8+
- Align own ReportView to Slick Reporting ReportView
9+
- Removed ReportList View, top_search app, and unused js plugins
10+
- Changed report URL to be app_label/report_lug
11+
- Enhanced demo app and documentation

docs/source/settings.py

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
"""
2+
Settings for the documentation builder.
3+
"""
4+
5+
import os
6+
7+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
8+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
9+
10+
# Quick-start development settings - unsuitable for production
11+
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
12+
13+
# SECURITY WARNING: keep the secret key used in production secret!
14+
SECRET_KEY = "1han1v%@fd0#e40#tm0z!g2twgo3+!gf9-kr3--1v5)_bkfv4q"
15+
16+
# SECURITY WARNING: don't run with debug turned on in production!
17+
DEBUG = True
18+
19+
ALLOWED_HOSTS = ["*"]
20+
21+
# Application definition
22+
23+
INSTALLED_APPS = [
24+
"django.contrib.auth",
25+
"django.contrib.contenttypes",
26+
"django.contrib.sessions",
27+
"django.contrib.messages",
28+
"django.contrib.staticfiles",
29+
"crequest",
30+
"crispy_forms",
31+
"reversion",
32+
"tabular_permissions",
33+
"erp_framework",
34+
# "erp_framework.admin",
35+
# "erp_framework.activity",
36+
"erp_framework.reporting",
37+
"slick_reporting",
38+
"jazzmin",
39+
"django.contrib.admin",
40+
]
41+
42+
MIDDLEWARE = [
43+
"django.middleware.security.SecurityMiddleware",
44+
"django.contrib.sessions.middleware.SessionMiddleware",
45+
"django.middleware.common.CommonMiddleware",
46+
"django.middleware.csrf.CsrfViewMiddleware",
47+
"django.contrib.auth.middleware.AuthenticationMiddleware",
48+
"django.contrib.messages.middleware.MessageMiddleware",
49+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
50+
"crequest.middleware.CrequestMiddleware",
51+
]
52+
53+
ROOT_URLCONF = "myproject.urls"
54+
55+
TEMPLATES = [
56+
{
57+
"BACKEND": "django.template.backends.django.DjangoTemplates",
58+
"DIRS": [],
59+
"APP_DIRS": True,
60+
"OPTIONS": {
61+
"context_processors": [
62+
"django.template.context_processors.debug",
63+
"django.template.context_processors.request",
64+
"django.contrib.auth.context_processors.auth",
65+
"django.contrib.messages.context_processors.messages",
66+
"django.template.context_processors.i18n",
67+
"django.template.context_processors.static",
68+
],
69+
},
70+
},
71+
]
72+
73+
WSGI_APPLICATION = "myproject.wsgi.application"
74+
75+
# Password validation
76+
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
77+
78+
AUTH_PASSWORD_VALIDATORS = [
79+
{
80+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
81+
},
82+
{
83+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
84+
},
85+
{
86+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
87+
},
88+
{
89+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
90+
},
91+
]
92+
93+
# Internationalization
94+
# https://docs.djangoproject.com/en/2.2/topics/i18n/
95+
96+
LANGUAGE_CODE = "en-us"
97+
98+
TIME_ZONE = "UTC"
99+
100+
USE_I18N = True
101+
102+
USE_L10N = True
103+
104+
USE_TZ = True
105+
106+
# Static files (CSS, JavaScript, Images)
107+
# https://docs.djangoproject.com/en/2.2/howto/static-files/
108+
109+
STATIC_URL = "/static/"
110+
111+
# Database
112+
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
113+
114+
115+
STATIC_ROOT = os.path.join(BASE_DIR, "..", "collected_static")
116+
CRISPY_TEMPLATE_PACK = "bootstrap4"
117+
118+
LOGIN_REDIRECT_URL = "/"
119+
120+
# RA_ADMIN_INDEX_PAGE = 'ra_demo/index.html'
121+
122+
ERP_ADMIN_SITE_TITLE = "my demo "
123+
124+
DATABASES = {
125+
"default": {
126+
"ENGINE": "django.db.backends.sqlite3",
127+
"NAME": os.path.join(BASE_DIR, "erp_framework.sqlite3"),
128+
}
129+
}

docs/source/topics/widgets.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ Adding a widget to a page is as easy as this code
1111

1212
<div class="widget-container">
1313
{% get_report base_model='expense' report_slug='ExpensesTotalStatement' as ExpensesTotalStatement %}
14-
{% get_html_panel ExpensesTotalStatement %}
14+
{% get_widget ExpensesTotalStatement %}
1515
</div>
1616

1717
The ``get_report`` tag will return a ``Report`` object that can be used to
18-
render the report. The ``get_html_panel`` tag will render
18+
render the report. The ``get_widget`` tag will render
1919
the report as a card with a title, a table and a chart container.
2020

2121
This code above will be actually rendered as this in the html page:
@@ -68,10 +68,23 @@ container for the chart. The ``data-report-table`` attribute is used by the
6868
javascript to find the container for the table.
6969

7070

71-
get_html_panel Tag can accept a ``template_name`` parameter to render the
71+
``get_widget`` Tag can accept a ``template_name`` parameter to render the
7272
report using a custom template. By default it renders the
7373
``erp_reporting/report_widget.html`` template.
7474

75+
Default Arguments
76+
-----------------
77+
78+
extra_params
79+
success_callback
80+
failure_callback
81+
display_chart
82+
display_table
83+
chart_id
84+
display_title
85+
title (default to report report title)
86+
87+
7588

7689

7790

File renamed without changes.

erp_framework/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# default_app_config = "erp_framework.apps.RaConfig"
22

3-
VERSION = (1, 5, 0)
3+
VERSION = (1, 5, 2)
44

5-
__version__ = "1.5.0"
5+
__version__ = "1.5.2"

0 commit comments

Comments
 (0)