-
-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16][FIX] account_financial_report : make aged report configuration working with multi-company #1246
base: 16.0
Are you sure you want to change the base?
[16][FIX] account_financial_report : make aged report configuration working with multi-company #1246
Conversation
AFAIK, defaults can be applied by company, and that was the initial intention. If that's not working, then it's better to simply fix it to load/store the default for the current company. |
As far as I have tested, none of the default_XXX fields from Also, looking to the description of the feature by Odoo, it seems to be wanted : https://github.com/odoo/odoo/blob/16.0/odoo/addons/base/models/res_config.py#L340 (or maybe I misinterpret the "global" meaning of this description)
I am opened to change the way to fix this issue, but I don't understand exactly what you mean. I can't really fix/change the way the |
What I suggest is to override |
Well, sure, I can do it this way, I don't get how it is simpler though... |
The idea is for not overloading the res.company model, and also for not requiring specific code for loading that default value on the wizard. |
5853bec
to
798e5b0
Compare
Here it is @pedrobaeza |
…orking with multi-company
798e5b0
to
997959f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
The field
default_age_partner_config_id
configuration (inres.config.settings
) does not work in multi-company environment.Indeed, the default_XXX config create a global (for all companies)
ir.default
, meaning, it is the same setting for all companies.If you change this configuration for company A, and then go to the settings of company B, you can see it has been update too.
The issue here is that the
account.age.report.configuration
model has acompany_id
field, always filled. And there are multi-company security rule.So if the
account.age.report.configuration
belongs to company A, and you try to generate a aged balance report for company B, with this configuration, it will fail because of multi-company access issues.I changed this config field to use instead the specific config settings (overriding the get_values/set_values). This way, this configuration becomes company dependent instead of beeing global and it solves the multi-company issue when generating aged balance report.
review welcome @metaminux @emiliesoutiras @Kev-Roche
I will forward port it to 17 when merged