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

[18.0][MIG] base_location: Migration to 18.0 #3

Open
wants to merge 460 commits into
base: 18.0
Choose a base branch
from

Conversation

Kimkhoi3010
Copy link
Owner

No description provided.

OCA-git-bot and others added 16 commits October 14, 2024 12:58
Currently translated at 100.0% (16 of 16 strings)

Translation: partner-contact-17.0/partner-contact-17.0-partner_firstname
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_firstname/it/
Steps to reproduce:
- Install `hr` and `partner_firstname`
- Go to Employees > any employee > action menu > Create User > Save
- 💥 Traceback

Suspected cause: in `defaul_get()`, the field `name` is not present in `fields_list` (probably because it's computed). So `result.get("name", "")` will always return `""` and `firstname` and `lastname` are not computed.
Currently translated at 100.0% (16 of 16 strings)

Translation: partner-contact-17.0/partner-contact-17.0-partner_firstname
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_firstname/sv/
Previously, creating a non-company partner by passing the `name` field
would trigger the `_inverse_name_after_cleaning_whitespace` method which,
for values of `firstname` and `lastname` with multiple words, would result
in most of those words being set to the `lastname` field, even if the
correct values were explicitly passed to the `create` method. For example,
duplicating a non-company partner with the following field values:

firstname = Francisco Javier
lastname = Garcia Cabeza De Vaca

Would result in a partner with these values:

firstname = Francisco
lastname = Javier Garcia Cabeza De Vaca (copy)

A similar issue can be reproduced when recalculating names: when
explicitly calling `_compute_name`, the
`_inverse_name_after_cleaning_whitespace` is called and the `firstname`
and `lastname` fields are modified, if they contain more than one word.

This commit solves the issue and prevents the `_inverse_name_after_cleaning_whitespace`
from being called when creating a non-company partner while explicitly
providing the `firstname` or `lastname` fields, and when recalculating
names.

In addition to the 16.0: Complying with E501 linting rule
…ication

This PR ensures that when duplicating a partner, the '(copy)' suffix is
added at the end of `lastname2` instead of `lastname`, in case the order
from settings is `first_last`; otherwise, no action is needed.
Otherwise the following is raised
> odoo.addons.partner_firstname.exceptions.EmptyNamesError: ("Error(s) with partner 1425's name.", 'No name is set.')
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: partner-contact-17.0/partner-contact-17.0-partner_firstname
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_firstname/
Currently translated at 100.0% (18 of 18 strings)

Translation: partner-contact-17.0/partner-contact-17.0-partner_firstname
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_firstname/it/
Currently translated at 100.0% (18 of 18 strings)

Translation: partner-contact-17.0/partner-contact-17.0-partner_firstname
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_firstname/ca/

from lxml import etree

from odoo import _, api, fields, models

Choose a reason for hiding this comment

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

Suggested change
from odoo import _, api, fields, models
from odoo import api, fields, models

odoo/odoo@b794f0f

@Kimkhoi3010 Kimkhoi3010 force-pushed the 18.0-mig-base_location branch from 792d794 to e830ff9 Compare October 15, 2024 03:45
@Kimkhoi3010 Kimkhoi3010 requested a review from chaule97 October 15, 2024 03:47
carlosdauden and others added 10 commits October 15, 2024 12:29
[UPD] Update partner_pricelist_search.pot

[UPD] README.rst

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: partner-contact-14.0/partner-contact-14.0-partner_pricelist_search
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_pricelist_search/
partner_pricelist_search 14.0.1.0.1

[IMP] update dotfiles [ci skip]
…uments

[UPD] Update partner_pricelist_search.pot

partner_pricelist_search 14.0.1.0.2
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: partner-contact-14.0/partner-contact-14.0-partner_pricelist_search
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_pricelist_search/
marylla and others added 29 commits October 29, 2024 10:11
Currently translated at 97.2% (35 of 36 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/de/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/
Currently translated at 57.1% (20 of 35 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/fr/
Currently translated at 82.8% (29 of 35 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/it/
Currently translated at 60.0% (21 of 35 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/hr/
Currently translated at 82.8% (29 of 35 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/it/
Currently translated at 48.5% (17 of 35 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/sl/
Currently translated at 100.0% (35 of 35 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/fr/
Currently translated at 68.5% (24 of 35 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/hr/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/
Currently translated at 100.0% (35 of 35 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/pt_BR/
Currently translated at 100.0% (35 of 35 strings)

Translation: partner-contact-16.0/partner-contact-16.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-base_location/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: partner-contact-17.0/partner-contact-17.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-base_location/
Currently translated at 100.0% (35 of 35 strings)

Translation: partner-contact-17.0/partner-contact-17.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-base_location/sv/
Currently translated at 100.0% (35 of 35 strings)

Translation: partner-contact-17.0/partner-contact-17.0-base_location
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-base_location/ca/
… the zip_id field to _address_fields()

TT33047
@Kimkhoi3010 Kimkhoi3010 force-pushed the 18.0-mig-base_location branch from 5e1f1ee to d964b09 Compare October 29, 2024 03:12
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.