Skip to content

Commit

Permalink
Merge PR #419 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by NL66278
  • Loading branch information
OCA-git-bot committed Oct 1, 2024
2 parents 266500c + b265184 commit d83c81f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion l10n_nl_tax_statement/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def check_field_is_equal(self, changed_protected_field, values):
old_value = self[changed_protected_field]
new_value = values[changed_protected_field]
if field.type in ["many2many", "one2many"]:
# if field is X2M , the only acceptable value is
if all(isinstance(_id, int) for _id in new_value):
return new_value == old_value.ids
# if field is X2M , the only other acceptable value is
# [[6,0,self[changed_protected_field].ids]]
# wich is what the web client posts in case there is a editable X2M in form
# that is unchanged.
Expand Down
5 changes: 5 additions & 0 deletions l10n_nl_tax_statement/tests/test_l10n_nl_vat_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,3 +581,8 @@ def test_20_multicompany(self):

company_ids_full_list = statement_parent._get_company_ids_full_list()
self.assertEqual(len(company_ids_full_list), 3)

def test_21_write_id_list(self):
self._create_test_invoice()
self.invoice_1.line_ids.write({"tax_tag_ids": self.tag_1.ids})
self.assertEqual(self.invoice_1.mapped("line_ids.tax_tag_ids"), self.tag_1)

0 comments on commit d83c81f

Please sign in to comment.