diff --git a/account_constraints/account_constraints.py b/account_constraints/account_constraints.py index 42637d1cc..114ea389e 100644 --- a/account_constraints/account_constraints.py +++ b/account_constraints/account_constraints.py @@ -45,7 +45,10 @@ class AccountMoveLine(orm.Model): _inherit = 'account.move.line' def _authorized_reconcile(self, vals): - "check if only reconcile value are altered" + """ Check if only reconcile_id and/or reconcile_partial_id are altered. We + cannot change other vals, but we should be able to write or unlink those field + (e.g. when you want to manually unreconcile an entry generated by an invoice). + """ if not vals: return False rec_keys = set(["reconcile_id", "reconcile_partial_id"]) @@ -85,7 +88,7 @@ class AccountMoveLine(orm.Model): - Is the move related to an invoice - Is the move related to a bank statement - - Only pure reconcile are allowed + - Is other values than reconcile_partial_id and/or reconcile_id modified In that case, we forbid the move to be deleted even if draft. We should never delete directly a move line related or generated by @@ -104,7 +107,7 @@ class AccountMoveLine(orm.Model): - Is the move related to an invoice - Is the move related to a bank statement - - Only pure reconcile are allowed + - Is other values than reconcile_partial_id and/or reconcile_id modified In that case, we forbid the move to be modified even if draft. We should never update directly a move line related or generated