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

[16.0][MIG] l10n_eu_nace #176

Closed
wants to merge 41 commits into from
Closed

Conversation

Abranes
Copy link
Member

@Abranes Abranes commented Oct 29, 2023

Standard migration to 16.0

Numerigraphe - Lionel Sausin and others added 30 commits October 28, 2023 12:01
Short category names are now displayed on partner views, since NACE names are so long
Data files were there, but translations were not.
[12.0][IMP] - Add unit tests

[IMP] - code improve

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/migrations/12.0.2.0.0/pre-migration.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/migrations/12.0.2.0.0/post-migration.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/views/res_partner.xml

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/readme/CONTRIBUTORS.rst

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>

[FIX] - fix code

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>

[FIX] - Fix name_search
Fix post-migration

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>

Update l10n_eu_nace/models/res_partner_nace.py

Co-authored-by: Jairo Llopis <[email protected]>
Some need to add secondary NACE codes to partners.

This is a very little addition, possibly quite standard, so it's done directly in the base addon.

@Tecnativa TT17678
FIX + IMP : more readable query for updating partners with new xml_id regarding old xml_id
@flotho
Copy link
Member

flotho commented Oct 29, 2023

hum... runboat not available! issued a 404

@Abranes
Copy link
Member Author

Abranes commented Oct 29, 2023

hum... runboat not available! issued a 404

It works for me, can you try it one more time?

Copy link
Member

@flotho flotho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functionnal test OK,
LGTM

@iziwas
Copy link

iziwas commented Nov 9, 2023

Hi,

Thanks for the PR request.
Functional tests are OK for me too. However, I have a warning about parent_path field in res.parter.nace : "parent_path field on model 'res.partner.nace' should have unaccent disabled. Add unaccent=False to the field definition."

Is it possible to fix it before please ?

Copy link
Member

@yajo yajo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After analyzing this module, I think it needs a refactor. Please let me explain.

This module introduces a duplicate structure in Odoo. Odoo CE already has a res.partner.industry model. In OCA, the partner_industry_secondary module implements:

  • Parent-child relationship.
  • Many2many relation between res.partner and res.partner.industry.

So, if this module depends on partner_industry_secondary, which is already migrated to v16, we can drop most of the code. This would just contain the NACE codes in CSV, which would be declared in the manifest and loaded at install; period.

IMHO the migration is probably the best opportunity to do it, as this involves structural changes in the data model. It would mean directly dropping all xml and python code from here, so I think it's a simple refactor that'd be very helpful.

FWIW the only "complex" thing would be a migration script, which wouldn't be very complex anyways.

WDYT?

@Rad0van
Copy link

Rad0van commented Nov 28, 2023

After analyzing this module, I think it needs a refactor. Please let me explain.

This module introduces a duplicate structure in Odoo. Odoo CE already has a res.partner.industry model. In OCA, the partner_industry_secondary module implements:

  • Parent-child relationship.
  • Many2many relation between res.partner and res.partner.industry.

So, if this module depends on partner_industry_secondary, which is already migrated to v16, we can drop most of the code. This would just contain the NACE codes in CSV, which would be declared in the manifest and loaded at install; period.

IMHO the migration is probably the best opportunity to do it, as this involves structural changes in the data model. It would mean directly dropping all xml and python code from here, so I think it's a simple refactor that'd be very helpful.

FWIW the only "complex" thing would be a migration script, which wouldn't be very complex anyways.

WDYT?

Looking at the modules I totally agree with you.

@pedrobaeza
Copy link
Member

The only problem I see is that the industry model already contains other records that are not NACE ones.

@Rad0van
Copy link

Rad0van commented Nov 28, 2023

The only problem I see is that the industry model already contains other records that are not NACE ones.

Which ones? By quickly looking (at least for v16) it seems right to me...

@pedrobaeza
Copy link
Member

@pedrobaeza
Copy link
Member

Ok then. Just a proper mapping should be done for recognizing them as the parents.

@yajo
Copy link
Member

yajo commented Nov 29, 2023

partner_industry_secondary makes the parent-child relationship possible, so it shouldn't be a big problem, apart from a relatively simple migration script.

@cvinh
Copy link

cvinh commented Feb 3, 2024

Hello @Abranes, are you going to change your PR according to comments above ?

@rafaelbn
Copy link
Member

/ocabot migration l10n_eu_nace

@OCA-git-bot
Copy link
Contributor

Sorry @rafaelbn you are not allowed to mark the addon tobe migrated.

To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons.

If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the maintainers key of its manifest.

@edlopen
Copy link
Member

edlopen commented Apr 15, 2024

I have an open PR that uses the res.parter.industry as @yajo said here. And also updated the module so that it uses the new ShowVoc Endpoint as the RAMON servers are deprecated.

@yajo
Copy link
Member

yajo commented Apr 17, 2024

Thanks! Closing here, as the other PR is more suited for merge.

@yajo yajo closed this Apr 17, 2024
@rafaelbn
Copy link
Member

rafaelbn commented Aug 7, 2024

Migrated in #196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.