跳至内容
菜单
此问题已终结

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..?

形象
丢弃
相关帖文 回复 查看 活动
0
3月 15
3756
0
3月 15
3516
1
3月 15
3953
1
3月 15
5031
2
12月 23
1344