summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2018-07-20 16:07:05 +0200
committerMartin Trigaux <mat@odoo.com>2018-07-20 16:43:42 +0200
commit85423d20b22eb49b8401a1ea33c6fca5fec295a2 (patch)
tree53ef915557c17e25493309fb860a697c46db5c9f
parent3869cdf7d8202c8157c1134d74549b3096758253 (diff)
[FIX] account: partially revert 3754280a
The changes should not have been merged in stable. Users installing the account module before 3754280a had a not null constraint on the field company_id. After updating the code, the field is still required but has no default value. If a chart of account is installed after updating the code, it would fail. opw-1867358
-rw-r--r--addons/account/models/chart_template.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py
index 8de2ea0f685..2718f7e67ce 100644
--- a/addons/account/models/chart_template.py
+++ b/addons/account/models/chart_template.py
@@ -510,7 +510,7 @@ class AccountTaxTemplate(models.Model):
amount_type = fields.Selection(default='percent', string="Tax Computation", required=True,
selection=[('group', 'Group of Taxes'), ('fixed', 'Fixed'), ('percent', 'Percentage of Price'), ('division', 'Percentage of Price Tax Included')])
active = fields.Boolean(default=True, help="Set active to false to hide the tax without removing it.")
- company_id = fields.Many2one('res.company', string='Company')
+ company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.user.company_id)
children_tax_ids = fields.Many2many('account.tax.template', 'account_tax_template_filiation_rel', 'parent_tax', 'child_tax', string='Children Taxes')
sequence = fields.Integer(required=True, default=1,
help="The sequence field is used to define order in which the tax lines are applied.")