Hey Cyllo users, what is the use of abstract model and how do I go about creating them in Cyllo?
Welcome!
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.
This question has been flagged
This Odoo code defines an abstract model `ReportExample` inheriting from `models.AbstractModel`. The `_get_report_values` method fetches data from the `example.model` based on the provided `docids` and returns a dictionary containing necessary data for the report. The `_name` is set to `report.my_module.report_template`, following Odoo's conventions for report model naming. This structure enables creating reusable report logic that can be extended by other report models. from odoo import api, models class ReportExample(models.AbstractModel): _name = 'report.my_module.report_template' @api.model def _get_report_values(self, docids, data=None): docs = self.env['example.model'].browse(docids) return {'doc_ids': docids, 'doc_model': 'example.model', 'docs': docs}