Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3586 Weergaven

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
Annuleer
Auteur Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
sep. 17
3507
1
jun. 15
4954
2
apr. 25
2905
3
nov. 24
17764
1
nov. 22
3111