Skip to content
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

Conversation

syna-odoo
Copy link

@syna-odoo syna-odoo commented May 7, 2024

Description of the issue/feature this PR addresses:

Current behavior before PR:

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 this PR 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() .

Proof: Link


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented May 7, 2024

This PR targets the disabled branch odoo/odoo:saas-16.2, it needs to be retargeted before it can be merged.

@robodoo
Copy link
Contributor

robodoo commented May 7, 2024

Pull request status dashboard.

@C3POdoo C3POdoo requested review from a team and dbkosky and removed request for a team May 7, 2024 07:20
@C3POdoo C3POdoo added the RD research & development, internal work label May 7, 2024
@syna-odoo syna-odoo force-pushed the saas-16.2-fix_account_chart_template-syna branch from a2f3dae to 7484d97 Compare May 9, 2024 14:16
@syna-odoo syna-odoo changed the title [FIX] Chart Template es_common [FIX]account/saas-16.2: Chart Template es_common May 9, 2024
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()".
@syna-odoo syna-odoo force-pushed the saas-16.2-fix_account_chart_template-syna branch from 7484d97 to 3fe29f7 Compare May 14, 2024 07:37
@dbkosky
Copy link
Contributor

dbkosky commented May 17, 2024

@syna-odoo
I've been trying to replicate the error using the described steps but have had no success.
Could you be more specific?

"""
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.
"""
It's unclear what you mean here. In testing, I've checkout out on version saas-16.2 and run -u all.

When it comes to setting the chart template to es_common (PGCE común), it cannot be selected from the list of available chart templates in v16.0 (see screenshot)
image

Are you suggesting that it should be set in some other way (e.g. using the shell)?
Is there some case in the past where some users were able to set their chart template to PGCE común from the interface?

@syna-odoo
Copy link
Author

Hello @dbkosky
Hope you are good...!

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, I just set that template through shell while testing and not checking the UI side. And it is my bad.
We just have to make changes in the customers db as it(es_common) is not active in our standard.

So, shall we close this PR?
Thanks for your review.
Have a nice day ahead!!!

@dbkosky
Copy link
Contributor

dbkosky commented May 21, 2024

@syna-odoo
In that case I think it would be best to close the PR then.
Thanks for explaining how it happened as well
Have a good day 🙂

@syna-odoo
Copy link
Author

Made changes in the customers database as the templatees_commom is not available in our standard.
So, closing this PR :)

@syna-odoo syna-odoo closed this May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants