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

Proposed by Romain Deheele - Camptocamp
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: 34
Merged at revision: 32
Proposed branch: lp:~camptocamp/partner-contact-management/base_continent
Merge into: lp:~partner-contact-core-editors/partner-contact-management/7.0
Diff against target: 431 lines (+379/-0)
10 files modified
base_continent/__init__.py (+24/-0)
base_continent/__openerp__.py (+42/-0)
base_continent/base_continent.py (+34/-0)
base_continent/base_continent_data.xml (+27/-0)
base_continent/base_continent_view.xml (+73/-0)
base_continent/country.py (+30/-0)
base_continent/i18n/base_continent.po (+56/-0)
base_continent/i18n/fr.po (+56/-0)
base_continent/partner.py (+34/-0)
base_continent/security/ir.model.access.csv (+3/-0)
To merge this branch: bzr merge lp:~camptocamp/partner-contact-management/base_continent
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Vincent Renaville@camptocamp (community) Needs Information
Guewen Baconnier @ Camptocamp Needs Fixing
Yannick Vaucher @ Camptocamp code review, no tests Approve
Review via email: mp+201452@code.launchpad.net

Description of the change

Hello,

I propose a new addon : base_continent.
Simple addon to manage continents and display it on partner form.

Romain

To post a comment you must log in.
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

"Continent management" is that part of your personal task "Conquer The World"?

If so, you might want to add pot file to rule the world in every languages ;)

Otherwise, wouldn't it be interesting to have a xml data file listing existing continents?

review: Needs Fixing (code review, no tests)
30. By Romain Deheele - Camptocamp

[ADD] add template and fr po

31. By Romain Deheele - Camptocamp

[ADD] add continent datas

Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

The conquest begins with data & po files ;)

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

Thanks for the changes

I won't ask to set the continent on each 253 country registered in OpenERP data

Start of your conquest has my approval

review: Approve (code review, no tests)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Thanks for your proposal.

Can you remove the deprecated <field name="type">tree</field> on the views?

The access rights file ir.model.access.csv is missing.

review: Needs Fixing
Revision history for this message
Vincent Renaville@camptocamp (vrenaville-c2c) wrote :

Hello,

From 69 to 73, this notation is not deprecated ?
you can replace it by data :

Forget my comment if I'm wrong ;)

Vincent

review: Needs Information
32. By Romain Deheele - Camptocamp

[FIX] remove deprecated types on views

33. By Romain Deheele - Camptocamp

[UPD] add access rights

34. By Romain Deheele - Camptocamp

[UPD] change deprecated keys in __openerp__.py

Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

thanks,

changes commited,

Romain

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

Good catch Vincent :)

Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'base_continent'
2=== added file 'base_continent/__init__.py'
3--- base_continent/__init__.py 1970-01-01 00:00:00 +0000
4+++ base_continent/__init__.py 2014-01-15 14:27:42 +0000
5@@ -0,0 +1,24 @@
6+# -*- encoding: utf-8 -*-
7+##############################################################################
8+#
9+# Author: Romain Deheele
10+# Copyright 2014 Camptocamp SA
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU General Public License as published by
14+# the Free Software Foundation, either version 3 of the License, or
15+# (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU General Public License for more details.
21+#
22+# You should have received a copy of the GNU General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26+
27+from . import base_continent
28+from . import country
29+from . import partner
30
31=== added file 'base_continent/__openerp__.py'
32--- base_continent/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ base_continent/__openerp__.py 2014-01-15 14:27:42 +0000
34@@ -0,0 +1,42 @@
35+# -*- coding: utf-8 -*-
36+##############################################################################
37+#
38+# Author: Romain Deheele
39+# Copyright 2014 Camptocamp SA
40+#
41+# This program is free software: you can redistribute it and/or modify
42+# it under the terms of the GNU Affero General Public License as
43+# published by the Free Software Foundation, either version 3 of the
44+# License, or (at your option) any later version.
45+#
46+# This program is distributed in the hope that it will be useful,
47+# but WITHOUT ANY WARRANTY; without even the implied warranty of
48+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49+# GNU Affero General Public License for more details.
50+#
51+# You should have received a copy of the GNU Affero General Public License
52+# along with this program. If not, see <http://www.gnu.org/licenses/>.
53+#
54+##############################################################################
55+
56+
57+{
58+ 'name': 'Continent management',
59+ 'version': '1.0',
60+ 'depends': ['base'],
61+ 'author': 'Camptocamp',
62+ 'license': 'AGPL-3',
63+ 'description': """
64+This module introduces continent management.
65+============================================
66+Links continents to countries,
67+adds continent field on partner form
68+""",
69+ 'category': 'Generic Modules/Base',
70+ 'data': [
71+ 'base_continent_view.xml',
72+ 'base_continent_data.xml',
73+ 'security/ir.model.access.csv'],
74+ 'active': False,
75+ 'installable': True,
76+}
77
78=== added file 'base_continent/base_continent.py'
79--- base_continent/base_continent.py 1970-01-01 00:00:00 +0000
80+++ base_continent/base_continent.py 2014-01-15 14:27:42 +0000
81@@ -0,0 +1,34 @@
82+# -*- coding: utf-8 -*-
83+##############################################################################
84+#
85+# Author: Romain Deheele
86+# Copyright 2014 Camptocamp SA
87+#
88+# This program is free software: you can redistribute it and/or modify
89+# it under the terms of the GNU Affero General Public License as
90+# published by the Free Software Foundation, either version 3 of the
91+# License, or (at your option) any later version.
92+#
93+# This program is distributed in the hope that it will be useful,
94+# but WITHOUT ANY WARRANTY; without even the implied warranty of
95+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96+# GNU Affero General Public License for more details.
97+#
98+# You should have received a copy of the GNU Affero General Public License
99+# along with this program. If not, see <http://www.gnu.org/licenses/>.
100+#
101+##############################################################################
102+
103+from openerp.osv.orm import Model
104+from openerp.osv import fields
105+
106+
107+class Continent(Model):
108+ _name = 'res.continent'
109+ _description = 'Continent'
110+ _columns = {
111+ 'name': fields.char('Continent Name', size=64,
112+ help='The full name of the continent.',
113+ required=True, translate=True),
114+ }
115+ _order = 'name'
116
117=== added file 'base_continent/base_continent_data.xml'
118--- base_continent/base_continent_data.xml 1970-01-01 00:00:00 +0000
119+++ base_continent/base_continent_data.xml 2014-01-15 14:27:42 +0000
120@@ -0,0 +1,27 @@
121+<?xml version="1.0" encoding="utf-8"?>
122+<openerp>
123+ <data noupdate="1">
124+
125+ <record id="af" model="res.continent">
126+ <field name="name">Africa</field>
127+ </record>
128+ <record id="an" model="res.continent">
129+ <field name="name">Antarctica</field>
130+ </record>
131+ <record id="as" model="res.continent">
132+ <field name="name">Asia</field>
133+ </record>
134+ <record id="eu" model="res.continent">
135+ <field name="name">Europe</field>
136+ </record>
137+ <record id="na" model="res.continent">
138+ <field name="name">North America</field>
139+ </record>
140+ <record id="oc" model="res.continent">
141+ <field name="name">Oceania</field>
142+ </record>
143+ <record id="sa" model="res.continent">
144+ <field name="name">South America</field>
145+ </record>
146+ </data>
147+</openerp>
148
149=== added file 'base_continent/base_continent_view.xml'
150--- base_continent/base_continent_view.xml 1970-01-01 00:00:00 +0000
151+++ base_continent/base_continent_view.xml 2014-01-15 14:27:42 +0000
152@@ -0,0 +1,73 @@
153+<?xml version="1.0" encoding="utf-8"?>
154+<openerp>
155+ <data>
156+ <!-- add continent to res country tree -->
157+ <record model="ir.ui.view" id="view_country_tree_add_continent">
158+ <field name="name">res.country.tree.add_continent</field>
159+ <field name="model">res.country</field>
160+ <field name="inherit_id" ref="base.view_country_tree" />
161+ <field name="arch" type="xml">
162+ <field name="code" position="after">
163+ <field name="continent_id"/>
164+ </field>
165+ </field>
166+ </record>
167+
168+ <!-- add continent to res country form -->
169+ <record model="ir.ui.view" id="view_country_form_add_continent">
170+ <field name="name">res.country.form.add_continent</field>
171+ <field name="model">res.country</field>
172+ <field name="inherit_id" ref="base.view_country_form"/>
173+ <field name="arch" type="xml">
174+ <field name="code" position="after">
175+ <field name="continent_id"/>
176+ </field>
177+ </field>
178+ </record>
179+
180+ <record id="view_continent_tree" model="ir.ui.view">
181+ <field name="name">res.continent.tree</field>
182+ <field name="model">res.continent</field>
183+ <field name="arch" type="xml">
184+ <tree string="Continent">
185+ <field name="name"/>
186+ </tree>
187+ </field>
188+ </record>
189+
190+ <record id="view_continent_form" model="ir.ui.view">
191+ <field name="name">res.continent.form</field>
192+ <field name="model">res.continent</field>
193+ <field name="arch" type="xml">
194+ <form string="Continent" version="7.0">
195+ <group>
196+ <field name="name"/>
197+ </group>
198+ </form>
199+ </field>
200+ </record>
201+
202+ <record id="action_continent" model="ir.actions.act_window">
203+ <field name="name">Continents</field>
204+ <field name="type">ir.actions.act_window</field>
205+ <field name="res_model">res.continent</field>
206+ <field name="view_type">form</field>
207+ <field name="help">Display and manage the list of all continents that can be assigned to your partner records.</field>
208+ </record>
209+
210+ <menuitem action="action_continent" id="menu_continent_partner" parent="base.menu_localisation" sequence="1" groups="base.group_no_one"/>
211+
212+ <!-- add continent to res partner form -->
213+ <record model="ir.ui.view" id="res_partner_form_add_continent">
214+ <field name="name">res.partner.form.add_continent</field>
215+ <field name="model">res.partner</field>
216+ <field name="inherit_id" ref="base.view_partner_form"/>
217+ <field name="arch" type="xml">
218+ <field name="country_id" position="after">
219+ <field name="continent_id" widget="selection"/>
220+ </field>
221+ </field>
222+ </record>
223+
224+ </data>
225+</openerp>
226
227=== added file 'base_continent/country.py'
228--- base_continent/country.py 1970-01-01 00:00:00 +0000
229+++ base_continent/country.py 2014-01-15 14:27:42 +0000
230@@ -0,0 +1,30 @@
231+# -*- coding: utf-8 -*-
232+##############################################################################
233+#
234+# Author: Romain Deheele
235+# Copyright 2014 Camptocamp SA
236+#
237+# This program is free software: you can redistribute it and/or modify
238+# it under the terms of the GNU Affero General Public License as
239+# published by the Free Software Foundation, either version 3 of the
240+# License, or (at your option) any later version.
241+#
242+# This program is distributed in the hope that it will be useful,
243+# but WITHOUT ANY WARRANTY; without even the implied warranty of
244+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
245+# GNU Affero General Public License for more details.
246+#
247+# You should have received a copy of the GNU Affero General Public License
248+# along with this program. If not, see <http://www.gnu.org/licenses/>.
249+#
250+##############################################################################
251+
252+from openerp.osv.orm import Model
253+from openerp.osv import fields
254+
255+
256+class Country(Model):
257+ _inherit = 'res.country'
258+ _columns = {
259+ 'continent_id': fields.many2one('res.continent', 'Continent'),
260+ }
261
262=== added directory 'base_continent/i18n'
263=== added file 'base_continent/i18n/base_continent.po'
264--- base_continent/i18n/base_continent.po 1970-01-01 00:00:00 +0000
265+++ base_continent/i18n/base_continent.po 2014-01-15 14:27:42 +0000
266@@ -0,0 +1,56 @@
267+# Translation of OpenERP Server.
268+# This file contains the translation of the following modules:
269+# * base_continent
270+#
271+msgid ""
272+msgstr ""
273+"Project-Id-Version: OpenERP Server 7.0\n"
274+"Report-Msgid-Bugs-To: \n"
275+"POT-Creation-Date: 2014-01-14 15:19+0000\n"
276+"PO-Revision-Date: 2014-01-14 15:19+0000\n"
277+"Last-Translator: <>\n"
278+"Language-Team: \n"
279+"MIME-Version: 1.0\n"
280+"Content-Type: text/plain; charset=UTF-8\n"
281+"Content-Transfer-Encoding: \n"
282+"Plural-Forms: \n"
283+
284+#. module: base_continent
285+#: model:ir.actions.act_window,help:base_continent.action_continent
286+msgid "Display and manage the list of all continents that can be assigned to your partner records."
287+msgstr ""
288+
289+#. module: base_continent
290+#: model:ir.actions.act_window,name:base_continent.action_continent
291+#: model:ir.ui.menu,name:base_continent.menu_continent_partner
292+msgid "Continents"
293+msgstr ""
294+
295+#. module: base_continent
296+#: model:ir.model,name:base_continent.model_res_country
297+msgid "Country"
298+msgstr ""
299+
300+#. module: base_continent
301+#: help:res.continent,name:0
302+msgid "The full name of the continent."
303+msgstr ""
304+
305+#. module: base_continent
306+#: field:res.continent,name:0
307+msgid "Continent Name"
308+msgstr ""
309+
310+#. module: base_continent
311+#: model:ir.model,name:base_continent.model_res_partner
312+msgid "Partner"
313+msgstr ""
314+
315+#. module: base_continent
316+#: model:ir.model,name:base_continent.model_res_continent
317+#: view:res.continent:0
318+#: field:res.country,continent_id:0
319+#: field:res.partner,continent_id:0
320+msgid "Continent"
321+msgstr ""
322+
323
324=== added file 'base_continent/i18n/fr.po'
325--- base_continent/i18n/fr.po 1970-01-01 00:00:00 +0000
326+++ base_continent/i18n/fr.po 2014-01-15 14:27:42 +0000
327@@ -0,0 +1,56 @@
328+# Translation of OpenERP Server.
329+# This file contains the translation of the following modules:
330+# * base_continent
331+#
332+msgid ""
333+msgstr ""
334+"Project-Id-Version: OpenERP Server 7.0\n"
335+"Report-Msgid-Bugs-To: \n"
336+"POT-Creation-Date: 2014-01-14 15:19+0000\n"
337+"PO-Revision-Date: 2014-01-14 15:19+0000\n"
338+"Last-Translator: <>\n"
339+"Language-Team: \n"
340+"MIME-Version: 1.0\n"
341+"Content-Type: text/plain; charset=UTF-8\n"
342+"Content-Transfer-Encoding: \n"
343+"Plural-Forms: \n"
344+
345+#. module: base_continent
346+#: model:ir.actions.act_window,help:base_continent.action_continent
347+msgid "Display and manage the list of all continents that can be assigned to your partner records."
348+msgstr "Affiche et gère la liste de tous les continents qui peuvent être associés à vos partenaires."
349+
350+#. module: base_continent
351+#: model:ir.actions.act_window,name:base_continent.action_continent
352+#: model:ir.ui.menu,name:base_continent.menu_continent_partner
353+msgid "Continents"
354+msgstr "Continents"
355+
356+#. module: base_continent
357+#: model:ir.model,name:base_continent.model_res_country
358+msgid "Country"
359+msgstr "Pays"
360+
361+#. module: base_continent
362+#: help:res.continent,name:0
363+msgid "The full name of the continent."
364+msgstr "Le nom complet du continent."
365+
366+#. module: base_continent
367+#: field:res.continent,name:0
368+msgid "Continent Name"
369+msgstr "Nom du continent"
370+
371+#. module: base_continent
372+#: model:ir.model,name:base_continent.model_res_partner
373+msgid "Partner"
374+msgstr "Partenaire"
375+
376+#. module: base_continent
377+#: model:ir.model,name:base_continent.model_res_continent
378+#: view:res.continent:0
379+#: field:res.country,continent_id:0
380+#: field:res.partner,continent_id:0
381+msgid "Continent"
382+msgstr "Continent"
383+
384
385=== added file 'base_continent/partner.py'
386--- base_continent/partner.py 1970-01-01 00:00:00 +0000
387+++ base_continent/partner.py 2014-01-15 14:27:42 +0000
388@@ -0,0 +1,34 @@
389+# -*- coding: utf-8 -*-
390+##############################################################################
391+#
392+# Author: Romain Deheele
393+# Copyright 2014 Camptocamp SA
394+#
395+# This program is free software: you can redistribute it and/or modify
396+# it under the terms of the GNU Affero General Public License as
397+# published by the Free Software Foundation, either version 3 of the
398+# License, or (at your option) any later version.
399+#
400+# This program is distributed in the hope that it will be useful,
401+# but WITHOUT ANY WARRANTY; without even the implied warranty of
402+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
403+# GNU Affero General Public License for more details.
404+#
405+# You should have received a copy of the GNU Affero General Public License
406+# along with this program. If not, see <http://www.gnu.org/licenses/>.
407+#
408+##############################################################################
409+
410+from openerp.osv.orm import Model
411+from openerp.osv import fields
412+
413+
414+class Partner(Model):
415+ _inherit = 'res.partner'
416+ _columns = {
417+ 'continent_id': fields.related('country_id', 'continent_id',
418+ type='many2one',
419+ relation='res.continent',
420+ string='Continent',
421+ readonly=True, store=True),
422+ }
423
424=== added directory 'base_continent/security'
425=== added file 'base_continent/security/ir.model.access.csv'
426--- base_continent/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
427+++ base_continent/security/ir.model.access.csv 2014-01-15 14:27:42 +0000
428@@ -0,0 +1,3 @@
429+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
430+access_res_continent_group_all,res_continent group_user_all,model_res_continent,,1,0,0,0
431+access_res_continent_group_user,res_continent group_user,model_res_continent,base.group_partner_manager,1,1,1,1

Subscribers

People subscribed via source and target branches

to status/vote changes: