From ae824ec9368eeaaf3ac9cb3c93facbf632bf4490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 16 Jun 2019 19:14:46 +0200 Subject: [PATCH] Require tax on tax line Without a proper tax, the tax line is never shown in any tax code reports. issue8364 review261511002 --- CHANGELOG | 1 + tax.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8dba117522..c8487c3349 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Make tax required on tax line * Use today as default date when inside the period Version 5.2.0 - 2019-05-06 diff --git a/tax.py b/tax.py index eac5bc0ebc..fe865839b1 100644 --- a/tax.py +++ b/tax.py @@ -1099,7 +1099,7 @@ class TaxableMixin(object): line['legal_notice'] = tax.legal_notice line['base'] = base line['amount'] = amount - line['tax'] = tax.id if tax else None + line['tax'] = tax.id line['account'] = getattr(tax, '%s_account' % type_).id return _TaxKey(**line) @@ -1152,7 +1152,7 @@ class TaxLine(ModelSQL, ModelView): ('base', "Base"), ], "Type", required=True) tax = fields.Many2One('account.tax', 'Tax', select=True, - ondelete='RESTRICT', + ondelete='RESTRICT', required=True, domain=[ ('company', '=', Eval('company', -1)), ],