I want to call all onchange methods of sale.order.
For that I want list of all fields which having onchange methods in sale.order or all onchange methods of sale.order
Is there any way to get fields or onchange methods of model?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
Check out https://github.com/odoo/odoo/blob/302037f48abbdfb146a41a128a039174d8844ab1/odoo/models.py#L665
You can leverage this method to get the information you need.
Sample code would look something like:
fields_with_onchange = ""
for field in model._onchange_methods:
fields_with_onchange += field + ", "
If you run this for the sale.order model, you get:
fiscal_position_id, commitment_date, company_id, partner_shipping_id, partner_id, sale_order_template_id, user_id, team_id,
Thank you Ray Carnes
Hi,
Refer this: https://www.odoo.com/forum/help-1/question/how-do-i-dump-all-the-fields-and-values-in-a-model-ideally-including-those-from-relationships-69271
There is default method in all model get_field(). this will give you dictionary with all params.
Thank you Haresh Kansara.
I need only those fields which having onchange methods.
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
1
يونيو 23
|
50832 | ||
|
1
نوفمبر 22
|
3123 | ||
|
2
ديسمبر 19
|
3296 | ||
|
2
أغسطس 25
|
2357 | ||
|
1
يوليو 25
|
874 |
You need to refer code for the same.