Module
product_cost_security
Describe the bug
The module prevents changin boolean field "picked" on stock.move.line when installed for users without read access to product cost fields. Inventory users should be able to change field "picked" on stock.move even if they are not allowed to see product costs.
amount = - unit_amount * self.product_id.standard_price
Since standard_price requires read access on the product cost, this raises an AccessError for users without required rights when product_cost_security is installed.
It seems that this call should likely use sudo() and price saved in cache as it was resolved in issue #2115
However, i am not sure if any other change should be made along this.
To Reproduce
Affected versions: 18.0.1.0.0
Steps to reproduce the behavior:
- Start new odoo18 database
- Login as admin
- Install modules: project_stock_account, product_cost_security
- Give admin user permission for Analytic Accounting
- Activate developer mode
- Enable Analytic Costs on operation type
- Create/edit stock.picking with operation type from previous step and add project
- In stock.picking lines, select "picked" field to be shown
- In stock.picking lines, change boolean field "picked" and save document
Result:
Saving "picked" field fails with an access error when reading product_id.standard_price.
Expected behavior
Changing boolean field "picked" on stock move should succeed for users without product cost access rights. The module should not block standard stock operations.
Module
product_cost_security
Describe the bug
The module prevents changin boolean field "picked" on stock.move.line when installed for users without read access to product cost fields. Inventory users should be able to change field "picked" on stock.move even if they are not allowed to see product costs.
Since standard_price requires read access on the product cost, this raises an AccessError for users without required rights when product_cost_security is installed.
It seems that this call should likely use sudo() and price saved in cache as it was resolved in issue #2115
However, i am not sure if any other change should be made along this.
To Reproduce
Affected versions: 18.0.1.0.0
Steps to reproduce the behavior:
Result:
Saving "picked" field fails with an access error when reading product_id.standard_price.
Expected behavior
Changing boolean field "picked" on stock move should succeed for users without product cost access rights. The module should not block standard stock operations.