diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index 85a17f07559..654946b6fbf 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -115,8 +115,8 @@ class AccountFiscalPosition(models.Model): else: delivery = partner - domains = [[('auto_apply', '=', True), ('vat_required', '=', partner.vat_subjected)]] - if partner.vat_subjected: + domains = [[('auto_apply', '=', True), ('vat_required', '=', bool(partner.vat))]] + if partner.vat: # Possibly allow fallback to non-VAT positions, if no VAT-required position matches domains += [[('auto_apply', '=', True), ('vat_required', '=', False)]] @@ -320,8 +320,6 @@ class ResPartner(models.Model): else: self.currency_id = self.env.user.company_id.currency_id - vat_subjected = fields.Boolean('VAT Legal Statement', - help="Check this box if the partner is subjected to the VAT. It will be used for the VAT legal statement.") credit = fields.Monetary(compute='_credit_debit_get', search=_credit_search, string='Total Receivable', help="Total amount this customer owes you.") debit = fields.Monetary(compute='_credit_debit_get', search=_debit_search, string='Total Payable', diff --git a/addons/account/tests/test_fiscal_position.py b/addons/account/tests/test_fiscal_position.py index dd69f04e8f7..b71ab0db984 100644 --- a/addons/account/tests/test_fiscal_position.py +++ b/addons/account/tests/test_fiscal_position.py @@ -17,7 +17,7 @@ class TestFiscalPosition(AccountingTestCase): country_id = self.res_country_model.search(cr, uid, [('name', '=', 'France')])[0] partner_id = self.res_partner_model.create(cr, uid, dict( name="George", - vat_subjected=True, + vat="BE0477472701", notify_email="always", country_id=country_id)) fp_b2c_id = self.fiscal_position_model.create(cr, uid, dict(name="EU-VAT-FR-B2C", diff --git a/addons/base_vat/base_vat.py b/addons/base_vat/base_vat.py index 8e1d1539506..605fa785c45 100644 --- a/addons/base_vat/base_vat.py +++ b/addons/base_vat/base_vat.py @@ -119,12 +119,6 @@ class res_partner(osv.osv): return False return True - def vat_change(self, cr, uid, ids, value, context=None): - return {'value': {'vat_subjected': bool(value)}} - - def _commercial_fields(self, cr, uid, context=None): - return super(res_partner, self)._commercial_fields(cr, uid, context=context) + ['vat_subjected'] - def _construct_constraint_msg(self, cr, uid, ids, context=None): def default_vat_check(cn, vn): # by default, a VAT number is valid if: diff --git a/addons/base_vat/base_vat_view.xml b/addons/base_vat/base_vat_view.xml index 65c59e0eba9..2d1bb2f8624 100644 --- a/addons/base_vat/base_vat_view.xml +++ b/addons/base_vat/base_vat_view.xml @@ -12,7 +12,6 @@