Merge lp:~camptocamp/partner-contact-management/city_into_better_zip into lp:~partner-contact-core-editors/partner-contact-management/7.0

Proposed by Nicolas Bessi - Camptocamp
Status: Merged
Merged at revision: 21
Proposed branch: lp:~camptocamp/partner-contact-management/city_into_better_zip
Merge into: lp:~partner-contact-core-editors/partner-contact-management/7.0
Diff against target: 903 lines (+674/-54)
16 files modified
base_location/__init__.py (+6/-1)
base_location/__openerp__.py (+13/-5)
base_location/better_zip.py (+36/-21)
base_location/better_zip_view.xml (+6/-14)
base_location/company.py (+47/-0)
base_location/company_view.xml (+19/-0)
base_location/i18n/base_location.pot (+109/-0)
base_location/i18n/en.po (+107/-0)
base_location/i18n/es.po (+109/-0)
base_location/i18n/fr.po (+107/-0)
base_location/partner.py (+40/-0)
base_location/partner_view.xml (+17/-0)
base_location/security/ir.model.access.csv (+3/-0)
base_location/state.py (+29/-0)
base_location/state_view.xml (+26/-0)
better_zip/security/security.xml (+0/-13)
To merge this branch: bzr merge lp:~camptocamp/partner-contact-management/city_into_better_zip
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Approve
Pedro Manuel Baeza Approve
Review via email: mp+162771@code.launchpad.net

Description of the change

Porting city addons into better zip:
  -More complexe name get and name search.
  -Completion of country when changing state.
  -Zip object is added on company.
  -One2many from state to zip
  -Security is CSV

To post a comment you must log in.
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Still need to do po files

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Add PO files. Pedro can you have a look at spanish translation please.

Regards

Nicolas

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Nicolas,

Thanks for the work. These are my comments to your MP:

- 'ZIP Management' must be inside Configuration > Address book > Localization for better organization.
- 'ZIP Management' and 'ZIP completion' may not reflect the exact meaning of the function, because the completion is not only for the ZIP, but for the city, state and state fields. Why don't use 'Cities' and 'Location'?
- Please separate elements with commas instead spaces in name_get method of 'res.better.zip' for better understanding (specially with compound names).
- For what is used priority field? I think that now it's not necessary, doesn't it?

About the contributions lines, please change my email to the commercial one (<email address hidden>) and include also Ignacio Ibeas (<email address hidden>), that has contributed to the new city module.

When we decide all these things (and maybe the eventual module name change), I'll make the translation to spanish. We can also publish a pot file to let Launchpad manage translations.

Regards.

review: Needs Fixing
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

Il will do the changes.
The priority fields is used to manage different location with same zip.
For example 1000 Lausanne (usual case) and 1000 Lausanne Caserne (military ZIP)
Priority will ensure order when searching

Regards

Nicolas

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Nicolas:

That is why I say you don't need it, because when you search by zip code, all ocurrences will appear (or at least first 5) in the combo box, and you also have the ability to search by city name, so priority is now useless.

Cheers.

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

OK then I will flag it as deprecated.

Regards

Nicolas

Le Mon May 13 13:34:27 2013, Pedro Manuel Baeza a écrit :
> Hi, Nicolas:
>
> That is why I say you don't need it, because when you search by zip code, all ocurrences will appear (or at least first 5) in the combo box, and you also have the ability to search by city name, so priority is now useless.
>
> Cheers.

--
Nicolas Bessi
Senior ERP consultant
Business Solution technical manager

Camptocamp SA
PSE A
CH-1015 Lausanne
http://openerp.camptocamp.com

Phone: +41 21 619 10 26
Office: +41 21 619 10 10
Fax : +41 21 619 10 00
--

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Nicolas, can you made any update on this MP?

Regards.

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

I have pushed the last modifications

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Nicolas,

Thank you very much for your effort. Two more things to close this MP:

* Can you please put Cities/Location Management inside Location instead in Addres book for better organization?
* What do you think about the renaming to base_location to better express the funcionality?

Thanks again.

Regards.

review: Needs Fixing
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

Wich location menu are you talking about? Can you please give me the full path or better the parent id.

I'm a little afraid that renaming the addon breaks depending addons. I will make a test with a symlink and see if it works.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

I agree with Pedro, the menu Address Book/Localization already contains Country so Cities should be there.

Here is the menu id:

addons/base/res/res_country_view.xml
47: <menuitem id="menu_localisation" name="Localization" parent="menu_config_address_book" sequence="1" groups="base.group_no_one"/>

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Ah Yannick get the point "localization" not "Location".
It's ok for me.
Perdo can you confirm?

Regards

Nicolas

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Sorry, this was my mistake. Localization is correct instead of Location.

Regards.

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Ok then I will propose final fixes tomorrow.

Regards

Nicolas

29. By Nicolas Bessi - Camptocamp

[FIX] change config. menu path

30. By Nicolas Bessi - Camptocamp

[MV] rename better_zip to base_location

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello I have done the last fixes and rename the addons. I have also added a symlink named better_zip to base_location. It makes the addons appears two times but if you have technical feature permission it should not be a problem distinguish them. I also not sure of bzr symlink behavior on older version of Windows.

Regards

Nicolas

31. By Nicolas Bessi - Camptocamp

[ADD] better_zip simlink for compatibility

32. By Pedro Manuel Baeza

base_location: [IMP] Spanish translation and translation template.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Nicolas, thank you so much for your effort. You have done a wonderful work! Now the module is perfect and I'm going to use it as base of l10n_es_toponyms. Thanks also to other people that has helped in review, comments, and so on.

I have made an MP to your branch to integrate spanish translation, so please merge it and when you want, we merge also this proposal to partner-contact-management.

Regards.

review: Approve
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello Nicolas and Pedro,

I'm, sorry here we made big refactors around wip management in the Brazilian localization but ended loosing the train for v7 for using the city module. I'll have a look at your refactor though to see if it will work for us too and hopefully we catch up with the a standard city model and base zip model for v8. Thank you very much for your work.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Nicolas, can you please merge my branch with spanish translation and merge this MP to complete it?

Thank you!

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello

better_zip/base_location is ready for final review

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

¡¡Perfect!! You can proceed with the merge when you want.

review: Approve
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

Can someone merge this one.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Great to see this examplary collaboration! Noticed this proposal could do with another review, so just a few nits:

- l.133 should have context=None, not context={}
- l.148 is it wise to have the operator hardcoded?
- l.247,l.773 e.a. maybe use the conventional 'cr', not 'cursor'
- l.250 pass context

review: Needs Fixing
33. By Nicolas Bessi - Camptocamp

[FIX] mutable default in function signature

34. By Nicolas Bessi - Camptocamp

[FIX] pass context to default get

35. By Nicolas Bessi - Camptocamp

[FIX] variable name cursor -> cr

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Just commited fixes.

For the operator I propose to let it be like this for now it preserves previous behavior.

Regards

Nicolas

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks for your changes!

review: Approve
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Thanks Stefan for your code fine tuning!!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== renamed directory 'better_zip' => 'base_location'
=== modified file 'base_location/__init__.py'
--- better_zip/__init__.py 2013-01-18 08:21:59 +0000
+++ base_location/__init__.py 2013-07-09 08:10:36 +0000
@@ -1,7 +1,9 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3#3#
4# Author Nicolas Bessi. Copyright Camptocamp SA4# Author: Nicolas Bessi. Copyright Camptocamp SA
5# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
6# Ignacio Ibeas <ignacio@acysos.com>
5#7#
6# This program is free software: you can redistribute it and/or modify8# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as9# it under the terms of the GNU Affero General Public License as
@@ -18,3 +20,6 @@
18#20#
19##############################################################################21##############################################################################
20from . import better_zip22from . import better_zip
23from . import partner
24from . import state
25from . import company
2126
=== modified file 'base_location/__openerp__.py'
--- better_zip/__openerp__.py 2013-01-17 13:26:22 +0000
+++ base_location/__openerp__.py 2013-07-09 08:10:36 +0000
@@ -1,7 +1,9 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3#3#
4# Author Nicolas Bessi. Copyright Camptocamp SA4# Author: Nicolas Bessi. Copyright Camptocamp SA
5# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
6# Ignacio Ibeas <ignacio@acysos.com>
5#7#
6# This program is free software: you can redistribute it and/or modify8# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as9# it under the terms of the GNU Affero General Public License as
@@ -17,13 +19,19 @@
17# along with this program. If not, see <http://www.gnu.org/licenses/>.19# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#20#
19##############################################################################21##############################################################################
20{'name': 'Better zip management',22{'name': 'Location management (aka Better ZIP)',
21 'version': '0.3',23 'version': '0.3',
22 'depends': ['base',],24 'depends': ['base'],
23 'author': 'Camptocamp',25 'author': 'Camptocamp',
24 'description': """Introduce a better zip/npa management system. Enable partner completion""",26 'description': """
27Introduces a better zip/npa management system.
28It enables zip/city auto-completion on partners""",
25 'website': 'http://www.camptocamp.com',29 'website': 'http://www.camptocamp.com',
26 'data': ['security/security.xml', 'better_zip_view.xml'],30 'data': ['better_zip_view.xml',
31 'state_view.xml',
32 'company_view.xml',
33 'partner_view.xml',
34 'security/ir.model.access.csv'],
27 'installable': True,35 'installable': True,
28 'active': False,36 'active': False,
29 }37 }
3038
=== modified file 'base_location/better_zip.py'
--- better_zip/better_zip.py 2013-01-18 08:21:59 +0000
+++ base_location/better_zip.py 2013-07-09 08:10:36 +0000
@@ -1,7 +1,9 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2##############################################################################
3#3#
4# Author Nicolas Bessi. Copyright Camptocamp SA4# Author: Nicolas Bessi. Copyright Camptocamp SA
5# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
6# Ignacio Ibeas <ignacio@acysos.com>
5#7#
6# This program is free software: you can redistribute it and/or modify8# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as9# it under the terms of the GNU Affero General Public License as
@@ -17,21 +19,23 @@
17# along with this program. If not, see <http://www.gnu.org/licenses/>.19# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#20#
19##############################################################################21##############################################################################
20from openerp.osv.orm import Model, fields22from openerp.osv import orm, fields
2123
2224
23class BetterZip(Model):25class BetterZip(orm.Model):
24 " Zip/NPA object"26 " City/locations completion object"
2527
26 _name = "res.better.zip"28 _name = "res.better.zip"
27 _description = __doc__29 _description = __doc__
28 _order = "priority"30 _order = "priority"
2931
30 _columns = {'priority': fields.integer('Priority'),32 _columns = {'priority': fields.integer('Priority', deprecated=True),
31 'name': fields.char('ZIP', required=True),33 'name': fields.char('ZIP', required=True),
32 'city': fields.char('City', required=True),34 'city': fields.char('City', required=True),
33 'state_id': fields.many2one('res.country.state', 'State'),35 'state_id': fields.many2one('res.country.state', 'State'),
34 'country_id': fields.many2one('res.country', 'Country'),36 'country_id': fields.many2one('res.country', 'Country'),
37 'code': fields.char('City Code', size=64,
38 help="The official code for the city"),
35 }39 }
3640
37 _defaults = {'priority': 100}41 _defaults = {'priority': 100}
@@ -39,19 +43,30 @@
39 def name_get(self, cursor, uid, ids, context=None):43 def name_get(self, cursor, uid, ids, context=None):
40 res = []44 res = []
41 for bzip in self.browse(cursor, uid, ids):45 for bzip in self.browse(cursor, uid, ids):
42 res.append((bzip.id, u"%s %s" % (bzip.name, bzip.city)))46 name = [bzip.name, bzip.city]
47 if bzip.state_id:
48 name.append(bzip.state_id.name)
49 if bzip.country_id:
50 name.append(bzip.country_id.name)
51 res.append((bzip.id, ", ".join(name)))
43 return res52 return res
4453
4554 def onchange_state_id(self, cr, uid, ids, state_id=False, context=None):
46class Partner(Model):55 result = {}
47 _inherit = "res.partner"56 if state_id:
48 _columns = {'zip_id': fields.many2one('res.better.zip', 'ZIP/PN')}57 state = self.pool['res.country.state'].browse(cr, uid, state_id, context=context)
4958 if state:
50 def onchange_zip_id(self, cursor, uid, ids, zip_id, context=None):59 result['value'] = {'country_id': state.country_id.id}
51 if not zip_id:60 return result
52 return {}61
53 if isinstance(zip_id, list):62 def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
54 zip_id = zip_id[0]63 if args is None:
55 bzip = self.pool['res.better.zip'].browse(cursor, uid, zip_id, context=context)64 args = []
56 return {'value': {'zip': bzip.name, 'city': bzip.city,65 if context is None:
57 'country_id': bzip.country_id.id, 'state_id': bzip.state_id.id}}66 context = {}
67 ids = []
68 if name:
69 ids = self.search(cr, uid, [('name', 'ilike', name)] + args, limit=limit)
70 if not ids:
71 ids = self.search(cr, uid, [('city', operator, name)] + args, limit=limit)
72 return self.name_get(cr, uid, ids, context=context)
5873
=== modified file 'base_location/better_zip_view.xml'
--- better_zip/better_zip_view.xml 2013-01-16 15:15:15 +0000
+++ base_location/better_zip_view.xml 2013-07-09 08:10:36 +0000
@@ -1,16 +1,6 @@
1<?xml version="1.0" encoding="UTF-8"?>1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>2<openerp>
3 <data>3 <data>
4 <record id="view_partner_form" model="ir.ui.view">
5 <field name="name">res.partner.zip_id.2</field>
6 <field name="model">res.partner</field>
7 <field name="inherit_id" ref="base.view_partner_form"/>
8 <field name="arch" type="xml">
9 <field name="city" position="before">
10 <field name="zip_id" on_change="onchange_zip_id(zip_id)" placeholder="ZIP completion"/>
11 </field>
12 </field>
13 </record>
144
15 <record model="ir.ui.view" id="better_zip_form">5 <record model="ir.ui.view" id="better_zip_form">
16 <field name="name">res.better.zip.form</field>6 <field name="name">res.better.zip.form</field>
@@ -19,9 +9,10 @@
19 <form string="ZIP" version="7.0">9 <form string="ZIP" version="7.0">
20 <group col="4">10 <group col="4">
21 <field name="name"/>11 <field name="name"/>
12 <field name="code"/>
22 <field name="city"/>13 <field name="city"/>
23 <field name="priority"/>14 <field name="priority"/>
24 <field name="state_id"/>15 <field name="state_id" on_change="onchange_state_id(state_id)"/>
25 <field name="country_id"/>16 <field name="country_id"/>
26 </group>17 </group>
27 </form>18 </form>
@@ -34,6 +25,7 @@
34 <field name="arch" type="xml">25 <field name="arch" type="xml">
35 <tree string="ZIP">26 <tree string="ZIP">
36 <field name="name"/>27 <field name="name"/>
28 <field name="code"/>
37 <field name="city"/>29 <field name="city"/>
38 <field name="country_id"/>30 <field name="country_id"/>
39 <field name="priority"/>31 <field name="priority"/>
@@ -42,7 +34,7 @@
42 </record>34 </record>
4335
44 <record id="action_zip_tree" model="ir.actions.act_window">36 <record id="action_zip_tree" model="ir.actions.act_window">
45 <field name="name">ZIP Management</field>37 <field name="name">Cites/locations Management</field>
46 <field name="res_model">res.better.zip</field>38 <field name="res_model">res.better.zip</field>
47 <field name="view_type">form</field>39 <field name="view_type">form</field>
48 <field name="view_mode">tree,form</field>40 <field name="view_mode">tree,form</field>
@@ -50,9 +42,9 @@
50 </record>42 </record>
5143
52 <menuitem44 <menuitem
53 name="ZIP Management"45 name="Cities/Locations Management"
54 id="zip_base"46 id="zip_base"
55 parent="base.menu_base_config"47 parent="base.menu_localisation"
56 action="action_zip_tree"48 action="action_zip_tree"
57 />49 />
58 </data>50 </data>
5951
=== added file 'base_location/company.py'
--- base_location/company.py 1970-01-01 00:00:00 +0000
+++ base_location/company.py 2013-07-09 08:10:36 +0000
@@ -0,0 +1,47 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Nicolas Bessi. Copyright Camptocamp SA
5# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
6# Ignacio Ibeas <ignacio@acysos.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22from openerp.osv import orm, fields
23
24
25class ResCompany(orm.Model):
26
27 _inherit = 'res.company'
28
29 def on_change_city(self, cr, uid, ids, zip_id, context=None):
30 result = {}
31 if context is None:
32 context = {}
33 if zip_id:
34 bzip = self.pool['res.better.zip'].browse(cr, uid, zip_id, context=context)
35 result = {'value': {'zip': bzip.name,
36 'country_id': bzip.country_id.id if bzip.country_id else False,
37 'city': bzip.city,
38 'state_id': bzip.state_id.id if bzip.state_id else False
39 }
40 }
41 return result
42
43 _columns = {
44 'better_zip_id': fields.many2one('res.better.zip', 'Location', select=1,
45 help=('Use the city name or the zip code'
46 ' to search the location')),
47 }
048
=== added file 'base_location/company_view.xml'
--- base_location/company_view.xml 1970-01-01 00:00:00 +0000
+++ base_location/company_view.xml 2013-07-09 08:10:36 +0000
@@ -0,0 +1,19 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4 <!-- Add cities to the company form -->
5 <record id="view_company_form_city" model="ir.ui.view">
6 <field name="name">res.company.form.city</field>
7 <field name="model">res.company</field>
8 <field name="inherit_id" ref="base.view_company_form"/>
9 <field name="arch" type="xml">
10 <field name="street2" position="after">
11 <field name="better_zip_id"
12 colspan="4"
13 on_change="on_change_city(better_zip_id)"
14 placeholder="City completion" />
15 </field>
16 </field>
17 </record>
18 </data>
19</openerp>
020
=== added file 'base_location/i18n/base_location.pot'
--- base_location/i18n/base_location.pot 1970-01-01 00:00:00 +0000
+++ base_location/i18n/base_location.pot 2013-07-09 08:10:36 +0000
@@ -0,0 +1,109 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * base_location
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-06-25 08:56+0000\n"
10"PO-Revision-Date: 2013-06-25 08:56+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: base_location
19#: model:ir.actions.act_window,name:base_location.action_zip_tree
20msgid "Cites/locations Management"
21msgstr ""
22
23#. module: base_location
24#: field:res.better.zip,city:0
25msgid "City"
26msgstr ""
27
28#. module: base_location
29#: view:res.better.zip:0
30#: field:res.better.zip,name:0
31msgid "ZIP"
32msgstr ""
33
34#. module: base_location
35#: field:res.better.zip,country_id:0
36msgid "Country"
37msgstr ""
38
39#. module: base_location
40#: field:res.better.zip,priority:0
41msgid "Priority"
42msgstr ""
43
44#. module: base_location
45#: model:ir.model,name:base_location.model_res_company
46msgid "Companies"
47msgstr ""
48
49#. module: base_location
50#: field:res.better.zip,code:0
51msgid "City Code"
52msgstr ""
53
54#. module: base_location
55#: model:ir.model,name:base_location.model_res_better_zip
56msgid " City/locations completion object"
57msgstr ""
58
59#. module: base_location
60#: help:res.company,better_zip_id:0
61msgid "Use the city name or the zip code to search the location"
62msgstr ""
63
64#. module: base_location
65#: field:res.partner,zip_id:0
66msgid "City/Location"
67msgstr ""
68
69#. module: base_location
70#: field:res.better.zip,state_id:0
71msgid "State"
72msgstr ""
73
74#. module: base_location
75#: field:res.company,better_zip_id:0
76msgid "Location"
77msgstr ""
78
79#. module: base_location
80#: model:ir.ui.menu,name:base_location.zip_base
81msgid "Cities/Locations Management"
82msgstr ""
83
84#. module: base_location
85#: model:ir.model,name:base_location.model_res_partner
86msgid "Partner"
87msgstr ""
88
89#. module: base_location
90#: view:res.company:0
91#: view:res.partner:0
92msgid "City completion"
93msgstr ""
94
95#. module: base_location
96#: field:res.country.state,better_zip_ids:0
97msgid "Cities"
98msgstr ""
99
100#. module: base_location
101#: model:ir.model,name:base_location.model_res_country_state
102msgid "Country state"
103msgstr ""
104
105#. module: base_location
106#: help:res.better.zip,code:0
107msgid "The official code for the city"
108msgstr ""
109
0110
=== added file 'base_location/i18n/en.po'
--- base_location/i18n/en.po 1970-01-01 00:00:00 +0000
+++ base_location/i18n/en.po 2013-07-09 08:10:36 +0000
@@ -0,0 +1,107 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * better_zip
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-06-07 14:17+0000\n"
10"PO-Revision-Date: 2013-05-08 12:03+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"Language: \n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: \n"
17"Plural-Forms: \n"
18
19#. module: better_zip
20#: model:ir.actions.act_window,name:better_zip.action_zip_tree
21msgid "Cites/locations Management"
22msgstr "Cites/locations Management"
23
24#. module: better_zip
25#: field:res.better.zip,city:0
26msgid "City"
27msgstr "City"
28
29#. module: better_zip
30#: view:res.better.zip:0 field:res.better.zip,name:0
31msgid "ZIP"
32msgstr "ZIP"
33
34#. module: better_zip
35#: field:res.better.zip,country_id:0
36msgid "Country"
37msgstr "Country"
38
39#. module: better_zip
40#: field:res.better.zip,priority:0
41msgid "Priority"
42msgstr "Priority"
43
44#. module: better_zip
45#: model:ir.model,name:better_zip.model_res_company
46msgid "Companies"
47msgstr "Companies"
48
49#. module: better_zip
50#: field:res.better.zip,code:0
51msgid "City Code"
52msgstr "City Code"
53
54#. module: better_zip
55#: model:ir.model,name:better_zip.model_res_better_zip
56msgid " City/locations completion object"
57msgstr " City/locations completion object"
58
59#. module: better_zip
60#: help:res.company,better_zip_id:0
61msgid "Use the city name or the zip code to search the location"
62msgstr "Use the city name or the zip code to search the location"
63
64#. module: better_zip
65#: field:res.partner,zip_id:0
66msgid "City/Location"
67msgstr "City/Location"
68
69#. module: better_zip
70#: field:res.better.zip,state_id:0
71msgid "State"
72msgstr "State"
73
74#. module: better_zip
75#: field:res.company,better_zip_id:0
76msgid "Location"
77msgstr "Location"
78
79#. module: better_zip
80#: model:ir.ui.menu,name:better_zip.zip_base
81msgid "Cities/Locations Management"
82msgstr "Cities/Locations Management"
83
84#. module: better_zip
85#: model:ir.model,name:better_zip.model_res_partner
86msgid "Partner"
87msgstr "Partner"
88
89#. module: better_zip
90#: view:res.company:0 view:res.partner:0
91msgid "City completion"
92msgstr "City completion"
93
94#. module: better_zip
95#: field:res.country.state,better_zip_ids:0
96msgid "Cities"
97msgstr "Cities"
98
99#. module: better_zip
100#: model:ir.model,name:better_zip.model_res_country_state
101msgid "Country state"
102msgstr "Country state"
103
104#. module: better_zip
105#: help:res.better.zip,code:0
106msgid "The official code for the city"
107msgstr "The official code for the city"
0108
=== added file 'base_location/i18n/es.po'
--- base_location/i18n/es.po 1970-01-01 00:00:00 +0000
+++ base_location/i18n/es.po 2013-07-09 08:10:36 +0000
@@ -0,0 +1,109 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * base_location
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-06-25 08:47+0000\n"
10"PO-Revision-Date: 2013-06-25 10:47+0100\n"
11"Last-Translator: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: base_location
19#: model:ir.actions.act_window,name:base_location.action_zip_tree
20msgid "Cites/locations Management"
21msgstr "Gestión de ciudades/ubicaciones"
22
23#. module: base_location
24#: field:res.better.zip,city:0
25msgid "City"
26msgstr "Ciudad"
27
28#. module: base_location
29#: view:res.better.zip:0
30#: field:res.better.zip,name:0
31msgid "ZIP"
32msgstr "C.P."
33
34#. module: base_location
35#: field:res.better.zip,country_id:0
36msgid "Country"
37msgstr "País"
38
39#. module: base_location
40#: field:res.better.zip,priority:0
41msgid "Priority"
42msgstr "Prioridad"
43
44#. module: base_location
45#: model:ir.model,name:base_location.model_res_company
46msgid "Companies"
47msgstr "Compañías"
48
49#. module: base_location
50#: field:res.better.zip,code:0
51msgid "City Code"
52msgstr "Código de ciudad"
53
54#. module: base_location
55#: model:ir.model,name:base_location.model_res_better_zip
56msgid " City/locations completion object"
57msgstr " Objeto de completado de ciudad/ubicación"
58
59#. module: base_location
60#: help:res.company,better_zip_id:0
61msgid "Use the city name or the zip code to search the location"
62msgstr "Utilice el nombre de ciudad o el código postal para buscar la ubicación"
63
64#. module: base_location
65#: field:res.partner,zip_id:0
66msgid "City/Location"
67msgstr "Ciudad/Ubicación"
68
69#. module: base_location
70#: field:res.better.zip,state_id:0
71msgid "State"
72msgstr "Provincia"
73
74#. module: base_location
75#: field:res.company,better_zip_id:0
76msgid "Location"
77msgstr "Ubicación"
78
79#. module: base_location
80#: model:ir.ui.menu,name:base_location.zip_base
81msgid "Cities/Locations Management"
82msgstr "Ciudad/Ubicaciones"
83
84#. module: base_location
85#: model:ir.model,name:base_location.model_res_partner
86msgid "Partner"
87msgstr "Empresa"
88
89#. module: base_location
90#: view:res.company:0
91#: view:res.partner:0
92msgid "City completion"
93msgstr "Autocompletado a partir de la ciudad"
94
95#. module: base_location
96#: field:res.country.state,better_zip_ids:0
97msgid "Cities"
98msgstr "Ciudades"
99
100#. module: base_location
101#: model:ir.model,name:base_location.model_res_country_state
102msgid "Country state"
103msgstr "Provincia"
104
105#. module: base_location
106#: help:res.better.zip,code:0
107msgid "The official code for the city"
108msgstr "El código oficial para la ciudad"
109
0110
=== added file 'base_location/i18n/fr.po'
--- base_location/i18n/fr.po 1970-01-01 00:00:00 +0000
+++ base_location/i18n/fr.po 2013-07-09 08:10:36 +0000
@@ -0,0 +1,107 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * better_zip
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 7.0\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2013-06-07 14:17+0000\n"
10"PO-Revision-Date: 2013-05-08 12:03+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"Language: \n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: \n"
17"Plural-Forms: \n"
18
19#. module: better_zip
20#: model:ir.actions.act_window,name:better_zip.action_zip_tree
21msgid "Cites/locations Management"
22msgstr "Cites/locations Management"
23
24#. module: better_zip
25#: field:res.better.zip,city:0
26msgid "City"
27msgstr "Ville"
28
29#. module: better_zip
30#: view:res.better.zip:0 field:res.better.zip,name:0
31msgid "ZIP"
32msgstr "ZIP"
33
34#. module: better_zip
35#: field:res.better.zip,country_id:0
36msgid "Country"
37msgstr "Pays"
38
39#. module: better_zip
40#: field:res.better.zip,priority:0
41msgid "Priority"
42msgstr "Priorité"
43
44#. module: better_zip
45#: model:ir.model,name:better_zip.model_res_company
46msgid "Companies"
47msgstr "Sociétés"
48
49#. module: better_zip
50#: field:res.better.zip,code:0
51msgid "City Code"
52msgstr "Code de la ville"
53
54#. module: better_zip
55#: model:ir.model,name:better_zip.model_res_better_zip
56msgid " City/locations completion object"
57msgstr " City/locations completion object"
58
59#. module: better_zip
60#: help:res.company,better_zip_id:0
61msgid "Use the city name or the zip code to search the location"
62msgstr "Utilisez le nom de la ville ou le zip lors des recherches"
63
64#. module: better_zip
65#: field:res.partner,zip_id:0
66msgid "City/Location"
67msgstr "Ville/location"
68
69#. module: better_zip
70#: field:res.better.zip,state_id:0
71msgid "State"
72msgstr "Etat"
73
74#. module: better_zip
75#: field:res.company,better_zip_id:0
76msgid "Location"
77msgstr "Location"
78
79#. module: better_zip
80#: model:ir.ui.menu,name:better_zip.zip_base
81msgid "Cities/Locations Management"
82msgstr "Cities/Locations Management"
83
84#. module: better_zip
85#: model:ir.model,name:better_zip.model_res_partner
86msgid "Partner"
87msgstr "Partenaire"
88
89#. module: better_zip
90#: view:res.company:0 view:res.partner:0
91msgid "City completion"
92msgstr "Complétion par ville"
93
94#. module: better_zip
95#: field:res.country.state,better_zip_ids:0
96msgid "Cities"
97msgstr "Villes"
98
99#. module: better_zip
100#: model:ir.model,name:better_zip.model_res_country_state
101msgid "Country state"
102msgstr "Etat"
103
104#. module: better_zip
105#: help:res.better.zip,code:0
106msgid "The official code for the city"
107msgstr "Code officiel de la ville"
0108
=== added file 'base_location/partner.py'
--- base_location/partner.py 1970-01-01 00:00:00 +0000
+++ base_location/partner.py 2013-07-09 08:10:36 +0000
@@ -0,0 +1,40 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Nicolas Bessi. Copyright Camptocamp SA
5# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
6# Ignacio Ibeas <ignacio@acysos.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22from openerp.osv import orm, fields
23
24
25class ResPartner(orm.Model):
26 _inherit = "res.partner"
27 _columns = {'zip_id': fields.many2one('res.better.zip', 'City/Location')}
28
29 def onchange_zip_id(self, cursor, uid, ids, zip_id, context=None):
30 if not zip_id:
31 return {}
32 if isinstance(zip_id, list):
33 zip_id = zip_id[0]
34 bzip = self.pool['res.better.zip'].browse(cursor, uid, zip_id, context=context)
35 return {'value': {'zip': bzip.name,
36 'city': bzip.city,
37 'country_id': bzip.country_id.id if bzip.country_id else False,
38 'state_id': bzip.state_id.id if bzip.state_id else False,
39 }
40 }
041
=== added file 'base_location/partner_view.xml'
--- base_location/partner_view.xml 1970-01-01 00:00:00 +0000
+++ base_location/partner_view.xml 2013-07-09 08:10:36 +0000
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 <record id="view_partner_form" model="ir.ui.view">
5 <field name="name">res.partner.zip_id.2</field>
6 <field name="model">res.partner</field>
7 <field name="inherit_id" ref="base.view_partner_form"/>
8 <field name="arch" type="xml">
9 <field name="city" position="before">
10 <field name="zip_id"
11 on_change="onchange_zip_id(zip_id)"
12 placeholder="City completion"/>
13 </field>
14 </field>
15 </record>
16 </data>
17</openerp>
018
=== added file 'base_location/security/ir.model.access.csv'
--- base_location/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ base_location/security/ir.model.access.csv 2013-07-09 08:10:36 +0000
@@ -0,0 +1,3 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2"ir_model_access_betterzip0","res_better_zip group_user_all","model_res_better_zip",base.group_user,1,0,0,0
3"ir_model_access_betterzip1","res_better_zip group_user","model_res_better_zip","base.group_partner_manager",1,1,1,1
0\ No newline at end of file4\ No newline at end of file
15
=== added file 'base_location/state.py'
--- base_location/state.py 1970-01-01 00:00:00 +0000
+++ base_location/state.py 2013-07-09 08:10:36 +0000
@@ -0,0 +1,29 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Nicolas Bessi. Copyright Camptocamp SA
5# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
6# Ignacio Ibeas <ignacio@acysos.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22from openerp.osv import orm, fields
23
24
25class ResCountryState(orm.Model):
26
27 _inherit = 'res.country.state'
28
29 _columns = {'better_zip_ids': fields.one2many('res.better.zip', 'state_id', 'Cities')}
030
=== added file 'base_location/state_view.xml'
--- base_location/state_view.xml 1970-01-01 00:00:00 +0000
+++ base_location/state_view.xml 2013-07-09 08:10:36 +0000
@@ -0,0 +1,26 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4 <!-- Add cities to the State form -->
5 <record model="ir.ui.view" id="view_country_state_form2">
6 <field name="name">view_country_state_form2</field>
7 <field name="model">res.country.state</field>
8 <field name="inherit_id" ref="base.view_country_state_form"/>
9 <field name="arch" type="xml">
10 <field name="country_id" position="after">
11 <field name="better_zip_ids"
12 context="{'country_id': country_id}"
13 colspan="4"
14 nolabel="1">
15 <tree editable="top">
16 <field name="name"/>
17 <field name="code"/>
18 <field name="city"/>
19 <field name="country_id"/>
20 </tree>
21 </field>
22 </field>
23 </field>
24 </record>
25 </data>
26</openerp>
027
=== added symlink 'better_zip'
=== target is u'base_location'
=== removed file 'better_zip/security/security.xml'
--- better_zip/security/security.xml 2013-01-16 15:22:41 +0000
+++ better_zip/security/security.xml 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
1<openerp>
2 <data>
3 <record id="ir_model_access_betterzip0" model="ir.model.access">
4 <field name="model_id" ref="better_zip.model_res_better_zip"/>
5 <field eval="1" name="perm_read"/>
6 <field eval="'better_zip'" name="name"/>
7 <field eval="1" name="perm_unlink"/>
8 <field eval="1" name="perm_write"/>
9 <field eval="1" name="perm_create"/>
10 <field name="group_id" ref="base.group_user"/>
11 </record>
12 </data>
13</openerp>
14\ No newline at end of file0\ No newline at end of file

Subscribers

People subscribed via source and target branches

to status/vote changes: