Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
1722 Представления

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.

Аватар
Отменить
Лучший ответ

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


Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
нояб. 24
1217
0
июн. 17
3179
2
февр. 25
1363
0
июл. 23
2626
2
июн. 23
2634