Permalink
Browse files

[FIX] account: two m2m fields using the same table

The fields `analytic_tag_ids` and `second_analytic_tag_ids` on model
'account.reconcile.model' were accidentally using the same table and columns,
because of the automatic generation of the table name.  Make them explicitly
use distinct table names.
  • Loading branch information...
rco-odoo committed Dec 6, 2018
1 parent 4892d89 commit 60553f72cc635e6a0c1a4195798928b925d08c62
Showing with 4 additions and 2 deletions.
  1. +4 −2 addons/account/models/account_reconcile_model.py
@@ -84,7 +84,8 @@ class AccountReconcileModel(models.Model):
amount = fields.Float(string='Write-off Amount', digits=0, required=True, default=100.0, help="Fixed amount will count as a debit if it is negative, as a credit if it is positive.")
tax_id = fields.Many2one('account.tax', string='Tax', 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')
analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Analytic Tags',
relation='account_reconcile_model_analytic_tag_rel')
# Second part fields.
has_second_line = fields.Boolean(string='Add a second line', default=False)
@@ -104,7 +105,8 @@ class AccountReconcileModel(models.Model):
second_amount = fields.Float(string='Second Write-off Amount', digits=0, required=True, default=100.0, help="Fixed amount will count as a debit if it is negative, as a credit if it is positive.")
second_tax_id = fields.Many2one('account.tax', string='Second Tax', ondelete='restrict', domain=[('type_tax_use', '=', 'purchase')])
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')
second_analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Second Analytic Tags',
relation='account_reconcile_model_second_analytic_tag_rel')
@api.onchange('name')
def onchange_name(self):

0 comments on commit 60553f7

Please sign in to comment.