You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
522 B

  1. # -*- coding: utf-8 -*-
  2. from openerp import models, fields, api
  3. class AccountInvoice(models.Model):
  4. _inherit = 'account.invoice'
  5. @api.one
  6. @api.depends('invoice_line.account_analytic_id')
  7. def _analytic_account_ids(self):
  8. self.analytic_account_ids = \
  9. self.mapped('invoice_line.account_analytic_id')
  10. analytic_account_ids = fields.Many2many(
  11. comodel_name='account.analytic.account',
  12. compute='_analytic_account_ids',
  13. store=True,
  14. string='Contracts')