Skip to content

Commit

Permalink
[FIX] account: Setting analytic tags with no company
Browse files Browse the repository at this point in the history
Due to this commit 1d00daf

It was not possible to set an analytic tag with no company on a reconcialtion model

Ps: The field analytic tag on model account.analytic.tag is not required

opw:2414202

closes #63427

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
  • Loading branch information
simongoffin committed Dec 16, 2020
1 parent 1ebc22b commit 7335825
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/account/models/account_reconcile_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class AccountReconcileModel(models.Model):
decimal_separator = fields.Char(default=lambda self: self.env['res.lang']._lang_get(self.env.user.lang).decimal_point, help="Every character that is nor a digit nor this separator will be removed from the matching string")
tax_ids = fields.Many2many('account.tax', string='Taxes', ondelete='restrict')
analytic_account_id = fields.Many2one('account.analytic.account', string='Analytic Account', ondelete='set null')
analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Analytic Tags', domain="[('company_id', '=', company_id)]",
analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Analytic Tags', domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]",
relation='account_reconcile_model_analytic_tag_rel')
# Second part fields.
has_second_line = fields.Boolean(string='Add a second line', default=False)
Expand All @@ -125,7 +125,7 @@ class AccountReconcileModel(models.Model):
second_amount_from_label_regex = fields.Char(string="Second Amount from Label (regex)", default=r"([\d\.,]+)")
second_tax_ids = fields.Many2many('account.tax', relation='account_reconcile_model_account_tax_bis_rel', string='Second Taxes', ondelete='restrict')
second_analytic_account_id = fields.Many2one('account.analytic.account', string='Second Analytic Account', ondelete='set null')
second_analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Second Analytic Tags', domain="[('company_id', '=', company_id)]",
second_analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Second Analytic Tags', domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]",
relation='account_reconcile_model_second_analytic_tag_rel')

number_entries = fields.Integer(string='Number of entries related to this model', compute='_compute_number_entries')
Expand Down

0 comments on commit 7335825

Please sign in to comment.