Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3531 Переглядів

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?

Аватар
Відмінити
Автор Найкраща відповідь

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.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
вер. 17
3447
1
черв. 15
4819
2
квіт. 25
2828
when i use @api.model? Вирішено
3
лист. 24
17529
1
лист. 22
3022