Skip to Content
Menú
This question has been flagged
1 Respondre
1773 Vistes

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.

Avatar
Descartar
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


Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de nov. 24
1286
0
de juny 17
3220
2
de febr. 25
1426
0
de jul. 23
2690
2
de juny 23
2724