Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3617 มุมมอง

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 ตอบกลับ มุมมอง กิจกรรม
Fill a Selection field with API แก้ไขแล้ว
1
ก.ย. 17
3584
1
มิ.ย. 15
5050
2
เม.ย. 25
2996
when i use @api.model? แก้ไขแล้ว
3
พ.ย. 24
18062
1
พ.ย. 22
3224