Skip to Content
Menú
This question has been flagged
1 Respondre
3601 Vistes

I want to create an account.invoice.line object from code, with only providing the product_id (which is loaded from sale.config.settings), the quantity (it will be always 1.0) and the price_unit, also the invocie_id (that was previously created).

In old api i used to call onchange methods pasing fields as parameters so i created the lines with the values returned with the onchange updating only certain values i wanted, but i cannot manage to do this with the new api.

Can i call the onchange pasing needed parameters to get the needed data, as for example account_id?

Avatar
Descartar
Autor Best Answer

I solved it by creating the line with 'account_id'=1, and a generic 'name', and then calling the _onchange_product_id()  method on the created line, and then updated the price_unit with the correct amount.

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de set. 17
3542
1
de juny 15
5030
2
d’abr. 25
2958
3
de nov. 24
17897
1
de nov. 22
3147