跳至内容
菜单
此问题已终结
1 回复
3479 查看

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.

形象
丢弃
相关帖文 回复 查看 活动
1
9月 17
3396
1
6月 15
4770
2
4月 25
2767
3
11月 24
17419
1
11月 22
2981