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

hi,

im trying to create and process a new move traceability in warehouse, after creating it i can´t process the same move

my code is some thing like that:

create new move

id=self.pool.get('stock.move').create(cr, uid, values, context=context)

processing the move with the same id

super(stock_move, self).action_done(cr,uid,ids,context=context)

but i get an error:

AttributeError: 'NoneType' object has no attribute 'state'

any help, thx in advance

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

if not values:

     values={}

if not context:

     context={}

process the move with

move_id=self.pool.get('stock.move').create(cr, uid, values, context=context)

super(stock_move, self).action_done(cr,uid,[move_id],context=context)

 

 

อวตาร
ละทิ้ง
ผู้เขียน

thank you very very much :)

คำตอบที่ดีที่สุด

From your code you call action_done for ids and you get id as a newly created move.

อวตาร
ละทิ้ง
ผู้เขียน

yes Mariusz, i can create a new move, and i have her id, but i want to process completly my move but i can´t, i give an error. any idea how solve that?

As I wrote earlier - from your code new move is bound to the variable id, but you want to process the same id calling action_done with ids - change your line of code like: super(stock_move, self).action_done(cr, uid, id, context=context) That way it should work just fine.

ผู้เขียน

not working :(, with new error: Iteration is not allowed on browse_record

ผู้เขียน คำตอบที่ดีที่สุด

any one here..?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 15
3923
0
มี.ค. 15
3663
1
มี.ค. 15
4156
1
มี.ค. 15
5208
2
ธ.ค. 23
1529