Merge lp:~camptocamp/partner-contact-management/city_into_better_zip into lp:~partner-contact-core-editors/partner-contact-management/7.0
- city_into_better_zip
- Merge into 7.0
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stefan Rijnhart (Opener) | Approve | ||
Pedro Manuel Baeza | Approve | ||
Review via email:
|
Commit message
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

Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |

Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |
Add PO files. Pedro can you have a look at spanish translation please.
Regards
Nicolas

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.

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

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.

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://
Phone: +41 21 619 10 26
Office: +41 21 619 10 10
Fax : +41 21 619 10 00
--

Pedro Manuel Baeza (pedro.baeza) wrote : | # |
Hi, Nicolas, can you made any update on this MP?
Regards.

Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |
Hello,
I have pushed the last modifications

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.

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.

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/
47: <menuitem id="menu_

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

Pedro Manuel Baeza (pedro.baeza) wrote : | # |
Sorry, this was my mistake. Localization is correct instead of Location.
Regards.

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

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.

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-
Regards.

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.

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!

Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |
Hello
better_

Pedro Manuel Baeza (pedro.baeza) wrote : | # |
¡¡Perfect!! You can proceed with the merge when you want.

Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |
Hello,
Can someone merge this one.

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
- 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

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

Stefan Rijnhart (Opener) (stefan-opener) wrote : | # |
Thanks for your changes!

Pedro Manuel Baeza (pedro.baeza) wrote : | # |
Thanks Stefan for your code fine tuning!!
Preview Diff
1 | === renamed directory 'better_zip' => 'base_location' |
2 | === modified file 'base_location/__init__.py' |
3 | --- better_zip/__init__.py 2013-01-18 08:21:59 +0000 |
4 | +++ base_location/__init__.py 2013-07-09 08:10:36 +0000 |
5 | @@ -1,7 +1,9 @@ |
6 | # -*- coding: utf-8 -*- |
7 | ############################################################################## |
8 | # |
9 | -# Author Nicolas Bessi. Copyright Camptocamp SA |
10 | +# Author: Nicolas Bessi. Copyright Camptocamp SA |
11 | +# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> |
12 | +# Ignacio Ibeas <ignacio@acysos.com> |
13 | # |
14 | # This program is free software: you can redistribute it and/or modify |
15 | # it under the terms of the GNU Affero General Public License as |
16 | @@ -18,3 +20,6 @@ |
17 | # |
18 | ############################################################################## |
19 | from . import better_zip |
20 | +from . import partner |
21 | +from . import state |
22 | +from . import company |
23 | |
24 | === modified file 'base_location/__openerp__.py' |
25 | --- better_zip/__openerp__.py 2013-01-17 13:26:22 +0000 |
26 | +++ base_location/__openerp__.py 2013-07-09 08:10:36 +0000 |
27 | @@ -1,7 +1,9 @@ |
28 | # -*- coding: utf-8 -*- |
29 | ############################################################################## |
30 | # |
31 | -# Author Nicolas Bessi. Copyright Camptocamp SA |
32 | +# Author: Nicolas Bessi. Copyright Camptocamp SA |
33 | +# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> |
34 | +# Ignacio Ibeas <ignacio@acysos.com> |
35 | # |
36 | # This program is free software: you can redistribute it and/or modify |
37 | # it under the terms of the GNU Affero General Public License as |
38 | @@ -17,13 +19,19 @@ |
39 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
40 | # |
41 | ############################################################################## |
42 | -{'name': 'Better zip management', |
43 | +{'name': 'Location management (aka Better ZIP)', |
44 | 'version': '0.3', |
45 | - 'depends': ['base',], |
46 | + 'depends': ['base'], |
47 | 'author': 'Camptocamp', |
48 | - 'description': """Introduce a better zip/npa management system. Enable partner completion""", |
49 | + 'description': """ |
50 | +Introduces a better zip/npa management system. |
51 | +It enables zip/city auto-completion on partners""", |
52 | 'website': 'http://www.camptocamp.com', |
53 | - 'data': ['security/security.xml', 'better_zip_view.xml'], |
54 | + 'data': ['better_zip_view.xml', |
55 | + 'state_view.xml', |
56 | + 'company_view.xml', |
57 | + 'partner_view.xml', |
58 | + 'security/ir.model.access.csv'], |
59 | 'installable': True, |
60 | 'active': False, |
61 | } |
62 | |
63 | === modified file 'base_location/better_zip.py' |
64 | --- better_zip/better_zip.py 2013-01-18 08:21:59 +0000 |
65 | +++ base_location/better_zip.py 2013-07-09 08:10:36 +0000 |
66 | @@ -1,7 +1,9 @@ |
67 | # -*- coding: utf-8 -*- |
68 | ############################################################################## |
69 | # |
70 | -# Author Nicolas Bessi. Copyright Camptocamp SA |
71 | +# Author: Nicolas Bessi. Copyright Camptocamp SA |
72 | +# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> |
73 | +# Ignacio Ibeas <ignacio@acysos.com> |
74 | # |
75 | # This program is free software: you can redistribute it and/or modify |
76 | # it under the terms of the GNU Affero General Public License as |
77 | @@ -17,21 +19,23 @@ |
78 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
79 | # |
80 | ############################################################################## |
81 | -from openerp.osv.orm import Model, fields |
82 | - |
83 | - |
84 | -class BetterZip(Model): |
85 | - " Zip/NPA object" |
86 | +from openerp.osv import orm, fields |
87 | + |
88 | + |
89 | +class BetterZip(orm.Model): |
90 | + " City/locations completion object" |
91 | |
92 | _name = "res.better.zip" |
93 | _description = __doc__ |
94 | _order = "priority" |
95 | |
96 | - _columns = {'priority': fields.integer('Priority'), |
97 | + _columns = {'priority': fields.integer('Priority', deprecated=True), |
98 | 'name': fields.char('ZIP', required=True), |
99 | 'city': fields.char('City', required=True), |
100 | 'state_id': fields.many2one('res.country.state', 'State'), |
101 | 'country_id': fields.many2one('res.country', 'Country'), |
102 | + 'code': fields.char('City Code', size=64, |
103 | + help="The official code for the city"), |
104 | } |
105 | |
106 | _defaults = {'priority': 100} |
107 | @@ -39,19 +43,30 @@ |
108 | def name_get(self, cursor, uid, ids, context=None): |
109 | res = [] |
110 | for bzip in self.browse(cursor, uid, ids): |
111 | - res.append((bzip.id, u"%s %s" % (bzip.name, bzip.city))) |
112 | + name = [bzip.name, bzip.city] |
113 | + if bzip.state_id: |
114 | + name.append(bzip.state_id.name) |
115 | + if bzip.country_id: |
116 | + name.append(bzip.country_id.name) |
117 | + res.append((bzip.id, ", ".join(name))) |
118 | return res |
119 | |
120 | - |
121 | -class Partner(Model): |
122 | - _inherit = "res.partner" |
123 | - _columns = {'zip_id': fields.many2one('res.better.zip', 'ZIP/PN')} |
124 | - |
125 | - def onchange_zip_id(self, cursor, uid, ids, zip_id, context=None): |
126 | - if not zip_id: |
127 | - return {} |
128 | - if isinstance(zip_id, list): |
129 | - zip_id = zip_id[0] |
130 | - bzip = self.pool['res.better.zip'].browse(cursor, uid, zip_id, context=context) |
131 | - return {'value': {'zip': bzip.name, 'city': bzip.city, |
132 | - 'country_id': bzip.country_id.id, 'state_id': bzip.state_id.id}} |
133 | + def onchange_state_id(self, cr, uid, ids, state_id=False, context=None): |
134 | + result = {} |
135 | + if state_id: |
136 | + state = self.pool['res.country.state'].browse(cr, uid, state_id, context=context) |
137 | + if state: |
138 | + result['value'] = {'country_id': state.country_id.id} |
139 | + return result |
140 | + |
141 | + def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): |
142 | + if args is None: |
143 | + args = [] |
144 | + if context is None: |
145 | + context = {} |
146 | + ids = [] |
147 | + if name: |
148 | + ids = self.search(cr, uid, [('name', 'ilike', name)] + args, limit=limit) |
149 | + if not ids: |
150 | + ids = self.search(cr, uid, [('city', operator, name)] + args, limit=limit) |
151 | + return self.name_get(cr, uid, ids, context=context) |
152 | |
153 | === modified file 'base_location/better_zip_view.xml' |
154 | --- better_zip/better_zip_view.xml 2013-01-16 15:15:15 +0000 |
155 | +++ base_location/better_zip_view.xml 2013-07-09 08:10:36 +0000 |
156 | @@ -1,16 +1,6 @@ |
157 | <?xml version="1.0" encoding="UTF-8"?> |
158 | <openerp> |
159 | <data> |
160 | - <record id="view_partner_form" model="ir.ui.view"> |
161 | - <field name="name">res.partner.zip_id.2</field> |
162 | - <field name="model">res.partner</field> |
163 | - <field name="inherit_id" ref="base.view_partner_form"/> |
164 | - <field name="arch" type="xml"> |
165 | - <field name="city" position="before"> |
166 | - <field name="zip_id" on_change="onchange_zip_id(zip_id)" placeholder="ZIP completion"/> |
167 | - </field> |
168 | - </field> |
169 | - </record> |
170 | |
171 | <record model="ir.ui.view" id="better_zip_form"> |
172 | <field name="name">res.better.zip.form</field> |
173 | @@ -19,9 +9,10 @@ |
174 | <form string="ZIP" version="7.0"> |
175 | <group col="4"> |
176 | <field name="name"/> |
177 | + <field name="code"/> |
178 | <field name="city"/> |
179 | <field name="priority"/> |
180 | - <field name="state_id"/> |
181 | + <field name="state_id" on_change="onchange_state_id(state_id)"/> |
182 | <field name="country_id"/> |
183 | </group> |
184 | </form> |
185 | @@ -34,6 +25,7 @@ |
186 | <field name="arch" type="xml"> |
187 | <tree string="ZIP"> |
188 | <field name="name"/> |
189 | + <field name="code"/> |
190 | <field name="city"/> |
191 | <field name="country_id"/> |
192 | <field name="priority"/> |
193 | @@ -42,7 +34,7 @@ |
194 | </record> |
195 | |
196 | <record id="action_zip_tree" model="ir.actions.act_window"> |
197 | - <field name="name">ZIP Management</field> |
198 | + <field name="name">Cites/locations Management</field> |
199 | <field name="res_model">res.better.zip</field> |
200 | <field name="view_type">form</field> |
201 | <field name="view_mode">tree,form</field> |
202 | @@ -50,9 +42,9 @@ |
203 | </record> |
204 | |
205 | <menuitem |
206 | - name="ZIP Management" |
207 | + name="Cities/Locations Management" |
208 | id="zip_base" |
209 | - parent="base.menu_base_config" |
210 | + parent="base.menu_localisation" |
211 | action="action_zip_tree" |
212 | /> |
213 | </data> |
214 | |
215 | === added file 'base_location/company.py' |
216 | --- base_location/company.py 1970-01-01 00:00:00 +0000 |
217 | +++ base_location/company.py 2013-07-09 08:10:36 +0000 |
218 | @@ -0,0 +1,47 @@ |
219 | +# -*- coding: utf-8 -*- |
220 | +############################################################################## |
221 | +# |
222 | +# Author: Nicolas Bessi. Copyright Camptocamp SA |
223 | +# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> |
224 | +# Ignacio Ibeas <ignacio@acysos.com> |
225 | +# |
226 | +# This program is free software: you can redistribute it and/or modify |
227 | +# it under the terms of the GNU Affero General Public License as |
228 | +# published by the Free Software Foundation, either version 3 of the |
229 | +# License, or (at your option) any later version. |
230 | +# |
231 | +# This program is distributed in the hope that it will be useful, |
232 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
233 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
234 | +# GNU Affero General Public License for more details. |
235 | +# |
236 | +# You should have received a copy of the GNU Affero General Public License |
237 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
238 | +# |
239 | +############################################################################## |
240 | +from openerp.osv import orm, fields |
241 | + |
242 | + |
243 | +class ResCompany(orm.Model): |
244 | + |
245 | + _inherit = 'res.company' |
246 | + |
247 | + def on_change_city(self, cr, uid, ids, zip_id, context=None): |
248 | + result = {} |
249 | + if context is None: |
250 | + context = {} |
251 | + if zip_id: |
252 | + bzip = self.pool['res.better.zip'].browse(cr, uid, zip_id, context=context) |
253 | + result = {'value': {'zip': bzip.name, |
254 | + 'country_id': bzip.country_id.id if bzip.country_id else False, |
255 | + 'city': bzip.city, |
256 | + 'state_id': bzip.state_id.id if bzip.state_id else False |
257 | + } |
258 | + } |
259 | + return result |
260 | + |
261 | + _columns = { |
262 | + 'better_zip_id': fields.many2one('res.better.zip', 'Location', select=1, |
263 | + help=('Use the city name or the zip code' |
264 | + ' to search the location')), |
265 | + } |
266 | |
267 | === added file 'base_location/company_view.xml' |
268 | --- base_location/company_view.xml 1970-01-01 00:00:00 +0000 |
269 | +++ base_location/company_view.xml 2013-07-09 08:10:36 +0000 |
270 | @@ -0,0 +1,19 @@ |
271 | +<?xml version="1.0"?> |
272 | +<openerp> |
273 | + <data> |
274 | + <!-- Add cities to the company form --> |
275 | + <record id="view_company_form_city" model="ir.ui.view"> |
276 | + <field name="name">res.company.form.city</field> |
277 | + <field name="model">res.company</field> |
278 | + <field name="inherit_id" ref="base.view_company_form"/> |
279 | + <field name="arch" type="xml"> |
280 | + <field name="street2" position="after"> |
281 | + <field name="better_zip_id" |
282 | + colspan="4" |
283 | + on_change="on_change_city(better_zip_id)" |
284 | + placeholder="City completion" /> |
285 | + </field> |
286 | + </field> |
287 | + </record> |
288 | + </data> |
289 | +</openerp> |
290 | |
291 | === added file 'base_location/i18n/base_location.pot' |
292 | --- base_location/i18n/base_location.pot 1970-01-01 00:00:00 +0000 |
293 | +++ base_location/i18n/base_location.pot 2013-07-09 08:10:36 +0000 |
294 | @@ -0,0 +1,109 @@ |
295 | +# Translation of OpenERP Server. |
296 | +# This file contains the translation of the following modules: |
297 | +# * base_location |
298 | +# |
299 | +msgid "" |
300 | +msgstr "" |
301 | +"Project-Id-Version: OpenERP Server 7.0\n" |
302 | +"Report-Msgid-Bugs-To: \n" |
303 | +"POT-Creation-Date: 2013-06-25 08:56+0000\n" |
304 | +"PO-Revision-Date: 2013-06-25 08:56+0000\n" |
305 | +"Last-Translator: <>\n" |
306 | +"Language-Team: \n" |
307 | +"MIME-Version: 1.0\n" |
308 | +"Content-Type: text/plain; charset=UTF-8\n" |
309 | +"Content-Transfer-Encoding: \n" |
310 | +"Plural-Forms: \n" |
311 | + |
312 | +#. module: base_location |
313 | +#: model:ir.actions.act_window,name:base_location.action_zip_tree |
314 | +msgid "Cites/locations Management" |
315 | +msgstr "" |
316 | + |
317 | +#. module: base_location |
318 | +#: field:res.better.zip,city:0 |
319 | +msgid "City" |
320 | +msgstr "" |
321 | + |
322 | +#. module: base_location |
323 | +#: view:res.better.zip:0 |
324 | +#: field:res.better.zip,name:0 |
325 | +msgid "ZIP" |
326 | +msgstr "" |
327 | + |
328 | +#. module: base_location |
329 | +#: field:res.better.zip,country_id:0 |
330 | +msgid "Country" |
331 | +msgstr "" |
332 | + |
333 | +#. module: base_location |
334 | +#: field:res.better.zip,priority:0 |
335 | +msgid "Priority" |
336 | +msgstr "" |
337 | + |
338 | +#. module: base_location |
339 | +#: model:ir.model,name:base_location.model_res_company |
340 | +msgid "Companies" |
341 | +msgstr "" |
342 | + |
343 | +#. module: base_location |
344 | +#: field:res.better.zip,code:0 |
345 | +msgid "City Code" |
346 | +msgstr "" |
347 | + |
348 | +#. module: base_location |
349 | +#: model:ir.model,name:base_location.model_res_better_zip |
350 | +msgid " City/locations completion object" |
351 | +msgstr "" |
352 | + |
353 | +#. module: base_location |
354 | +#: help:res.company,better_zip_id:0 |
355 | +msgid "Use the city name or the zip code to search the location" |
356 | +msgstr "" |
357 | + |
358 | +#. module: base_location |
359 | +#: field:res.partner,zip_id:0 |
360 | +msgid "City/Location" |
361 | +msgstr "" |
362 | + |
363 | +#. module: base_location |
364 | +#: field:res.better.zip,state_id:0 |
365 | +msgid "State" |
366 | +msgstr "" |
367 | + |
368 | +#. module: base_location |
369 | +#: field:res.company,better_zip_id:0 |
370 | +msgid "Location" |
371 | +msgstr "" |
372 | + |
373 | +#. module: base_location |
374 | +#: model:ir.ui.menu,name:base_location.zip_base |
375 | +msgid "Cities/Locations Management" |
376 | +msgstr "" |
377 | + |
378 | +#. module: base_location |
379 | +#: model:ir.model,name:base_location.model_res_partner |
380 | +msgid "Partner" |
381 | +msgstr "" |
382 | + |
383 | +#. module: base_location |
384 | +#: view:res.company:0 |
385 | +#: view:res.partner:0 |
386 | +msgid "City completion" |
387 | +msgstr "" |
388 | + |
389 | +#. module: base_location |
390 | +#: field:res.country.state,better_zip_ids:0 |
391 | +msgid "Cities" |
392 | +msgstr "" |
393 | + |
394 | +#. module: base_location |
395 | +#: model:ir.model,name:base_location.model_res_country_state |
396 | +msgid "Country state" |
397 | +msgstr "" |
398 | + |
399 | +#. module: base_location |
400 | +#: help:res.better.zip,code:0 |
401 | +msgid "The official code for the city" |
402 | +msgstr "" |
403 | + |
404 | |
405 | === added file 'base_location/i18n/en.po' |
406 | --- base_location/i18n/en.po 1970-01-01 00:00:00 +0000 |
407 | +++ base_location/i18n/en.po 2013-07-09 08:10:36 +0000 |
408 | @@ -0,0 +1,107 @@ |
409 | +# Translation of OpenERP Server. |
410 | +# This file contains the translation of the following modules: |
411 | +# * better_zip |
412 | +# |
413 | +msgid "" |
414 | +msgstr "" |
415 | +"Project-Id-Version: OpenERP Server 7.0\n" |
416 | +"Report-Msgid-Bugs-To: \n" |
417 | +"POT-Creation-Date: 2013-06-07 14:17+0000\n" |
418 | +"PO-Revision-Date: 2013-05-08 12:03+0000\n" |
419 | +"Last-Translator: <>\n" |
420 | +"Language-Team: \n" |
421 | +"Language: \n" |
422 | +"MIME-Version: 1.0\n" |
423 | +"Content-Type: text/plain; charset=UTF-8\n" |
424 | +"Content-Transfer-Encoding: \n" |
425 | +"Plural-Forms: \n" |
426 | + |
427 | +#. module: better_zip |
428 | +#: model:ir.actions.act_window,name:better_zip.action_zip_tree |
429 | +msgid "Cites/locations Management" |
430 | +msgstr "Cites/locations Management" |
431 | + |
432 | +#. module: better_zip |
433 | +#: field:res.better.zip,city:0 |
434 | +msgid "City" |
435 | +msgstr "City" |
436 | + |
437 | +#. module: better_zip |
438 | +#: view:res.better.zip:0 field:res.better.zip,name:0 |
439 | +msgid "ZIP" |
440 | +msgstr "ZIP" |
441 | + |
442 | +#. module: better_zip |
443 | +#: field:res.better.zip,country_id:0 |
444 | +msgid "Country" |
445 | +msgstr "Country" |
446 | + |
447 | +#. module: better_zip |
448 | +#: field:res.better.zip,priority:0 |
449 | +msgid "Priority" |
450 | +msgstr "Priority" |
451 | + |
452 | +#. module: better_zip |
453 | +#: model:ir.model,name:better_zip.model_res_company |
454 | +msgid "Companies" |
455 | +msgstr "Companies" |
456 | + |
457 | +#. module: better_zip |
458 | +#: field:res.better.zip,code:0 |
459 | +msgid "City Code" |
460 | +msgstr "City Code" |
461 | + |
462 | +#. module: better_zip |
463 | +#: model:ir.model,name:better_zip.model_res_better_zip |
464 | +msgid " City/locations completion object" |
465 | +msgstr " City/locations completion object" |
466 | + |
467 | +#. module: better_zip |
468 | +#: help:res.company,better_zip_id:0 |
469 | +msgid "Use the city name or the zip code to search the location" |
470 | +msgstr "Use the city name or the zip code to search the location" |
471 | + |
472 | +#. module: better_zip |
473 | +#: field:res.partner,zip_id:0 |
474 | +msgid "City/Location" |
475 | +msgstr "City/Location" |
476 | + |
477 | +#. module: better_zip |
478 | +#: field:res.better.zip,state_id:0 |
479 | +msgid "State" |
480 | +msgstr "State" |
481 | + |
482 | +#. module: better_zip |
483 | +#: field:res.company,better_zip_id:0 |
484 | +msgid "Location" |
485 | +msgstr "Location" |
486 | + |
487 | +#. module: better_zip |
488 | +#: model:ir.ui.menu,name:better_zip.zip_base |
489 | +msgid "Cities/Locations Management" |
490 | +msgstr "Cities/Locations Management" |
491 | + |
492 | +#. module: better_zip |
493 | +#: model:ir.model,name:better_zip.model_res_partner |
494 | +msgid "Partner" |
495 | +msgstr "Partner" |
496 | + |
497 | +#. module: better_zip |
498 | +#: view:res.company:0 view:res.partner:0 |
499 | +msgid "City completion" |
500 | +msgstr "City completion" |
501 | + |
502 | +#. module: better_zip |
503 | +#: field:res.country.state,better_zip_ids:0 |
504 | +msgid "Cities" |
505 | +msgstr "Cities" |
506 | + |
507 | +#. module: better_zip |
508 | +#: model:ir.model,name:better_zip.model_res_country_state |
509 | +msgid "Country state" |
510 | +msgstr "Country state" |
511 | + |
512 | +#. module: better_zip |
513 | +#: help:res.better.zip,code:0 |
514 | +msgid "The official code for the city" |
515 | +msgstr "The official code for the city" |
516 | |
517 | === added file 'base_location/i18n/es.po' |
518 | --- base_location/i18n/es.po 1970-01-01 00:00:00 +0000 |
519 | +++ base_location/i18n/es.po 2013-07-09 08:10:36 +0000 |
520 | @@ -0,0 +1,109 @@ |
521 | +# Translation of OpenERP Server. |
522 | +# This file contains the translation of the following modules: |
523 | +# * base_location |
524 | +# |
525 | +msgid "" |
526 | +msgstr "" |
527 | +"Project-Id-Version: OpenERP Server 7.0\n" |
528 | +"Report-Msgid-Bugs-To: \n" |
529 | +"POT-Creation-Date: 2013-06-25 08:47+0000\n" |
530 | +"PO-Revision-Date: 2013-06-25 10:47+0100\n" |
531 | +"Last-Translator: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>\n" |
532 | +"Language-Team: \n" |
533 | +"MIME-Version: 1.0\n" |
534 | +"Content-Type: text/plain; charset=UTF-8\n" |
535 | +"Content-Transfer-Encoding: 8bit\n" |
536 | +"Plural-Forms: \n" |
537 | + |
538 | +#. module: base_location |
539 | +#: model:ir.actions.act_window,name:base_location.action_zip_tree |
540 | +msgid "Cites/locations Management" |
541 | +msgstr "Gestión de ciudades/ubicaciones" |
542 | + |
543 | +#. module: base_location |
544 | +#: field:res.better.zip,city:0 |
545 | +msgid "City" |
546 | +msgstr "Ciudad" |
547 | + |
548 | +#. module: base_location |
549 | +#: view:res.better.zip:0 |
550 | +#: field:res.better.zip,name:0 |
551 | +msgid "ZIP" |
552 | +msgstr "C.P." |
553 | + |
554 | +#. module: base_location |
555 | +#: field:res.better.zip,country_id:0 |
556 | +msgid "Country" |
557 | +msgstr "País" |
558 | + |
559 | +#. module: base_location |
560 | +#: field:res.better.zip,priority:0 |
561 | +msgid "Priority" |
562 | +msgstr "Prioridad" |
563 | + |
564 | +#. module: base_location |
565 | +#: model:ir.model,name:base_location.model_res_company |
566 | +msgid "Companies" |
567 | +msgstr "Compañías" |
568 | + |
569 | +#. module: base_location |
570 | +#: field:res.better.zip,code:0 |
571 | +msgid "City Code" |
572 | +msgstr "Código de ciudad" |
573 | + |
574 | +#. module: base_location |
575 | +#: model:ir.model,name:base_location.model_res_better_zip |
576 | +msgid " City/locations completion object" |
577 | +msgstr " Objeto de completado de ciudad/ubicación" |
578 | + |
579 | +#. module: base_location |
580 | +#: help:res.company,better_zip_id:0 |
581 | +msgid "Use the city name or the zip code to search the location" |
582 | +msgstr "Utilice el nombre de ciudad o el código postal para buscar la ubicación" |
583 | + |
584 | +#. module: base_location |
585 | +#: field:res.partner,zip_id:0 |
586 | +msgid "City/Location" |
587 | +msgstr "Ciudad/Ubicación" |
588 | + |
589 | +#. module: base_location |
590 | +#: field:res.better.zip,state_id:0 |
591 | +msgid "State" |
592 | +msgstr "Provincia" |
593 | + |
594 | +#. module: base_location |
595 | +#: field:res.company,better_zip_id:0 |
596 | +msgid "Location" |
597 | +msgstr "Ubicación" |
598 | + |
599 | +#. module: base_location |
600 | +#: model:ir.ui.menu,name:base_location.zip_base |
601 | +msgid "Cities/Locations Management" |
602 | +msgstr "Ciudad/Ubicaciones" |
603 | + |
604 | +#. module: base_location |
605 | +#: model:ir.model,name:base_location.model_res_partner |
606 | +msgid "Partner" |
607 | +msgstr "Empresa" |
608 | + |
609 | +#. module: base_location |
610 | +#: view:res.company:0 |
611 | +#: view:res.partner:0 |
612 | +msgid "City completion" |
613 | +msgstr "Autocompletado a partir de la ciudad" |
614 | + |
615 | +#. module: base_location |
616 | +#: field:res.country.state,better_zip_ids:0 |
617 | +msgid "Cities" |
618 | +msgstr "Ciudades" |
619 | + |
620 | +#. module: base_location |
621 | +#: model:ir.model,name:base_location.model_res_country_state |
622 | +msgid "Country state" |
623 | +msgstr "Provincia" |
624 | + |
625 | +#. module: base_location |
626 | +#: help:res.better.zip,code:0 |
627 | +msgid "The official code for the city" |
628 | +msgstr "El código oficial para la ciudad" |
629 | + |
630 | |
631 | === added file 'base_location/i18n/fr.po' |
632 | --- base_location/i18n/fr.po 1970-01-01 00:00:00 +0000 |
633 | +++ base_location/i18n/fr.po 2013-07-09 08:10:36 +0000 |
634 | @@ -0,0 +1,107 @@ |
635 | +# Translation of OpenERP Server. |
636 | +# This file contains the translation of the following modules: |
637 | +# * better_zip |
638 | +# |
639 | +msgid "" |
640 | +msgstr "" |
641 | +"Project-Id-Version: OpenERP Server 7.0\n" |
642 | +"Report-Msgid-Bugs-To: \n" |
643 | +"POT-Creation-Date: 2013-06-07 14:17+0000\n" |
644 | +"PO-Revision-Date: 2013-05-08 12:03+0000\n" |
645 | +"Last-Translator: <>\n" |
646 | +"Language-Team: \n" |
647 | +"Language: \n" |
648 | +"MIME-Version: 1.0\n" |
649 | +"Content-Type: text/plain; charset=UTF-8\n" |
650 | +"Content-Transfer-Encoding: \n" |
651 | +"Plural-Forms: \n" |
652 | + |
653 | +#. module: better_zip |
654 | +#: model:ir.actions.act_window,name:better_zip.action_zip_tree |
655 | +msgid "Cites/locations Management" |
656 | +msgstr "Cites/locations Management" |
657 | + |
658 | +#. module: better_zip |
659 | +#: field:res.better.zip,city:0 |
660 | +msgid "City" |
661 | +msgstr "Ville" |
662 | + |
663 | +#. module: better_zip |
664 | +#: view:res.better.zip:0 field:res.better.zip,name:0 |
665 | +msgid "ZIP" |
666 | +msgstr "ZIP" |
667 | + |
668 | +#. module: better_zip |
669 | +#: field:res.better.zip,country_id:0 |
670 | +msgid "Country" |
671 | +msgstr "Pays" |
672 | + |
673 | +#. module: better_zip |
674 | +#: field:res.better.zip,priority:0 |
675 | +msgid "Priority" |
676 | +msgstr "Priorité" |
677 | + |
678 | +#. module: better_zip |
679 | +#: model:ir.model,name:better_zip.model_res_company |
680 | +msgid "Companies" |
681 | +msgstr "Sociétés" |
682 | + |
683 | +#. module: better_zip |
684 | +#: field:res.better.zip,code:0 |
685 | +msgid "City Code" |
686 | +msgstr "Code de la ville" |
687 | + |
688 | +#. module: better_zip |
689 | +#: model:ir.model,name:better_zip.model_res_better_zip |
690 | +msgid " City/locations completion object" |
691 | +msgstr " City/locations completion object" |
692 | + |
693 | +#. module: better_zip |
694 | +#: help:res.company,better_zip_id:0 |
695 | +msgid "Use the city name or the zip code to search the location" |
696 | +msgstr "Utilisez le nom de la ville ou le zip lors des recherches" |
697 | + |
698 | +#. module: better_zip |
699 | +#: field:res.partner,zip_id:0 |
700 | +msgid "City/Location" |
701 | +msgstr "Ville/location" |
702 | + |
703 | +#. module: better_zip |
704 | +#: field:res.better.zip,state_id:0 |
705 | +msgid "State" |
706 | +msgstr "Etat" |
707 | + |
708 | +#. module: better_zip |
709 | +#: field:res.company,better_zip_id:0 |
710 | +msgid "Location" |
711 | +msgstr "Location" |
712 | + |
713 | +#. module: better_zip |
714 | +#: model:ir.ui.menu,name:better_zip.zip_base |
715 | +msgid "Cities/Locations Management" |
716 | +msgstr "Cities/Locations Management" |
717 | + |
718 | +#. module: better_zip |
719 | +#: model:ir.model,name:better_zip.model_res_partner |
720 | +msgid "Partner" |
721 | +msgstr "Partenaire" |
722 | + |
723 | +#. module: better_zip |
724 | +#: view:res.company:0 view:res.partner:0 |
725 | +msgid "City completion" |
726 | +msgstr "Complétion par ville" |
727 | + |
728 | +#. module: better_zip |
729 | +#: field:res.country.state,better_zip_ids:0 |
730 | +msgid "Cities" |
731 | +msgstr "Villes" |
732 | + |
733 | +#. module: better_zip |
734 | +#: model:ir.model,name:better_zip.model_res_country_state |
735 | +msgid "Country state" |
736 | +msgstr "Etat" |
737 | + |
738 | +#. module: better_zip |
739 | +#: help:res.better.zip,code:0 |
740 | +msgid "The official code for the city" |
741 | +msgstr "Code officiel de la ville" |
742 | |
743 | === added file 'base_location/partner.py' |
744 | --- base_location/partner.py 1970-01-01 00:00:00 +0000 |
745 | +++ base_location/partner.py 2013-07-09 08:10:36 +0000 |
746 | @@ -0,0 +1,40 @@ |
747 | +# -*- coding: utf-8 -*- |
748 | +############################################################################## |
749 | +# |
750 | +# Author: Nicolas Bessi. Copyright Camptocamp SA |
751 | +# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> |
752 | +# Ignacio Ibeas <ignacio@acysos.com> |
753 | +# |
754 | +# This program is free software: you can redistribute it and/or modify |
755 | +# it under the terms of the GNU Affero General Public License as |
756 | +# published by the Free Software Foundation, either version 3 of the |
757 | +# License, or (at your option) any later version. |
758 | +# |
759 | +# This program is distributed in the hope that it will be useful, |
760 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
761 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
762 | +# GNU Affero General Public License for more details. |
763 | +# |
764 | +# You should have received a copy of the GNU Affero General Public License |
765 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
766 | +# |
767 | +############################################################################## |
768 | +from openerp.osv import orm, fields |
769 | + |
770 | + |
771 | +class ResPartner(orm.Model): |
772 | + _inherit = "res.partner" |
773 | + _columns = {'zip_id': fields.many2one('res.better.zip', 'City/Location')} |
774 | + |
775 | + def onchange_zip_id(self, cursor, uid, ids, zip_id, context=None): |
776 | + if not zip_id: |
777 | + return {} |
778 | + if isinstance(zip_id, list): |
779 | + zip_id = zip_id[0] |
780 | + bzip = self.pool['res.better.zip'].browse(cursor, uid, zip_id, context=context) |
781 | + return {'value': {'zip': bzip.name, |
782 | + 'city': bzip.city, |
783 | + 'country_id': bzip.country_id.id if bzip.country_id else False, |
784 | + 'state_id': bzip.state_id.id if bzip.state_id else False, |
785 | + } |
786 | + } |
787 | |
788 | === added file 'base_location/partner_view.xml' |
789 | --- base_location/partner_view.xml 1970-01-01 00:00:00 +0000 |
790 | +++ base_location/partner_view.xml 2013-07-09 08:10:36 +0000 |
791 | @@ -0,0 +1,17 @@ |
792 | +<?xml version="1.0" encoding="UTF-8"?> |
793 | +<openerp> |
794 | + <data> |
795 | + <record id="view_partner_form" model="ir.ui.view"> |
796 | + <field name="name">res.partner.zip_id.2</field> |
797 | + <field name="model">res.partner</field> |
798 | + <field name="inherit_id" ref="base.view_partner_form"/> |
799 | + <field name="arch" type="xml"> |
800 | + <field name="city" position="before"> |
801 | + <field name="zip_id" |
802 | + on_change="onchange_zip_id(zip_id)" |
803 | + placeholder="City completion"/> |
804 | + </field> |
805 | + </field> |
806 | + </record> |
807 | + </data> |
808 | +</openerp> |
809 | |
810 | === added file 'base_location/security/ir.model.access.csv' |
811 | --- base_location/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
812 | +++ base_location/security/ir.model.access.csv 2013-07-09 08:10:36 +0000 |
813 | @@ -0,0 +1,3 @@ |
814 | +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
815 | +"ir_model_access_betterzip0","res_better_zip group_user_all","model_res_better_zip",base.group_user,1,0,0,0 |
816 | +"ir_model_access_betterzip1","res_better_zip group_user","model_res_better_zip","base.group_partner_manager",1,1,1,1 |
817 | \ No newline at end of file |
818 | |
819 | === added file 'base_location/state.py' |
820 | --- base_location/state.py 1970-01-01 00:00:00 +0000 |
821 | +++ base_location/state.py 2013-07-09 08:10:36 +0000 |
822 | @@ -0,0 +1,29 @@ |
823 | +# -*- coding: utf-8 -*- |
824 | +############################################################################## |
825 | +# |
826 | +# Author: Nicolas Bessi. Copyright Camptocamp SA |
827 | +# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> |
828 | +# Ignacio Ibeas <ignacio@acysos.com> |
829 | +# |
830 | +# This program is free software: you can redistribute it and/or modify |
831 | +# it under the terms of the GNU Affero General Public License as |
832 | +# published by the Free Software Foundation, either version 3 of the |
833 | +# License, or (at your option) any later version. |
834 | +# |
835 | +# This program is distributed in the hope that it will be useful, |
836 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
837 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
838 | +# GNU Affero General Public License for more details. |
839 | +# |
840 | +# You should have received a copy of the GNU Affero General Public License |
841 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
842 | +# |
843 | +############################################################################## |
844 | +from openerp.osv import orm, fields |
845 | + |
846 | + |
847 | +class ResCountryState(orm.Model): |
848 | + |
849 | + _inherit = 'res.country.state' |
850 | + |
851 | + _columns = {'better_zip_ids': fields.one2many('res.better.zip', 'state_id', 'Cities')} |
852 | |
853 | === added file 'base_location/state_view.xml' |
854 | --- base_location/state_view.xml 1970-01-01 00:00:00 +0000 |
855 | +++ base_location/state_view.xml 2013-07-09 08:10:36 +0000 |
856 | @@ -0,0 +1,26 @@ |
857 | +<?xml version="1.0"?> |
858 | +<openerp> |
859 | + <data> |
860 | + <!-- Add cities to the State form --> |
861 | + <record model="ir.ui.view" id="view_country_state_form2"> |
862 | + <field name="name">view_country_state_form2</field> |
863 | + <field name="model">res.country.state</field> |
864 | + <field name="inherit_id" ref="base.view_country_state_form"/> |
865 | + <field name="arch" type="xml"> |
866 | + <field name="country_id" position="after"> |
867 | + <field name="better_zip_ids" |
868 | + context="{'country_id': country_id}" |
869 | + colspan="4" |
870 | + nolabel="1"> |
871 | + <tree editable="top"> |
872 | + <field name="name"/> |
873 | + <field name="code"/> |
874 | + <field name="city"/> |
875 | + <field name="country_id"/> |
876 | + </tree> |
877 | + </field> |
878 | + </field> |
879 | + </field> |
880 | + </record> |
881 | + </data> |
882 | +</openerp> |
883 | |
884 | === added symlink 'better_zip' |
885 | === target is u'base_location' |
886 | === removed file 'better_zip/security/security.xml' |
887 | --- better_zip/security/security.xml 2013-01-16 15:22:41 +0000 |
888 | +++ better_zip/security/security.xml 1970-01-01 00:00:00 +0000 |
889 | @@ -1,13 +0,0 @@ |
890 | -<openerp> |
891 | - <data> |
892 | - <record id="ir_model_access_betterzip0" model="ir.model.access"> |
893 | - <field name="model_id" ref="better_zip.model_res_better_zip"/> |
894 | - <field eval="1" name="perm_read"/> |
895 | - <field eval="'better_zip'" name="name"/> |
896 | - <field eval="1" name="perm_unlink"/> |
897 | - <field eval="1" name="perm_write"/> |
898 | - <field eval="1" name="perm_create"/> |
899 | - <field name="group_id" ref="base.group_user"/> |
900 | - </record> |
901 | - </data> |
902 | -</openerp> |
903 | \ No newline at end of file |
Still need to do po files