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

CODE:

 def _get_current_stock(self,cr,uid,ids,context=None):
res = super(stock_location, self).name_get(cr, uid, ids, context=context)
res1=[]
tot_qty = 0
product_id = 0
if context.has_key('prod_id'):
product_id = context.get('prod_id', 0)
for obj in self.browse(cr, uid, ids):
cr.execute("""SELECT sum(qty) from stock_quant where location_id != %s""" % obj.id)
tot_qty = cr.fetchall()
if product_id:
cr.execute("""SELECT sum(qty) from stock_quant where location_id != %s and product_id = %s""" % (obj.id, product_id))
tot_qty = cr.fetchall()
res1.append((obj.id, obj.name + ' ('+str(tot_qty[0][0])+' in Stock)'))
print 'Currently in stock ',res1
return res1

After I run this code, getting error:

 result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
TypeError: _get_current_stock() takes at most 4 arguments (7 given)

What I'm doing wrong ?

아바타
취소

please mention function call too..

How do you call _get_current_stock() ?

관련 게시물 답글 화면 활동
1
1월 16
40842
5
12월 23
75782
0
7월 16
3695
3
1월 16
9203
1
2월 16
3943