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] base_location bug report conflict with odoo website #1738

Open
maxgrassi opened this issue Apr 15, 2024 · 0 comments
Open

[16.0] base_location bug report conflict with odoo website #1738

maxgrassi opened this issue Apr 15, 2024 · 0 comments
Labels

Comments

@maxgrassi
Copy link

The OCA module base_location has conflict with odoo website module.

base_location version 16.0.1.0.1

Describe the bug

You cannot change ZIP Post Code or Country in the website for an address that has been created in the admin using Location completion from module base_location.

To Reproduce

You can easily reproduce the bug on runboat RUNBOAT

Steps to reproduce the behavior:

  1. Create or edit a contact address in the admin (backend) and use Location completion from module base_location to fill the post code, city and country.
  2. Go to website my account edit address details, or go to checkout page and edit address details. In the address try to change Zip / Postal Code or Country. You will get the following error:

Expected behavior
The customer that want to edit an address should be able to do it.

This is the error when you try to change the ZIP:

`Error
Error message:

The zip of the partner Mitchell Admin differs from that in location 1000
Traceback
Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 1633, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/odoo/http.py", line 1660, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo/http.py", line 1774, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/addons/website/models/ir_http.py", line 237, in _dispatch
response = super()._dispatch(endpoint)
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/addons/portal/controllers/portal.py", line 198, in account
partner.sudo().write(values)
File "/mnt/data/odoo-addons-dir/partner_tier_validation/models/res_partner.py", line 47, in write
res = super().write(vals)
File "/opt/odoo/addons/snailmail/models/res_partner.py", line 26, in write
return super(ResPartner, self).write(vals)
File "/opt/odoo/addons/partner_autocomplete/models/res_partner.py", line 227, in write
res = super(ResPartner, self).write(values)
File "/mnt/data/odoo-addons-dir/partner_lastname_uppercase/models/res_partner.py", line 42, in write
res = super().write(vals)
File "/mnt/data/odoo-addons-dir/partner_email_check/models/res_partner.py", line 102, in write
return super(ResPartner, self).write(vals)
File "/mnt/data/odoo-addons-dir/partner_contact_lang/models/res_partner.py", line 13, in write
res = super(ResPartner, self).write(vals)
File "/mnt/data/odoo-addons-dir/partner_contact_address_default/models/res_partner.py", line 58, in write
return super().write(vals)
File "/mnt/data/odoo-addons-dir/base_partner_sequence/models/partner.py", line 41, in write
return super(ResPartner, self - partners_needing_ref).write(vals)
File "/opt/odoo/odoo/addons/base/models/res_partner.py", line 730, in write
result = result and super(Partner, self).write(vals)
File "/opt/odoo/addons/mail/models/mail_activity_mixin.py", line 241, in write
return super(MailActivityMixin, self).write(vals)
File "/opt/odoo/addons/mail/models/mail_thread.py", line 315, in write
result = super(MailThread, self).write(values)
File "/opt/odoo-venv/lib/python3.10/site-packages/odoo/addons/base_tier_validation/models/tier_validation.py", line 285, in write
return super(TierValidation, self).write(vals)
File "/opt/odoo/addons/website/models/mixins.py", line 221, in write
return super(WebsitePublishedMixin, self).write(values)
File "/opt/odoo/odoo/models.py", line 3798, in write
real_recs._validate_fields(vals, inverse_fields)
File "/opt/odoo/odoo/models.py", line 1359, in _validate_fields
check(self)
File "/mnt/data/odoo-addons-dir/base_location/models/res_partner.py", line 104, in _check_zip
if not rec.zip_id:
File "/opt/odoo/odoo/fields.py", line 2804, in get
return super().get(records, owner)
File "/opt/odoo/odoo/fields.py", line 1158, in get
self.recompute(record)
File "/opt/odoo/odoo/fields.py", line 1370, in recompute
apply_except_missing(self.compute_value, recs)
File "/opt/odoo/odoo/fields.py", line 1343, in apply_except_missing
func(records)
File "/opt/odoo/odoo/fields.py", line 1392, in compute_value
records._compute_field_value(self)
File "/opt/odoo/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
return super()._compute_field_value(field)
File "/opt/odoo/odoo/models.py", line 4232, in _compute_field_value
fields.determine(field.compute, self)
File "/opt/odoo/odoo/fields.py", line 98, in determine
return needle(*args)
File "/mnt/data/odoo-addons-dir/base_location/models/res_partner.py", line 47, in _compute_zip_id
record[rec_field]
File "/opt/odoo/odoo/models.py", line 5920, in getitem
return self._fields[key].get(self, self.env.registry[self._name])
File "/opt/odoo/odoo/fields.py", line 2804, in get
return super().get(records, owner)
File "/opt/odoo/odoo/fields.py", line 1158, in get
self.recompute(record)
File "/opt/odoo/odoo/fields.py", line 1370, in recompute
apply_except_missing(self.compute_value, recs)
File "/opt/odoo/odoo/fields.py", line 1343, in apply_except_missing
func(records)
File "/opt/odoo/odoo/fields.py", line 1392, in compute_value
records._compute_field_value(self)
File "/opt/odoo/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
return super()._compute_field_value(field)
File "/opt/odoo/odoo/models.py", line 4237, in _compute_field_value
self.filtered('id')._validate_fields(fnames)
File "/opt/odoo/odoo/models.py", line 1359, in _validate_fields
check(self)
File "/mnt/data/odoo-addons-dir/base_location/models/res_partner.py", line 132, in _check_zip
raise ValidationError(
odoo.exceptions.ValidationError: The zip of the partner Mitchell Admin differs from that in location 1000`

This is the error when you try to change the Country:
`Error
Error message:

The country of the partner Mitchell Admin differs from that in location 1000
Traceback
Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 1633, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/odoo/http.py", line 1660, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo/http.py", line 1774, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/addons/website/models/ir_http.py", line 237, in _dispatch
response = super()._dispatch(endpoint)
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/addons/portal/controllers/portal.py", line 198, in account
partner.sudo().write(values)
File "/mnt/data/odoo-addons-dir/partner_tier_validation/models/res_partner.py", line 47, in write
res = super().write(vals)
File "/opt/odoo/addons/snailmail/models/res_partner.py", line 26, in write
return super(ResPartner, self).write(vals)
File "/opt/odoo/addons/partner_autocomplete/models/res_partner.py", line 227, in write
res = super(ResPartner, self).write(values)
File "/mnt/data/odoo-addons-dir/partner_lastname_uppercase/models/res_partner.py", line 42, in write
res = super().write(vals)
File "/mnt/data/odoo-addons-dir/partner_email_check/models/res_partner.py", line 102, in write
return super(ResPartner, self).write(vals)
File "/mnt/data/odoo-addons-dir/partner_contact_lang/models/res_partner.py", line 13, in write
res = super(ResPartner, self).write(vals)
File "/mnt/data/odoo-addons-dir/partner_contact_address_default/models/res_partner.py", line 58, in write
return super().write(vals)
File "/mnt/data/odoo-addons-dir/base_partner_sequence/models/partner.py", line 41, in write
return super(ResPartner, self - partners_needing_ref).write(vals)
File "/opt/odoo/odoo/addons/base/models/res_partner.py", line 730, in write
result = result and super(Partner, self).write(vals)
File "/opt/odoo/addons/mail/models/mail_activity_mixin.py", line 241, in write
return super(MailActivityMixin, self).write(vals)
File "/opt/odoo/addons/mail/models/mail_thread.py", line 315, in write
result = super(MailThread, self).write(values)
File "/opt/odoo-venv/lib/python3.10/site-packages/odoo/addons/base_tier_validation/models/tier_validation.py", line 285, in write
return super(TierValidation, self).write(vals)
File "/opt/odoo/addons/website/models/mixins.py", line 221, in write
return super(WebsitePublishedMixin, self).write(values)
File "/opt/odoo/odoo/models.py", line 3798, in write
real_recs._validate_fields(vals, inverse_fields)
File "/opt/odoo/odoo/models.py", line 1359, in _validate_fields
check(self)
File "/mnt/data/odoo-addons-dir/base_location/models/res_partner.py", line 104, in _check_zip
if not rec.zip_id:
File "/opt/odoo/odoo/fields.py", line 2804, in get
return super().get(records, owner)
File "/opt/odoo/odoo/fields.py", line 1158, in get
self.recompute(record)
File "/opt/odoo/odoo/fields.py", line 1370, in recompute
apply_except_missing(self.compute_value, recs)
File "/opt/odoo/odoo/fields.py", line 1343, in apply_except_missing
func(records)
File "/opt/odoo/odoo/fields.py", line 1392, in compute_value
records._compute_field_value(self)
File "/opt/odoo/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
return super()._compute_field_value(field)
File "/opt/odoo/odoo/models.py", line 4232, in _compute_field_value
fields.determine(field.compute, self)
File "/opt/odoo/odoo/fields.py", line 98, in determine
return needle(*args)
File "/mnt/data/odoo-addons-dir/base_location/models/res_partner.py", line 47, in _compute_zip_id
record[rec_field]
File "/opt/odoo/odoo/models.py", line 5920, in getitem
return self._fields[key].get(self, self.env.registry[self._name])
File "/opt/odoo/odoo/fields.py", line 2804, in get
return super().get(records, owner)
File "/opt/odoo/odoo/fields.py", line 1158, in get
self.recompute(record)
File "/opt/odoo/odoo/fields.py", line 1370, in recompute
apply_except_missing(self.compute_value, recs)
File "/opt/odoo/odoo/fields.py", line 1343, in apply_except_missing
func(records)
File "/opt/odoo/odoo/fields.py", line 1392, in compute_value
records._compute_field_value(self)
File "/opt/odoo/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
return super()._compute_field_value(field)
File "/opt/odoo/odoo/models.py", line 4237, in _compute_field_value
self.filtered('id')._validate_fields(fnames)
File "/opt/odoo/odoo/models.py", line 1359, in _validate_fields
check(self)
File "/mnt/data/odoo-addons-dir/base_location/models/res_partner.py", line 108, in _check_zip
raise ValidationError(
odoo.exceptions.ValidationError: The country of the partner Mitchell Admin differs from that in location 1000`

@maxgrassi maxgrassi added the bug label Apr 15, 2024
@maxgrassi maxgrassi changed the title Odoo 16CE base_location bug report [16.0] base_location bug report conflict with odoo website Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant