تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1783 أدوات العرض

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


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
نوفمبر 24
1291
0
يونيو 17
3222
2
فبراير 25
1428
0
يوليو 23
2690
2
يونيو 23
2726