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

Hi guys!!

Please i want to put a value in a field. Why when i do this:

return {'value': {'field_name': value}}

Nothing happens. Am i wrong please need help

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

Hi Abdelwahed,

Are you talking about updating a value in an on_change? Please add some more information/code?
An example of an on_change that changes values:

 #This method will be called when either the field CostPrice or the field ShippingCost changes in the view.
    def on_change_price(self,cr,user,ids,CostPrice,ShippingCost,context=None):
	#Calculate the total
	total = CostPrice + ShippingCost
        res = {
            'value': {
		#This sets the total price on the field standard_price.
                'standard_price': total
	      }
	}
	#Return the values to update it in the view.
	return res
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 25
1418
0
ม.ค. 25
3495
1
ส.ค. 23
14856
change password แก้ไขแล้ว
1
ส.ค. 23
13509
1
ก.ค. 23
10487