Skip to content
Snippets Groups Projects
Commit b64358a3f058 authored by oury.balde's avatar oury.balde
Browse files

Fix regression for document pieces

Remove unnecessary conditions related to invoices
parent 29e27a932a89
No related branches found
No related tags found
1 merge request!25Fix regression for document pieces
Pipeline #57053 passed
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
Changelog Changelog
========= =========
13.0.1.5.1
----------
Fix regression for document pieces
13.0.1.5.0 13.0.1.5.0
---------- ----------
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"name": "Accounting Periods", "name": "Accounting Periods",
"license": "AGPL-3", "license": "AGPL-3",
"summary": "Add period accounting concept", "summary": "Add period accounting concept",
"version": "13.0.1.5.0", "version": "13.0.1.5.1",
"category": "Accounting/Accounting", "category": "Accounting/Accounting",
"author": "XCG Consulting", "author": "XCG Consulting",
"website": "https://odoo.consulting/", "website": "https://odoo.consulting/",
......
...@@ -95,10 +95,7 @@ ...@@ -95,10 +95,7 @@
# compatibility with account. # compatibility with account.
for move in self: for move in self:
values = vals.copy() values = vals.copy()
if ( if values.get("state", move.state) != "posted":
move.is_invoice(include_receipts=True)
and values.get("state", move.state) != "posted"
):
# if accounting date is put to False, date is left as is. # if accounting date is put to False, date is left as is.
self._update_dates(values) self._update_dates(values)
...@@ -252,10 +249,7 @@ ...@@ -252,10 +249,7 @@
# posting; there is no tests that validate its value except for # posting; there is no tests that validate its value except for
# some specific cases where it is set. This is covered by the code # some specific cases where it is set. This is covered by the code
# in the create and write. # in the create and write.
if ( if accdoc.date != acc_date:
accdoc.is_invoice(include_receipts=True)
and accdoc.date != acc_date
):
accdoc_values["date"] = acc_date accdoc_values["date"] = acc_date
# Set a transaction date when no previous one set. Also, force it # Set a transaction date when no previous one set. Also, force it
......
...@@ -109,6 +109,4 @@ ...@@ -109,6 +109,4 @@
self.assertEqual( self.assertEqual(
test_move.accounting_date, fields.Date.context_today(test_move) test_move.accounting_date, fields.Date.context_today(test_move)
) )
self.assertEqual( self.assertEqual(test_move.date, fields.Date.context_today(test_move))
test_move.date, fields.Date.from_string(self.test_move_date)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment