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
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
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
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
2
mars 24
|
1498 | ||
|
1
déc. 21
|
5227 | ||
|
2
avr. 21
|
11328 | ||
|
3
oct. 18
|
40776 | ||
|
2
juil. 15
|
4777 |