inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
4.23k stars 763 forks source link

Is not permitted to add/modify comment in attachment in part #8354

Open simoneamadori opened 2 hours ago

simoneamadori commented 2 hours ago

Please verify that this bug has NOT been raised before.

Describe the bug*

When trying to modify the comment of an attachment in part I get this error: Image also is not permitted to delete the attachment it tell me that is prohibited (the user is admin)

Steps to Reproduce

  1. go to attachments in a selected part
  2. press edit
  3. add a comment
  4. press submit

Expected behaviour

Pressing submit should apply the updated data

Deployment Method

Version Information

Version Information:

InvenTree-Version: 0.16.5 Django Version: 4.2.15 Commit Hash: 6e37f0c Commit Date: 2024-10-07

Database: postgresql Debug-Mode: False Deployed using Docker: True Platform: Linux-5.15.0-124-generic-x86_64-with Installer: DOC

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}, {'name': 'KiCadLibraryPlugin', 'slug': 'kicad-library-plugin', 'version': '1.4.3'}]

Please verify if you can reproduce this bug on the demo site.

Relevant log output

No response

SchrodingersGat commented 1 hour ago
simoneamadori commented 1 hour ago

The problem is only on the modifying / delete, when creating it create it correctly.

Image

The Cross-Origin-Opener-Policy header has been ignored, because the URL's origin was untrustworthy. It was defined either in the final response or a redirect. Please deliver the response using the HTTPS protocol. You can also use the 'localhost' origin instead. See https://www.w3.org/TR/powerful-features/#potentially-trustworthy-origin and https://html.spec.whatwg.org/#the-cross-origin-opener-policy-header. 240/:1

   Failed to load resource: the server responded with a status of 400 (Bad Request)

jquery_3.3.1_jquery.min.js:2

   PATCH http://192.168.10.18:1337/api/attachment/240/ 400 (Bad Request)

send @ jquery_3.3.1_jquery.min.js:2 ajax @ jquery_3.3.1_jquery.min.js:2 inventreePut @ en.api.js:151 submitFormData @ en.forms.js:970 (anonymous) @ en.forms.js:725 dispatch @ jquery_3.3.1_jquery.min.js:2 y.handle @ jquery_3.3.1_jquery.min.js:2

SchrodingersGat commented 1 hour ago

PATCH http://192.168.10.18:1337/api/attachment/240/ 400 (Bad Request)

For this request, what data is being sent to the server (the "Request") and back from the server (the "Response").

e.g.

Description Image
The request instance Image
Request data Image
Response data Image
simoneamadori commented 1 hour ago

Here the screenshot: Image Image