Skip to content

Commit

Permalink
[MIG] base_location: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimkhoi3010 committed Oct 29, 2024
1 parent 0889edc commit 5e1f1ee
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 22 deletions.
6 changes: 6 additions & 0 deletions base_location/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,18 @@ Contributors
- Francesco Apruzzese <f.apruzzese@apuliasoftware.it>
- Dave Lasley <dave@laslabs.com>
- Aitor Bouzas <aitor.bouzas@adaptivecity.com>
- Khoi (Kien Kim) <khoikk@trobz.com>

Other credits
-------------

- Icon park: Icon http://icon-park.com/icon/location-map-pin-orange3/

The migration of this module from 17.0 to 18.0 was financially supported
by:

- Camptocamp.

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion base_location/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Location management (aka Better ZIP)",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"development_status": "Mature",
"depends": ["base_address_extended", "contacts"],
"author": (
Expand Down
26 changes: 13 additions & 13 deletions base_location/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from lxml import etree

from odoo import _, api, fields, models
from odoo import api, fields, models
from odoo.exceptions import ValidationError


Expand Down Expand Up @@ -106,35 +106,35 @@ def _check_zip(self):
error_dict = {"partner": rec.name, "location": rec.zip_id.name}
if rec.zip_id.city_id.country_id != rec.country_id:
raise ValidationError(
_(
self.env._(
"The country of the partner %(partner)s differs from that in "
"location %(location)s"
"location %(location)s",
**error_dict,
)
% error_dict
)
if rec.zip_id.city_id.state_id != rec.state_id:
raise ValidationError(
_(
self.env._(
"The state of the partner %(partner)s differs from that in "
"location %(location)s"
"location %(location)s",
**error_dict,
)
% error_dict
)
if rec.zip_id.city_id != rec.city_id:
raise ValidationError(
_(
self.env._(
"The city of the partner %(partner)s differs from that in "
"location %(location)s"
"location %(location)s",
**error_dict,
)
% error_dict
)
if rec.zip_id.name != rec.zip:
raise ValidationError(
_(
self.env._(
"The zip of the partner %(partner)s differs from that in "
"location %(location)s"
"location %(location)s",
**error_dict,
)
% error_dict
)

def _zip_id_domain(self):
Expand Down
1 change: 1 addition & 0 deletions base_location/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
- Francesco Apruzzese \<<f.apruzzese@apuliasoftware.it>\>
- Dave Lasley \<<dave@laslabs.com>\>
- Aitor Bouzas \<<aitor.bouzas@adaptivecity.com>\>
- Khoi (Kien Kim) \<<khoikk@trobz.com>\>
4 changes: 4 additions & 0 deletions base_location/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
- Icon park: Icon http://icon-park.com/icon/location-map-pin-orange3/

The migration of this module from 17.0 to 18.0 was financially supported by:

- Camptocamp.
6 changes: 6 additions & 0 deletions base_location/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,19 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Francesco Apruzzese &lt;<a class="reference external" href="mailto:f.apruzzese&#64;apuliasoftware.it">f.apruzzese&#64;apuliasoftware.it</a>&gt;</li>
<li>Dave Lasley &lt;<a class="reference external" href="mailto:dave&#64;laslabs.com">dave&#64;laslabs.com</a>&gt;</li>
<li>Aitor Bouzas &lt;<a class="reference external" href="mailto:aitor.bouzas&#64;adaptivecity.com">aitor.bouzas&#64;adaptivecity.com</a>&gt;</li>
<li>Khoi (Kien Kim) &lt;<a class="reference external" href="mailto:khoikk&#64;trobz.com">khoikk&#64;trobz.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-7">Other credits</a></h2>
<ul class="simple">
<li>Icon park: Icon <a class="reference external" href="http://icon-park.com/icon/location-map-pin-orange3/">http://icon-park.com/icon/location-map-pin-orange3/</a></li>
</ul>
<p>The migration of this module from 17.0 to 18.0 was financially supported
by:</p>
<ul class="simple">
<li>Camptocamp.</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
Expand Down
8 changes: 4 additions & 4 deletions base_location/views/res_city_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<field name="model">res.city</field>
<field name="inherit_id" ref="base_address_extended.view_city_tree" />
<field name="arch" type="xml">
<tree position="attributes">
<list position="attributes">
<attribute name="editable" />
</tree>
</list>
<field name="zipcode" position="attributes">
<attribute name="column_invisible">1</attribute>
</field>
Expand Down Expand Up @@ -38,11 +38,11 @@
<field name="name">Cities</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.city</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field
name="view_ids"
eval="[(5,0,0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('base_address_extended.view_city_tree')}),
(0, 0, {'view_mode': 'list', 'view_id': ref('base_address_extended.view_city_tree')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('view_city_form')})]"
/>
<field name="help">
Expand Down
6 changes: 3 additions & 3 deletions base_location/views/res_city_zip_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<field name="name">res.city.zip.tree</field>
<field name="model">res.city.zip</field>
<field name="arch" type="xml">
<tree editable="top">
<list editable="top">
<field name="name" />
<field name="city_id" />
<field
name="country_id"
options="{'no_open': True, 'no_create': True}"
/>
</tree>
</list>
</field>
</record>
<record id="view_city_zip_filter" model="ir.ui.view">
Expand All @@ -40,7 +40,7 @@
<record id="action_zip_tree" model="ir.actions.act_window">
<field name="name">Locations</field>
<field name="res_model">res.city.zip</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field ref="city_zip_tree" name="view_id" />
<field name="search_view_id" ref="view_city_zip_filter" />
</record>
Expand Down
1 change: 0 additions & 1 deletion base_location/views/res_country_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
context="{'default_country_id': id, 'search_default_country_id': id}"
string="Zips"
>

</button>
</xpath>
</field>
Expand Down

0 comments on commit 5e1f1ee

Please sign in to comment.