[REF] base, account: removed vat_subjected field. Mainly because it's confusing and rarely really needed, like never + the same feature could be achieved by duplicating taxes for non-subjected companies (with fiscal position on them for mapping)

This commit is contained in:
qdp-odoo
2015-06-24 08:37:12 +02:00
parent eace69d07d
commit 13050d3e4b
6 changed files with 5 additions and 17 deletions
+2 -4
View File
@@ -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',
+1 -1
View File
@@ -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",
-6
View File
@@ -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:
-1
View File
@@ -12,7 +12,6 @@
<div name="vat_info" class="o_row">
<field name="vat" on_change="vat_change(vat)" placeholder="e.g. BE0477472701"/>
<button name="button_check_vat" string="Check Validity" class="oe_link" type="object" icon="fa-cog"/>
<field name="vat_subjected"/>
</div>
</field>
</field>
+1 -4
View File
@@ -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
+1 -1
View File
@@ -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'),