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

Is there order to calling all of the overriden methods before the main one is called or is it random ?

Example:

Sale.order

_action_confirm method

This method is overriden in x other modules. Is it possible to call my override before specific other override or all other overriden methods?

My goal: I would like to edit field before another overriden method is called for creating stock.move. This would be done in backend

I think that simply calling super wouldnt ensure that my logic is done before another override.


الصورة الرمزية
إهمال

you could try something like:
from odoo.addons.module.models.model import Modeltowrite

class Model (Modeltowrite):

def action_confirm (self):
#overwrite method

The idea would be to replace the method only of this class, but I am not sure of the behavior

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يوليو 21
3209
2
يوليو 24
1893
2
مايو 24
5235
0
يناير 24
169
1
أكتوبر 21
4797