Change account on tax into properties and make it required for each company
This commit is contained in:
1 parent
2fa491d341
commit
0d74287813
2 files changed
+8
-6
No files matched your search
@@ -488,8 +488,6 @@ class Line(OSV):
|
||||
base_id = tax.refund_base_code.id
|
||||
code_id = tax.refund_tax_code.id
|
||||
account_id = tax.refund_account.id
|
||||
if not account_id:
|
||||
account_id = line.account.id
|
||||
if base_id in line_code_taxes or not base_id:
|
||||
taxes.setdefault((account_id, code_id), False)
|
||||
for tax_line in line.tax_lines:
|
||||
|
||||
@@ -222,17 +222,21 @@ class Tax(OSV):
|
||||
childs = fields.One2Many('account.tax', 'parent', 'Childs')
|
||||
|
||||
company = fields.Many2One('company.company', 'Company', required=True)
|
||||
invoice_account = fields.Many2One('account.account', 'Invoice Account',
|
||||
invoice_account = fields.Property(type='many2one',
|
||||
relation='account.account', string='Invoice Account',
|
||||
domain="[('company', '=', company)]",
|
||||
help='Keep empty to use the default invoice account',
|
||||
states={
|
||||
'readonly': "type == 'none'",
|
||||
'readonly': "type == 'none' or not company",
|
||||
'required': "company",
|
||||
})
|
||||
refund_account = fields.Many2One('account.account', 'Refund Account',
|
||||
refund_account = fields.Property(type='many2one',
|
||||
relation='account.account', string='Refund Account',
|
||||
domain="[('company', '=', company)]",
|
||||
help='Keep empty to use the default refund account',
|
||||
states={
|
||||
'readonly': "type == 'none'",
|
||||
'readonly': "type == 'none' or not company",
|
||||
'required': "company",
|
||||
})
|
||||
|
||||
invoice_base_code = fields.Many2One('account.tax.code',
|
||||
|
||||
Reference in new issue
Block a user