I've created a many2one field which holds every report in the odoo. How to select the report default by it's model name as a filter?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
Hello Yuvaraj,
def default_report_template(self):
act_model = self.env.context.get('active_model')
active_model_id = self.env['ir.model'].search([('name','=',act_model)]).id
filtered_report = self.env['ir.actions.report'].search([('binding_model_id','=',active_model_id)], limit=1)
return filtered_report and filtered_report.id or False
report_templates = fields.Many2one('ir.actions.report', default=default_report_template)
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
2
مارس 24
|
1453 | ||
|
1
ديسمبر 21
|
5223 | ||
|
2
أبريل 21
|
11317 | ||
|
3
أكتوبر 18
|
40766 | ||
|
2
يوليو 15
|
4767 |