Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have a report that generates product labels for a certain recordset. How can I call a python function from my custom module before/after the report has been generated?
To answer my own question. Say I want to keep track when a certain record is printed or not:
You can define a new function in the model's .py file:
self.printed = True
self.timestamp_printed = fields.Datetime.now()
Where self will be the record on which you want to execute the function.
Then in the report QWeb template just call that function on each record.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 5/17/16, 6:11 AM|
|Seen: 624 times|
|Last updated: 5/17/16, 7:42 AM|