class coef(models.Model):
_inherit='sale.order.line'
coefficient=fields.Float(string="Coefficient UB (%)", require = True)
# fonction permettant de transmettre les valeurs du champs coefficient des devis vers les factures
def _prepare_order_line_invoice_line(self, cr, uid, line, account_id=False, context=None):
ret = super(coef, self)._prepare_order_line_invoice_line(cr, uid, line, account_id=False, context=context)
if line.product_id:
if line.coefficient:
ret['coefficient'] = line.coefficient
return ret
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None):
product_obj = self.pool.get('product.product').browse(cr, uid, product)
return super(coef, self).product_id_change(cr, uid, ids, pricelist, product, qty,
uom, qty_uos, uos, name, partner_id,
lang, update_tax, date_order, packaging, fiscal_position, flag, context)
Sorry for the quality