Hi,
I have used onchange to add a new field in the invoice line the pb when I click on save it return to zero
here is my code:
def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice',
partner_id=False, fposition_id=False, price_unit=False, currency_id=False,
company_id=None, context=None):
res = super(invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty=qty, name=name, type=type, partner_id=partner_id,fposition_id=fposition_id, price_unit=price_unit, currency_id=currency_id, company_id=company_id, context=context)
for product_data in self.pool.get('product.product').browse(cr, uid,[product], context=context):
if res:
res['value'].update({available_quantity':product_data.qty_available})
return res
'available_quantity' : fields.float('Quantité disponible',readonly=True),
Could you help me to figure out what is the pb ???