I want to add a field to several models which is the date of the weekly accounting period (weekending_date). Originally I added this field (and a function to set the value) in each model where I required the field. This resulted in the calculation function being duplicated in several places.
I would like to create a single module that defines the field and the function to calculate it, which I can then inherit in each model where I need it. That way I only have the function defined once and have consistency across all models.
However, can I do this without it creating a table with just that one field in it?
When I inherit the module, I want the field to be added into the main model where I need to use the field. For example
Model account_move should have weekending_date added to it.
Model sale_order should have weekending_date added to it.
Any suggestions for how to do this correctly?
Thank you. I think this is correct. I have implemented my first AbstractModel.