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

[13.0][FIX] base_location: address field sync zip_id #1180

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

victoralmau
Copy link
Member

FWP from 13.0: #1150

_address_fields are used by update_address 1, which is in turn
called by _fields_sync and _children_sync.

This mechanism is in charge of synchronizing parent/children address fields
for contacts of type == "contact", as they don't really have an address of
their own. They simply copy the address of their parent.

Without this fix, not only the zip_id is not sync'ed, but also in some cases
an exception may be raised by _check_zip_id, due to only some fields being
sync'ed but not all, creating inconsistencies between zip_id and other address
fields.

Please @pedrobaeza @joao-p-marques can you review it?

@Tecnativa TT33047

`_address_fields` are used by `update_address` [1], which is in turn
called by `_fields_sync` and `_children_sync`.

This mechanism is in charge of synchronizing parent/children address fields
for contacts of type == "contact", as they don't really have an address of
their own. They simply copy the address of their parent.

Without this fix, not only the zip_id is not sync'ed, but also in some cases
an exception may be raised by `_check_zip_id`, due to only some fields being
sync'ed but not all, creating inconsistencies between zip_id and other address
fields.

[1]: https://github.com/odoo/odoo/blob/20648ef21/odoo/addons/base/models/res_partner.py#L429
@victoralmau victoralmau force-pushed the 13.0-fix-base_location-address_sync branch from ae9cede to 5997558 Compare November 22, 2021 08:35
@pedrobaeza pedrobaeza added this to the 13.0 milestone Nov 22, 2021
@pedrobaeza
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 13.0-ocabot-merge-pr-1180-by-pedrobaeza-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Nov 22, 2021
Signed-off-by pedrobaeza
@OCA-git-bot
Copy link
Contributor

@pedrobaeza your merge command was aborted due to failed check(s), which you can inspect on this commit of 13.0-ocabot-merge-pr-1180-by-pedrobaeza-bump-patch.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@pedrobaeza
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 13.0-ocabot-merge-pr-1180-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 0485385 into OCA:13.0 Nov 22, 2021
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 92f00d2. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 13.0-fix-base_location-address_sync branch November 22, 2021 15:09
@pedrobaeza
Copy link
Member

I suppose this is needed in v14 and v15

@victoralmau
Copy link
Member Author

I suppose this is needed in v14 and v15
I think it is not totally necessary because in v14 and v15 city_id is redefined as a compute.

@pedrobaeza
Copy link
Member

But for zip_id ? And how that compute affects to this module?

@victoralmau
Copy link
Member Author

This module re-defines the city_id field as a compute since v14 (4a71fae)

@pedrobaeza
Copy link
Member

Not really, they are computed writable fields, so they act as onchanges, so no propagation is done that way AFAIK.

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

Successfully merging this pull request may close these issues.

None yet

5 participants