Skip to Content
Menu
This question has been flagged
1 Atsakyti
1798 Rodiniai

I have added a 'back to draft' option on a customized stock_picking. When back in draft state, if any move is modified and save is called then picking successfully moves to 'ready' state. Issue occurs if a combined move is edited, in this case the save method is not called.

I am looking for a way to override 'Save' so whenever picking is edited in 'draft' state it moves to 'ready' state.

Portretas
Atmesti
Best Answer

You can override "save" by using this 2 function:

# override function create
@api.model
def create(self, vals):
# your code
res = super(StockPicking, self).create(vals)
return res

# override function write (write = update)
def write(self, vals):
# your code
res = super(StockPicking, self).write(vals)
return res


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
lapkr. 24
1299
0
birž. 17
3226
2
vas. 25
1434
0
liep. 23
2698
2
birž. 23
2737