-
Notifications
You must be signed in to change notification settings - Fork 23.1k
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
[FIX]account/saas-16.2: Chart Template es_common #164667
[FIX]account/saas-16.2: Chart Template es_common #164667
Conversation
This PR targets the disabled branch odoo/odoo:saas-16.2, it needs to be retargeted before it can be merged. |
a2f3dae
to
7484d97
Compare
Steps To Reproduce: 1. Create fresh database in version 16.0. 2. Install the module l10n_es. 3. Migrate the database to version 17.0 or saas-16.2 by setting the chart_template_id of res_company to es_common which is id = 1. 4. Finally, the error will be reproduced. When the module l10n_es is installed and if the Chart Template is set to es_common before saas-16.2 then it will raise a TypeError as "TypeError: 'NoneType' object is not subscriptable" when migrating to version 17.0 or saas-16.2. It is just because the changes in the PR "addons/l10n_es/models/template_es_common.py" here the chart template has made invisible ('visible':0). So, when it tries to fetch the template with the "template_code" "es_common" it will get a None value because it has made invisible. Finally, it will surely raise a TypeError if the chart template is set to es_common. Desired behavior after PR is merged: The TypeError which is raising while migrating to version saas-16.2 or more will be handled with this PR just by setting the value "True" for the default parameter "get_all" of the method "_get_chart_template_mapping()".
7484d97
to
3fe29f7
Compare
@syna-odoo """ When it comes to setting the chart template to Are you suggesting that it should be set in some other way (e.g. using the shell)? |
Hello @dbkosky Yeah, I saw that the customer's db has that particular template 'es_common' set for his company and it is carried over from version 8.0 but I saw that template is inactive in our standard from verison 11.0. So, shall we close this PR? |
@syna-odoo |
Made changes in the customers database as the template |
Description of the issue/feature this PR addresses:
Current behavior before PR:
Steps To Reproduce:
l10n_es
.es_common
which isid = 1.
When the module
l10n_es
is installed and if the Chart Template is set toes_common
before saas-16.2 then it will raise a TypeError as "TypeError: 'NoneType' object is not subscriptable" when migrating to version 17.0 or saas-16.2. It is just because the changes in this PR here the chart template has made invisible ('visible':0). So, when it tries to fetch the template with the template_codees_common
it will get a None value because it has made invisible. Finally, it will surely raise a TypeError if the chart template is set toes_common
.Desired behavior after PR is merged:
The TypeError which is raising while migrating to version saas-16.2 or more will be handled with this PR just by setting the value True for the default parameter get_all of the method _get_chart_template_mapping() .
Proof: Link
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr