From 52af681968849f3c769d7f2182e33e2bd0cddea8 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 12 Dec 2013 23:38:57 +0100 Subject: [PATCH 1/2] [IMP] base_location: Make ZIP code optional --- base_location/better_zip.py | 7 +++++-- base_location/better_zip_view.xml | 12 ++++++++++++ base_location/i18n/base_location.pot | 13 +++++++++---- base_location/i18n/es.po | 15 ++++++++++----- 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/base_location/better_zip.py b/base_location/better_zip.py index 8d6d01614..562a842e3 100644 --- a/base_location/better_zip.py +++ b/base_location/better_zip.py @@ -30,7 +30,7 @@ class BetterZip(orm.Model): _order = "priority" _columns = {'priority': fields.integer('Priority', deprecated=True), - 'name': fields.char('ZIP', required=True), + 'name': fields.char('ZIP'), 'city': fields.char('City', required=True), 'state_id': fields.many2one('res.country.state', 'State'), 'country_id': fields.many2one('res.country', 'Country'), @@ -43,7 +43,10 @@ class BetterZip(orm.Model): def name_get(self, cursor, uid, ids, context=None): res = [] for bzip in self.browse(cursor, uid, ids): - name = [bzip.name, bzip.city] + if bzip.name: + name = [bzip.name, bzip.city] + else: + name = [bzip.city] if bzip.state_id: name.append(bzip.state_id.name) if bzip.country_id: diff --git a/base_location/better_zip_view.xml b/base_location/better_zip_view.xml index 0fc8d11de..de67ec1af 100644 --- a/base_location/better_zip_view.xml +++ b/base_location/better_zip_view.xml @@ -33,12 +33,24 @@ + + res.better.zip.select + res.better.zip + + + + + + + + Cites/locations Management res.better.zip form tree,form + \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -31,6 +31,11 @@ msgstr "" msgid "ZIP" msgstr "" +#. module: base_location +#: field:res.better.zip,state_id:0 +msgid "State" +msgstr "" + #. module: base_location #: field:res.better.zip,country_id:0 msgid "Country" @@ -67,8 +72,8 @@ msgid "City/Location" msgstr "" #. module: base_location -#: field:res.better.zip,state_id:0 -msgid "State" +#: view:res.better.zip:0 +msgid "Search city" msgstr "" #. module: base_location diff --git a/base_location/i18n/es.po b/base_location/i18n/es.po index fca36c59d..3ff60e231 100644 --- a/base_location/i18n/es.po +++ b/base_location/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-06-25 08:47+0000\n" -"PO-Revision-Date: 2013-06-25 10:47+0100\n" +"POT-Creation-Date: 2013-12-12 22:34+0000\n" +"PO-Revision-Date: 2013-12-12 23:34+0100\n" "Last-Translator: Pedro Manuel Baeza \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -31,6 +31,11 @@ msgstr "Ciudad" msgid "ZIP" msgstr "C.P." +#. module: base_location +#: field:res.better.zip,state_id:0 +msgid "State" +msgstr "Provincia" + #. module: base_location #: field:res.better.zip,country_id:0 msgid "Country" @@ -67,9 +72,9 @@ msgid "City/Location" msgstr "Ciudad/UbicaciĆ³n" #. module: base_location -#: field:res.better.zip,state_id:0 -msgid "State" -msgstr "Provincia" +#: view:res.better.zip:0 +msgid "Search city" +msgstr "Buscar ciudad" #. module: base_location #: field:res.company,better_zip_id:0 From 85ba316b56c40b30f18fa1416851c55a8ab8cac9 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 16 Jan 2014 00:15:48 +0100 Subject: [PATCH 2/2] [IMP] base_location: create_name_field for zip_id and added field for contact form. --- base_location/company_view.xml | 1 + base_location/partner_view.xml | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/base_location/company_view.xml b/base_location/company_view.xml index d697158e3..9aa24e358 100644 --- a/base_location/company_view.xml +++ b/base_location/company_view.xml @@ -9,6 +9,7 @@ diff --git a/base_location/partner_view.xml b/base_location/partner_view.xml index 5a11016b0..1329b1e02 100644 --- a/base_location/partner_view.xml +++ b/base_location/partner_view.xml @@ -8,11 +8,20 @@ + attrs="{'invisible': [('use_parent_address','=',True)]}" + /> + + +