summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2019-11-20 08:46:19 +0000
committerfw-bot <otis@odoo.com>2019-11-20 15:00:41 +0000
commit64b9269b9b37f31ecba3bec18ae953c4b2cc3310 (patch)
tree104f42055f3672d6c9d99df83fbf43b7f9d4fc30 /addons
parent210858cc6655759c9eb09c4f3bae0d83c756323e (diff)
[FIX] account: no force lock date after deleting tax line
Open Accounting app, go to Accounting>"Lock Dates" and set a "Tax Lock Date". Now create a Vendor Bill with invoice date prior to the tax lock date, add a line, Odoo will display a warning. Remove the Tax from the line, save. The accounting date will be forced to tax_lock_date + 1 which should be not the case since the order is without tax. Adding a check to force the tax only when tax line ids are present. opw-2115547 closes odoo/odoo#40570 X-original-commit: 8083f103287b7632351e06de6c48bf3ea32d90aa Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_move.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 5339dece157..b8104a841d3 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -2079,7 +2079,7 @@ class AccountMove(models.Model):
# When the accounting date is prior to the tax lock date, move it automatically to the next available date.
# /!\ 'check_move_validity' must be there since the dynamic lines will be recomputed outside the 'onchange'
# environment.
- if move.company_id.tax_lock_date and move.date <= move.company_id.tax_lock_date:
+ if (move.company_id.tax_lock_date and move.date <= move.company_id.tax_lock_date) and (move.line_ids.tax_ids or move.line_ids.tag_ids):
move.date = move.company_id.tax_lock_date + timedelta(days=1)
move.with_context(check_move_validity=False)._onchange_currency()