Code Monkey home page Code Monkey logo

django-erp-framework's People

Contributors

dependabot[bot] avatar pierreclaverkoko avatar ramezissac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-erp-framework's Issues

I have error in sample_erp tutorial document!

Greetings
I am a newbie in Python.
I followed the guide,
when I click on keys: [Clients][Expense][Products][Sales]
I have a error occurs!!
OR Key in left side .
Although all the data I entered in sample_erp was saved in admin.
All the add buttons work fine and then the error message comes.

`

TypeError at /sample_erp/expense/

__init__() takes 14 positional arguments but 15 were given
Request Method: GET
http://127.0.0.1:8000/sample_erp/expense/
4.1.1
TypeError
init() takes 14 positional arguments but 15 were given
G:\Ra-system_ERP\ERP_APP\env\lib\site-packages\django\contrib\admin\options.py, line 834, in get_changelist_instance
ra.admin.admin.changelist_view
G:\Ra-system_ERP\ERP_APP\env\Scripts\python.exe
3.8.3
['G:\Ra-system_ERP\ERP_APP', 'C:\Users\Morteza\AppData\Local\Programs\Python\Python38\python38.zip', 'C:\Users\Morteza\AppData\Local\Programs\Python\Python38\DLLs', 'C:\Users\Morteza\AppData\Local\Programs\Python\Python38\lib', 'C:\Users\Morteza\AppData\Local\Programs\Python\Python38', 'G:\Ra-system_ERP\ERP_APP\env', 'G:\Ra-system_ERP\ERP_APP\env\lib\site-packages']
Wed, 28 Sep 2022 18:32:52 +0000
`

`


  • G:\Ra-system_ERP\ERP_APP\env\lib\site-packages\ra\admin\admin.py
    , line 343, in wrapper
    1.                 return self.admin_site.admin_view(view)(*args, **kwargs)
    Local vars
    Variable Value
    args (<WSGIRequest: GET '/sample_erp/expense/'>,)
    kwargs {}
    self <ExpenseAdmin: model=Expense site=RaAdminSite(name='ra_admin')>
    view <bound method EntityAdmin.changelist_view of <ExpenseAdmin: model=Expense site=RaAdminSite(name='ra_admin')>>

You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard page generated by the handler for this status code.

`

`

  • G:\Ra-system_ERP\ERP_APP\env\lib\site-packages\ra\admin\admin.py, line 324, in changelist_view
    1.         return super(EntityAdmin, self).changelist_view(request, extra_context)
    Local vars
    Variable Value
    class <class 'ra.admin.admin.EntityAdmin'>
    extra_context {'description': None}
    request <WSGIRequest: GET '/sample_erp/expense/'>
    self <ExpenseAdmin: model=Expense site=RaAdminSite(name='ra_admin')>

`

`

  • G:\Ra-system_ERP\ERP_APP\env\lib\site-packages\reversion\admin.py, line 235, in changelist_view
    1.             return super().changelist_view(request, context)
    Local vars
    Variable Value
    class <class 'reversion.admin.VersionAdmin'>
    context {'description': None, 'has_change_permission': True}
    extra_context {'description': None}
    request <WSGIRequest: GET '/sample_erp/expense/'>
    self <ExpenseAdmin: model=Expense site=RaAdminSite(name='ra_admin')>

`

Charts are not shown

Hi,

Just tried to implement the sample you have included into the documentation. got to the "Adding charts" and faced this error. maybe you could help me resolve it?

her is the output of chrome console on refreshing the report page (Django does not output any error itself):

image

here is my pip freeze output in case you wanted to reproduce it yourself

asgiref==3.5.0
dateutils==0.6.7
Django==2.2.13
django-appconf==1.0.5
django-compressor==2.3
django-crequest==2018.5.11
django-crispy-forms==1.8.0
django-jazzmin==2.4.9
django-polymorphic==3.1.0
django-ra-erp==1.3.1
django-reversion==4.0.2
django-slick-reporting==0.6.3
django-tabular-permissions==2.9
django-utils-six==2.0
psycopg2-binary==2.9.3
python-dateutil==2.8.2
python-memcached==1.59
pytz==2021.3
rcssmin==1.0.6
rjsmin==1.1.0
simplejson==3.17.6
six==1.16.0
sqlparse==0.4.2
swapper==1.1.1
typing_extensions==4.0.1
unicodecsv==0.14.1

ReportView get_queryset Request parameter

I have admin.py code to show only rows relevant to a user.

    def get_queryset(self, request):
        qs = super().get_queryset(request)
        adminuser = request.user
        return qs if adminuser.is_superuser else qs.filter(user=adminuser.id)

I need to do the same in a Report. So trying this.

def get_queryset(self, request): # show only the users own employee record. Superuser can see all.
        qs = super().get_queryset() # Can't pass in request without error about too many parameters.
        adminuser = request.user
        return qs if adminuser.is_superuser else qs.filter(user=adminuser.id)

But I see this error.
Django Version: | 4.2.3
TypeError
EmployeeList.get_queryset() missing 1 required positional argument: 'request'
/home/user/apps/project/env/lib/python3.10/site-packages/slick_reporting/views.py, line 328, in get_report_results
erp_framework.admin.base.get_report_view
Python v3.10.11

But if I change the following code to add request my Report appears and filtered by the active user as expected. Great.

    def get(self, request, *args, **kwargs):
        form_class = self.get_form_class()
        self.form = self.get_form(form_class)
        if self.form.is_valid():
            report_data = self.get_report_results(request) # Request added Line 162

And

    def get_report_results(self, request, for_print=False): # Request added Line 322
        """
        Gets the reports Data, and, its meta data used by datatables.net and highcharts
        :return: JsonResponse
        """
        queryset = self.get_queryset(request) # Request added Line 328

This may be a Slick Reporting bug and seems linked to this.
RamezIssac/django-slick-reporting#31 (comment)

Thanks.

Unable to install

Hi

Been trying to install using the instructions both as a standalone and integrating into an existing system

I keep getting this error

django.core.exceptions.ImproperlyConfigured: The app label 'ra.admin' is not a valid Python identifier.

Kindly assist

Cheers

Reports Filter Form

I have a model with a number of FK and 1to1 fields.
user, department etc.

Reports automatically show these as filters. Awesome.
However, is there a way to not allow 'user' to be a filter?

I have reports where I've set the get_queryset to only allow is_staff to see their own Employee details.

    def get_queryset(self): # show only the users own employee record. Superuser can see all.
        qs = super().get_queryset() # Can't pass in request without error about too many parameters.
        if self.request.user.is_superuser:
            logMessage(f'Reports g_qs IS Superuser = {self.request.user}')
            return qs # just return everything
        adminuser = self.request.user
        return qs.filter(user=adminuser)

The Filters at the top of the report show all Users via the Select2.
This is potentially a minor security concern. All Admin users will be a minimum of staff but they can see all the usernames as is.
Also, as they can only see their own record there is no need for this User Filter. It affords a capability they can't use.

I've had an epic 3 day battle using form_class = EmployeeForm where I've built a Custom Form. But I couldn't get it working properly (too many issues to relate) and the change to the Report Filters is quite minor so I don't really need a Custom Form with all the extra work and complexity.

Is there a way of stating in my @register_report_view class EmployeeList(ReportView): to not show a filter?

error because not install sqlite database

hi Ramiz
thank you for your grateful package
we realy need your package and i will help you for improve it

after install ra-erp
i noticed that the website didn't load because the sqlite database hadn't generated

also there are problem in static_root

i will fix this on my web site because i am using PostgreSQL database but i attend you for this problem
youssri

Inconsistent Method Resolution Order (MRO) in TimeSeriesSelectorReportView in views.py line 213

Issue:

I think the class TimeSeriesSelectorReportView in django-erp-framework/erp_framework/reporting/views.py inherits from both UserPassesTestMixin and ReportViewBase in the wrong order. This results in a TypeError: Cannot create a consistent method resolution order (MRO) for bases error when attempting to runserver or migration.

Observed Behavior:

When running python manage.py migrate, the following error occurs:

Traceback (most recent call last):
...
..
..
...
File "/home/gedion/Desktop/ERP/virt/src/django-erp-framework/erp_framework/reporting/views.py", line 213, in <module>
class TimeSeriesSelectorReportView(UserPassesTestMixin, ReportViewBase):
TypeError: Cannot create a consistent method resolution order (MRO) for bases UserPassesTestMixin, ReportViewBase

Screenshot from 2023-12-11 17-26-25

Expected Behavior:
runserver and Migrations should run successfully without encountering any errors.

Proposed Solution:
The order of inheritance in TimeSeriesSelectorReportView should be reversed:

class TimeSeriesSelectorReportView(ReportViewBase, UserPassesTestMixin):

Screenshot from 2023-12-11 17-27-35

This ensures that methods from ReportViewBase are prioritized over those from UserPassesTestMixin, resolving the MRO conflict and allowing to the server and migrations to run successfully.

Additional Notes:
This issue was identified during development of the my-shop project.
The proposed solution was tested and confirmed to resolve the error.
This appears to be a bug in the django-erp-framework package.

Desired Outcome:
The developers of django-erp-framework address this bug in a future release. The documentation for django-erp-framework is updated to reflect the correct order of inheritance for TimeSeriesSelectorReportView.

Getting Started "You don’t have permission to view or edit anything."

I've installed django-erp-framework twice. Once on my localhost and once on my opalstack hosting account.

Both result in an admin page stating

[ERP Framework System](http://127.0.0.1:8000/erp-system/)
Welcome, . [View site](http://127.0.0.1:8000/) / 
Dashboard Home
You don’t have permission to view or edit anything.

I suspect I'm missing an active User rather than just superuser.

Clicking logout results in a debug page stating the following - I've also commented on the other open issue - #31 (comment) - suspect they are related. Am I missing a step?
Can't wait to get started. So close.

TemplateDoesNotExist   admin/logout.html
C:\django\bms\lib\site-packages\django\template\loader.py, line 47, in select_template django.contrib.admin.sites.logout
C:\django\bms\Scripts\python.exe 3.10.5
['C:\\django\\bms\\bmsproj',  'C:\\Program Files\\Python310\\python310.zip',  'C:\\Program Files\\Python310\\DLLs',  'C:\\Program Files\\Python310\\lib',  'C:\\Program Files\\Python310',  'C:\\django\\bms',  'C:\\django\\bms\\lib\\site-packages']

Django tried loading these templates, in this order:</p>
        
C:\django\bms\lib\site-packages\django\contrib\auth\templates\admin\logout.html (Source does not exist)
C:\django\bms\lib\site-packages\crispy_bootstrap4\templates\admin\logout.html (Source does not exist)
C:\django\bms\lib\site-packages\reversion\templates\admin\logout.html (Source does not exist)</li>
C:\django\bms\lib\site-packages\tabular_permissions\templates\admin\logout.html (Source does not exist)
C:\django\bms\lib\site-packages\slick_reporting\templates\admin\logout.html (Source does not exist)
C:\django\bms\lib\site-packages\django\contrib\admin\templates\admin\logout.html (Source does not exist)

On reflection the "you don't have permission to view or edit anything" will be because I've no models at the start.
So the linked to comment 31 has this issue when I try to add models/admin content.

from erp_framework.admin.admin import erp_framework_site, EntityAdmin #, TransactionAdmin, TransactionItemAdmin
ImportError: cannot import name 'erp_framework_site' from 'erp_framework.admin.admin' (/home/myuser/apps/myproject/env/lib/python3.10/site-packages/erp_framework/admin/admin.py)

This in admin.py
from erp_framework.admin.admin import erp_framework_site

And note, I'm not including Jazzmin, want to try a before and after.

Invalid filter: 'jazzy_admin_url'

After login to admin panel we will get error:

TemplateSyntaxError
Invalid filter: 'jazzy_admin_url'

File:
lib/python3.8/site-packages/ra/admin/templates/ra/sidebar.html, error at line 24

Need to change:
from: <a href="{{ request.user|jazzy_admin_url }}" class="d-block">{{ request.user }}</a>
to: <a href="{% jazzy_admin_url request.user %}" class="d-block">{{ request.user }}</a>

Contribution possibilities

Hi, I stumble this project in Github feed is there a possibility that I can contribute this project? I am willing to contribute and learn also.

crequest not found but i installed one

File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1142, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crequest'

i18n Paths Problem

Potentially an ERP problem but could be Jazzmin or a fault somewhere in my project.
Can anyone replicate?

I use en-gb/ and es/ for Spanish translation. i18n.
Main Urls.py is below.
It works a treat except for urls with es/ naturally in the path.

When moving from Spanish es/ to English the url gets mangled.
/humanresources/employee/
To
/humanresourcemployee/

Some code somewhere is stripping out every occurence of es/
I've tried many urls.py approaches and most created urls like
domain.com/es/humanresources/employee.

The setup below makes it much neater such that the en-gb/ or es/ never appear in the path.
domain.com/somemodelnotendingines/employee.

Remember, the fault only shows when moving from Spanish to English. I expect the same problem would occur with an app/model ending in any language code.

Finally, I'm using Jazzmin_Settings "language_chooser": True,

Django Extensions show urls.
/humanresources/employee/ django.contrib.admin.options.changelist_view erp_framework:humanresources_employee_changelist

from django.views.i18n import set_language
urlpatterns = [
path('admin/doc/', include('django.contrib.admindocs.urls')),
path("admin/", admin.site.urls),
path("i18n/", set_language, name='set_language'),
path('', erp_admin_site.urls),
]

I can't run django ra

I have problem with django 4.0

web_1  |   File "/usr/local/lib/python3.10/site-packages/ra/apps.py", line 3, in <module>
web_1  |     from django.utils.translation import ugettext_lazy as _
web_1  | ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/local/lib/python3.10/site-packages/django/utils/translation/__init__.py)

Duplicate application labels

Hi
I found bug in settings.py after run ra-admin start project_name.
Duplicate application labels in INSTALLED_APPS:

    'crequest',
    'crequest',

Django >4.0 compatibility. ugettext_lazy > gettext_lazy

ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/home/rusty/ra-django/venv/lib/python3.10/site-packages/django/utils/translation/__init__.py)

Because of removing ugettext_lazy from Django 4.0 version, and higher, you need to add check for this import, and change old version :

from django.utils.translation import ugettext_lazy as _

to new

from django.utils.translation import gettext_lazy as _

Same story with ImportError: cannot import name 'force_text' from 'django.utils.encoding'

Django 4.0+ use force_str instead of force_text

Cannot import erp_framework_ site

I am following the tutorial and at the admin.py, I am getting the error

ImportError: cannot import name 'erp_framework_site' from 'erp_framework.admin.admin' (/home/ubuntu/erp/.venv/lib/python3.10/site-packages/erp_framework/admin/admin.py)

Value calculated on sales transacation line not showing on admin page

So I keyed in all your code to calculate the quantity, total, value.
On the sales transaction lines tab after I saved it updates to show correct values,
these values are not showing on the admin nor are they totaled.
Home>Sample_Erp>Sales. I was looking to see if I could just add a field to the admin.py that would contain the total of the values

Order of Jazzmin Installed Apps and Tabular Inline Editing of Foreign Keys

This is a weird one.
In https://github.com/RamezIssac/my-shop/blob/main/my_shop/settings.py the installed apps has this.

    "erp_framework.admin.jazzmin_integration",
    "erp_framework.admin",
    "erp_framework.reporting",
    "slick_reporting",
    "jazzmin",

I have Tabular Inlines with Add Another ModelName.
With the above order of installed apps any ForeignKeys Select2 is inoperable. Clicks do nothing.
By chance on my local settings.py I changed the order of jazzmin as follows just so it was easier to comment out for tests.
On my local setup the Foreign Key Select2 boxes worked normally.
Whether it is worth investigating I'm not sure but a change to my-shop and docs would prevent this odd edge case.

    'erp_framework',
    "erp_framework.admin.jazzmin_integration", # if you want to use jazzmin theme, otherwise remove this line
    'jazzmin', # optional    
    'erp_framework.admin',
    'erp_framework.reporting',
    'slick_reporting',

Reports 403 Forbidden unless Superuser.

Title says it all.
I can see Reports when a low ranking View only user. But a click on a report results in a 403.
Tried all sorts of combinations of Permissions Group/User. Only thing that works is when User is made Super.

UPDATE.
I restarted django and now my low rank user can see the Report.
But the problem is now the opposite. The reports are viewable even when logged out.
I've got all the permissions off for things like.
Authentication and Authorization, Reversion and Reporting. All off for both User and Group.

So anyone can see the Report if they know the url. Looking at the admin route I can see I'm the Anonymous User. With no models listed but Reports are and can be viewed. Possibly a Django configuration thing rather than ERP.

pip installation misses django-compressor module

The pip installation missing django-compressor module

Starting new application with ra-admin start project_name and then migrate I get the following error:
ModuleNotFoundError: No module named 'compressor'

After pip install django-compressor, migrate runs

Admin versus Root Path Functionality

Take a look at your my-shop
Attempt to Change Password from the Dashboard. (From Icon on right).
http://my-shop.django-erp-framework.com/accounts/login/?next=/password_change/ - Fails to Django Debug page with a 404

http://my-shop.django-erp-framework.com/**admin**/accounts/login/?next=/password_change/ - addition of /admin/ for the win.

Refering to my own project now.
Essentially, on all ERP projects you have to be in the /admin/ path for typical User/Group functions to work.
It is possible to see the list of Users or Groups but a click to a path like this mywebsite.com/auth/group/2/change/ results in a KeyError

KeyError at /en-gb/auth/group/2/change/
'appname.randommodelname' - which appears to be nothing to do with Groups
Again adding in domain.com/admin/... fixes the issue.

Going on great otherwise.

CSRF Issue

Hi:

After a fresh install I'm getting a CSRF token error when trying to login with super user:

....
django.template.exceptions.TemplateSyntaxError: Invalid filter: 'jazzy_admin_url'
...

In template /home/osboxes/.local/lib/python3.6/site-packages/ra/admin/templates/ra/sidebar.html, error at line 24

Cheers,
Dave

diverse between install backage and gitup

hi Ramiz
thank your for your best ERB

i work hard to pull requests for more functionality but i noteced that
defference between the copy was installed and this in django-ra-erp\ra\base.models

for example in installed package you can find following but you can't find it in the same location in Githup

class BasePersonInfo(BaseInfo):
    address = models.CharField(_('address'), max_length=260, null=True, blank=True)
    telephone = models.CharField(_('telephone'), max_length=130, null=True, blank=True)
    email = models.EmailField(_('email'), null=True, blank=True)

    class Meta:
        abstract = True
        # swappable = swapper.swappable_setting('ra', 'BasePersonInfo')

i will send pull request for fix this

pip installation misses ra.top_search module

The pip installation command is missing the ra.top_search module.

Starting a new application gets the following error:
ModuleNotFoundError: No module named 'ra.top_search'

After copying the ra/top_search folder from the source code, the project runs well.

Installation issues using pip install django-erp-framework

I did pip install to a project that I started and created a CustomUser. I edited the settings.py file and it gave me a series of errors for missing modules. I installed all the missing modules, now it gives an error for the erp-framework urls...
Am I supposed to run django-admin startproject erp-frameork or manay.py startapp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.