Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3475 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 17
3393
1
thg 6 15
4753
2
thg 4 25
2759
3
thg 11 24
17387
1
thg 11 22
2972