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

Hello, I am override a method in Odoo 8. This method is of the model sale.order:

def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context=None):

How can I change a value of a field (in view) from this method? Thanks.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Baiju KS, thanks for your answer, finally I decide to use the new api and use @api.onchange to manipulate fields values. But that information is very useful, thanks!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Jose,

You have to give return value in this format.(from your function, its old api, ie v7)

It have to be a dictionary in this format.

            return {'value': {'field_name1': value1, 'field_name2': value2, 'field_name3': value3 }}

Hope this is what you want. If not please update me.

 

อวตาร
ละทิ้ง