Closed Tisho99 closed 8 months ago
Hi @sergio-teruel, some modules you are maintaining are being modified, check this out!
@ValentinVinagre @HaraldPanten @pedrobaeza
Although it's correct, the proper place to do this is in Odoo. In fact, we have done it already for 15.0: https://github.com/odoo/odoo/pull/147137, and you should just wait for the patch to be forward-ported to 16.0.
Thank you Pedro!
Users without the "sale_margin_security.group_sale_margin_security" permission group can not duplicate sale.order records due to a permission error. This PR avoids that error setting Copy=False in that inherited field's inheritance.
Extended explanation:
The purchase_price field has:
When a user without the 'sale_margin_security.group_sale_margin_security' tries to copy a record of the model, an error is shown because Odoo tries to access to the field with the salesman user but it does not have the permission
The purchase_price has a computed default value, and the case of manually editing it is not common; so setting copy=False on the field and priorizing the compute over the manual changes should not be a problem