Open NL66278 opened 1 year ago
@NL66278 Ron did you find any solution for this issue?
@andreschenkels I did not. At the moment unfortunately very limited in time. Is it urgent for you?
It's needed for a project going live at the start of 2025. So there is time. I also see a bug regarding Auditlog with Creditnote creation. Could be something similar.
Module auditlog
When having product templates with customer taxes in a multi company setting, and there is an audit rule on product.template, the user will no longer be able to open the product form, the user will get a messsage that he is not allowed to read some tax because of: This restriction is due to the following rules:
The user set to look at company A will get an error for taxes for company B and vice versa.
Apparently the audit rule influences how the field taxes_id (the same also goes for the Vendor Taxes by the way) is read. Without audit log rule, or the rule unsubscribed, taxes_id only contains the tax the user can see due to the Tax multi-company rule. WIth the rule enabled, taxes_id contains all taxes defined for the product. DESPITE THE RULE ONLY BEING FOR WRITE, CREATE AND UNLINK. So somehow, I was not able to see in the code why, the auditlog rule influences the reading of values for product.template, even without logging reads.
To Reproduce
I noted this on Odoo 15.0. AuditLog is at 15.0.1.1.0
Steps to reproduce the behavior:
Expected behavior The form should just open and only show the taxes for the active company.
I added a traceback to the generation of the error and a pdb line to product template model to see what was going on. Last part of traceback pasted below. Diff to odoo for traceback and pdb attached.
Traceback:
(For some reason could not attach traceback. patch, had to rename it to traceback.txt)