콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
268 화면

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
아바타
취소
관련 게시물 답글 화면 활동
0
3월 25
1463
0
1월 25
3605
1
8월 23
14961
change password 해결 완료
1
8월 23
13621
1
7월 23
10601