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 @@
diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 90cd93b3125..2557a7b3606 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -506,7 +506,7 @@ class website_sale(http.Controller): return values mandatory_billing_fields = ["name", "phone", "email", "street2", "city", "country_id"] - optional_billing_fields = ["street", "state_id", "vat", "vat_subjected", "zip"] + optional_billing_fields = ["street", "state_id", "vat", "zip"] mandatory_shipping_fields = ["name", "phone", "street", "city", "country_id"] optional_shipping_fields = ["state_id", "zip"] @@ -537,9 +537,6 @@ class website_sale(http.Controller): if query.get(prefix + 'country_id'): query[prefix + 'country_id'] = int(query[prefix + 'country_id']) - if query.get(prefix + 'vat'): - query[prefix + 'vat_subjected'] = True - if not remove_prefix: return query diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 048f261b7e7..0b7365f00c1 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -227,7 +227,7 @@ class res_partner(osv.Model, format_address): "that is otherwise used to pick and render date and time values: your computer's timezone."), 'tz_offset': fields.function(_get_tz_offset, type='char', size=5, string='Timezone offset', invisible=True), 'user_id': fields.many2one('res.users', 'Salesperson', help='The internal user that is in charge of communicating with this contact if any.'), - 'vat': fields.char('TIN', help="Tax Identification Number. Check the box if this contact is subjected to taxes. Used by the some of the legal statements."), + 'vat': fields.char('TIN', help="Tax Identification Number. Fill it if the company is subjected to taxes. Used by the some of the legal statements."), 'bank_ids': fields.one2many('res.partner.bank', 'partner_id', 'Banks'), 'website': fields.char('Website', help="Website of Partner or Company"), 'comment': fields.text('Notes'),