# -*- encoding: utf-8 -*- from openerp import models, api, fields class aa_invoice_custom_lines(models.Model): _inherit = 'account.invoice.line' medic_id = fields.Many2one('res.partner',"Médico", domain="[('is_medic', '=', True)]") # def _prepare_order_line_invoice_line(self, cr, uid, line, account_id=False, context=None): # ret = super(aa_invoice_custom_lines, self)._prepare_order_line_invoice_line(cr, uid, line, account_id=False, context=context) # if line.product_id: # if line.medic_id: # ret['medic_id'] = line.medic_id # return ret