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

I have a problem related to set data on a form on a onchange event. On saleorderline i want to set the quantity automatically when I change the product. But I have linked product to a one2many ean13 codes that have information about the quantity. So I redefine the search of the product searching on the other table linked to the products containing the quantity information, but when i type the code of the products in the onchange I have only the product_id and lost the code_id linked to the search field so I cannot retrive te quantity information. Do you have an idea how I can have in the onchange other information about the id passed???

I post the code of the onchange, the parameter ean13_id would be an ean13_id and not a product_id, or I would have to add a parameter about the code typed to search the product.

    def ean13_id_change_with_wh(self, cr, uid, ids, ean13_id, context=None):
if context is None:
context = {}
res = {}
ean_obj = self.pool.get('product.ean13').browse(cr, uid, ean13_id, context)
if ean13_id:
res = {
'value':{
'product_id':ean_obj.product_id,
'product_uom_qty':ean_obj.quantity
}
}
return res
아바타
취소

my friend plz did you put the onchange in yyou xml and plz print to me what did you get in ean_obj = self.pool.get('product.ean13').browse(cr, uid, ean13_id, context)

관련 게시물 답글 화면 활동
1
2월 24
1006
1
5월 15
6432
1
7월 25
560
Search a message 해결 완료
1
2월 25
1257
1
10월 23
2046