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

I recently needed to execute a function on module installation.

My research has brought up two different ways:

  1. Using the _init() function of a class
  2. Using the data.xml file (noupdate="1") to call a function of a model

Which one is recommended? What are the differences? Is it version dependend?

Thanks!

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

The noupdate parameter is used to indicate if the values in the xml file must be re-imported when a module in updated. noupdate="1", if we delete a data record and update the custom module, the deleted data not will be imported again._init() function is used assign values to the data members of the class when an object of class is created. The better option for your question is _init() function.

Regards

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
ديسمبر 24
6413
1
يوليو 16
3598
1
أغسطس 15
9509
0
مارس 15
4506
0
مارس 15
4237