Closed csmith73 closed 7 months ago
I deleted everything and did a full clean install with docker and it did seem to help some. I installed the approvals plugin again with the plugins.txt file and then enabled it without any errors, but now I am getting the following error when I submit a PO.
Traceback (most recent call last):
File "/root/.local/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "inventree_approval_approval" does not exist
LINE 1: SELECT COUNT(*) AS "__count" FROM "inventree_approval_approv...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/.local/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/root/.local/lib/python3.10/site-packages/rest_framework/generics.py", line 190, in post
return self.create(request, *args, **kwargs)
File "/home/inventree/InvenTree/InvenTree/mixins.py", line 75, in create
self.perform_create(serializer)
File "/root/.local/lib/python3.10/site-packages/rest_framework/mixins.py", line 24, in perform_create
serializer.save()
File "/home/inventree/InvenTree/order/serializers.py", line 312, in save
order.place_order()
File "/usr/local/lib/python3.10/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/home/inventree/InvenTree/order/models.py", line 525, in place_order
return self.handle_transition(self.status, PurchaseOrderStatus.PLACED.value, self, self._action_place)
File "/home/inventree/InvenTree/generic/states/transition.py", line 77, in handle_transition
rslt = override.transition(current_state, target_state, instance, default_action, **kwargs)
File "/usr/local/lib/python3.10/site-packages/inventree_approval/ApprovalPlugin.py", line 167, in transition
).count()
File "/root/.local/lib/python3.10/site-packages/django/db/models/query.py", line 412, in count
return self.query.get_count(using=self.db)
File "/root/.local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 528, in get_count
number = obj.get_aggregation(using, ['__count'])['__count']
File "/root/.local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 513, in get_aggregation
result = compiler.execute_sql(SINGLE)
File "/root/.local/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
cursor.execute(sql, params)
File "/root/.local/lib/python3.10/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/root/.local/lib/python3.10/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/root/.local/lib/python3.10/site-packages/django/db/backends/utils.py", line 79, in _execute
with self.db.wrap_database_errors:
File "/root/.local/lib/python3.10/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/root/.local/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "inventree_approval_approval" does not exist
LINE 1: SELECT COUNT(*) AS "__count" FROM "inventree_approval_approv...
^
@csmith73 this is the right place to post about this.
There will be an update soon(ish) that needs 0.14.0 so your problem could be solved then.
This error looks like it could be a missing migration. Maybe restart the server and check in the plugins admin pane for any notifications.
I tried uninstalling and reinstalling the plugin and restarting the server and now I am getting the following error when I try and issue a PO.
Traceback (most recent call last):
File "/root/.local/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/root/.local/lib/python3.10/site-packages/rest_framework/generics.py", line 190, in post
return self.create(request, *args, **kwargs)
File "/home/inventree/InvenTree/InvenTree/mixins.py", line 75, in create
self.perform_create(serializer)
File "/root/.local/lib/python3.10/site-packages/rest_framework/mixins.py", line 24, in perform_create
serializer.save()
File "/home/inventree/InvenTree/order/serializers.py", line 312, in save
order.place_order()
File "/usr/local/lib/python3.10/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/home/inventree/InvenTree/order/models.py", line 525, in place_order
return self.handle_transition(self.status, PurchaseOrderStatus.PLACED.value, self, self._action_place)
File "/home/inventree/InvenTree/generic/states/transition.py", line 77, in handle_transition
rslt = override.transition(current_state, target_state, instance, default_action, **kwargs)
File "/usr/local/lib/python3.10/site-packages/inventree_approval/ApprovalPlugin.py", line 181, in transition
instance.status = PurchaseOrderStatus.PENDING_APPROVAL.value
File "/usr/local/lib/python3.10/enum.py", line 437, in __getattr__
raise AttributeError(name) from None
AttributeError: PENDING_APPROVAL
Which version did you install?
Version 0.4 of approvals plugin and 0.13.5 Inventree version
Please try the current alpha: https://git.invenhost.com/invenhost-c1/-/packages/pypi/inventree-approval/0.5b4
How do I make sure that it installs the latest one? My current plugins.txt file looks like this
# InvenTree Plugins (uses PIP framework to install)
--index-url https://git.invenhost.com/api/packages/invenhost-c1/pypi/simple/
inventree-approval
I am getting the version # from the plugin admin page inside Inventree is that the correct place to see the version number?
@matmair I changed my plugins.txt to the following and it installed version .5b4 and it all seems to be working now. Thanks so much for your help.
# InvenTree Plugins (uses PIP framework to install)
--index-url https://git.invenhost.com/api/packages/invenhost-c1/pypi/simple/
inventree-approval==0.5b4
The version I linked is an alpha so it should not be installed generally - the setting you have is correct normally. You can force the install of the newer (alpha) version by adding ==0.5b4
to the version.
The version you listed is correctly read out.
edit: you were faster than me
@csmith73 so can I close this? I recommend following me on polar to get notifications when I release InvenHost plugins: https://polar.sh/invenhost/
@matmair yes you can close this issue. I am having a different issue now where there is no way to receive items and complete a PO after approval. Should I make a new post for this? Thanks for the polar link I will be sure to follow you on there.
Yes please make a new issue. I am still figuring out how to track issues for technically closed-source projects (I am using JIRA to manage all this in the backend). InvenHost is a way to test out monetisation strategies for the ecosystem but TBH I am going back open-source if tracking bugs keeps being this hard.
@matmair thank you for your work on this plugin. I am not sure if this is the best place to put these issues I am having, if there is a better place to post please let me know. I was able to successfully install the approvals plugin by adding the repo and the plugin name to the plugins.txt file. I enabled the plugin along with making sure that check plugins on startup, app integration, and url integration were all enabled. I was able to enable the plugin successfully but if I navigate to /plugin/inventree-approval I get the below error. This error also occurs when I try to issue a PO. I am running the latest stable release of Inventree 0.13.5, Python 3.10.13, Django 3.2.23 Do you have any suggestions on how to fix this?