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:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
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
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
2
Mar 24
|
1495 | ||
why my many2one field can not work properly?
Diselesaikan
|
|
1
Des 21
|
5227 | |
|
2
Apr 21
|
11327 | ||
Set default value for a many2one field in Odoo9
Diselesaikan
|
|
3
Okt 18
|
40775 | |
|
2
Jul 15
|
4774 |