Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
9925 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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)

 

 

Imagine profil
Abandonează
Autor

thank you very very much :)

Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

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.

Autor

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

Autor Cel mai bun răspuns

any one here..?

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
mar. 15
3767
0
mar. 15
3530
1
mar. 15
3969
1
mar. 15
5059
2
dec. 23
1359