eiru_contract.py 571 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. from openerp import api, models, fields
  3. class account_analytic_account(models.Model):
  4. _inherit = "account.analytic.account"
  5. employee_id = fields.Many2one(string='Cobrador', related="partner_id.employee_id")
  6. def _prepare_invoice_data(self, cr, uid, contract, context=None):
  7. context = context or {}
  8. invoice = super(account_analytic_account, self)._prepare_invoice_data(
  9. cr, uid, contract, context=context)
  10. invoice.update({
  11. 'employee_id': contract.employee_id})
  12. return invoice