Thursday, April 25, 2024
1 change · master
Resolved issues and error corrections
The update prevents users from accidentally changing protected invoice or bill fields after another user has already posted the document. This helps keep posted accounting records consistent while still allowing approved technical processes to bypass the check when necessary.
Original PR description
When an invoice/bill is in a draft state and opened by 2 users, If one of them posted the invoice, the other user's form are not up-to-date, resulting in some whacky behavior like modifying fields that are supposed to be unmodifiable on a posted move. This commit adds a check on move write function to prevent this behavior, by raising error when modifying a readonly field if the field the user is going to write in a readonly mode depending on its state. If by any reason it is needed to modify the readonly field through the code, instead of resetting the move to draft, writing the change, and posting it back (which can be tedious and resource heavy), we'll allow it by adding the context `skip_readonly_check=True` to skip this check. task-id: 3536150 related Community PR: https://github.com/odoo/odoo/pull/160096