← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~savoirfairelinux-openerp/partner-contact-management/city-move into lp:partner-contact-management

 

You have been requested to review the proposed merge of lp:~savoirfairelinux-openerp/partner-contact-management/city-move into lp:partner-contact-management.

For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/partner-contact-management/city-move/+merge/196023

Move city module from lp:openerp-mexico-localization

-- 
https://code.launchpad.net/~savoirfairelinux-openerp/partner-contact-management/city-move/+merge/196023
Your team Partner and Contact Core Editors is requested to review the proposed merge of lp:~savoirfairelinux-openerp/partner-contact-management/city-move into lp:partner-contact-management.
=== added directory 'city'
=== added file 'city/__init__.py'
--- city/__init__.py	1970-01-01 00:00:00 +0000
+++ city/__init__.py	2013-12-11 21:08:57 +0000
@@ -0,0 +1,30 @@
+# -*- encoding: utf-8 -*-
+###########################################################################
+#    Module Writen to OpenERP, Open Source Management Solution
+#
+#    Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/
+#    All Rights Reserved.
+#    info Vauxoo (info@xxxxxxxxxx)
+############################################################################
+#    Coded by: moylop260 (moylop260@xxxxxxxxxx)
+#              Julio Serna (julio@xxxxxxxxxx)
+#              Isaac Lopez (isaac@xxxxxxxxxx)
+############################################################################
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import res_city
+import res_partner

=== added file 'city/__openerp__.py'
--- city/__openerp__.py	1970-01-01 00:00:00 +0000
+++ city/__openerp__.py	2013-12-11 21:08:57 +0000
@@ -0,0 +1,52 @@
+# -*- encoding: utf-8 -*-
+###########################################################################
+#    Module Writen to OpenERP, Open Source Management Solution
+#
+#    Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/
+#    All Rights Reserved.
+#    info Vauxoo (info@xxxxxxxxxx)
+############################################################################
+#    Coded by: moylop260 (moylop260@xxxxxxxxxx)
+#              Julio Serna (julio@xxxxxxxxxx)
+#              Isaac Lopez (isaac@xxxxxxxxxx)
+############################################################################
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+    "name": "City",
+    "version": "1.0",
+    "author": "Vauxoo",
+    "category": "Localization",
+    "description": """
+This module creates the city model similar to states model and replaces the field city on res partner.
+    """,
+    "website": "http://www.vauxoo.com/";,
+    "license": "AGPL-3",
+    "depends": [
+        "base",
+    ],
+    "init_xml": [],
+    "demo_xml": [],
+    "update_xml": [
+        'res_city_view.xml',
+        'res_partner_view.xml',
+        'security/city_security.xml',
+        'security/ir.model.access.csv',
+    ],
+    "installable": True,
+    "active": False,
+}

=== added directory 'city/i18n'
=== added file 'city/i18n/city.pot'
--- city/i18n/city.pot	1970-01-01 00:00:00 +0000
+++ city/i18n/city.pot	2013-12-11 21:08:57 +0000
@@ -0,0 +1,62 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* city
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-12-11 21:05+0000\n"
+"PO-Revision-Date: 2013-12-11 21:05+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: city
+#: view:res.country.city:0
+msgid "City"
+msgstr ""
+
+#. module: city
+#: view:res.partner:0
+msgid "onchange_city(city)"
+msgstr ""
+
+#. module: city
+#: field:res.country.city,name:0
+msgid "Name"
+msgstr ""
+
+#. module: city
+#: field:res.country.city,country_id:0
+msgid "Country"
+msgstr ""
+
+#. module: city
+#: model:res.groups,name:city.group_res_country_city_manager
+msgid "City Manager"
+msgstr ""
+
+#. module: city
+#: help:res.country.city,name:0
+msgid "Administrative divisions of a country."
+msgstr ""
+
+#. module: city
+#: model:ir.model,name:city.model_res_partner
+msgid "Partner"
+msgstr ""
+
+#. module: city
+#: model:ir.actions.act_window,name:city.action_country_city
+#: model:ir.ui.menu,name:city.menu_country_city_partner
+msgid "Cities"
+msgstr ""
+
+#. module: city
+#: model:ir.model,name:city.model_res_country_city
+msgid "Country city"
+msgstr ""

=== added file 'city/i18n/es.po'
--- city/i18n/es.po	1970-01-01 00:00:00 +0000
+++ city/i18n/es.po	2013-12-11 21:08:57 +0000
@@ -0,0 +1,70 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* city
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-02-22 16:20+0000\n"
+"PO-Revision-Date: 2013-02-22 10:21-0600\n"
+"Last-Translator: Isaac Lopez <isaac@xxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: city
+#: view:res.country.state.city:0
+#: field:res.partner,city_id:0
+msgid "City"
+msgstr "Ciudad"
+
+#. module: city
+#: help:res.country.state.city,name:0
+msgid "Administrative divisions of a state."
+msgstr "División administrativa de un estado"
+
+#. module: city
+#: field:res.country.state.city,name:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: city
+#: model:ir.model,name:city.model_res_country_state_city
+msgid "Country state city"
+msgstr "Pais-estado-ciudad"
+
+#. module: city
+#: field:res.country.state.city,country_id:0
+msgid "Country"
+msgstr "Pais"
+
+#. module: city
+#: field:res.country.state.city,code:0
+msgid "City Code"
+msgstr "Código de Ciudad"
+
+#. module: city
+#: view:res.country.state.city:0
+#: field:res.country.state.city,state_id:0
+msgid "State"
+msgstr "Estado"
+
+#. module: city
+#: help:res.country.state.city,code:0
+msgid "The city code in max. five chars."
+msgstr "Código de la ciudad, máximo 5 caracteres"
+
+#. module: city
+#: model:ir.model,name:city.model_res_partner
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: city
+#: model:ir.actions.act_window,name:city.action_country_state_city
+#: model:ir.ui.menu,name:city.menu_country_state_city_partner
+msgid "Cities"
+msgstr "Ciudades"
+

=== added file 'city/i18n/es_MX.po'
--- city/i18n/es_MX.po	1970-01-01 00:00:00 +0000
+++ city/i18n/es_MX.po	2013-12-11 21:08:57 +0000
@@ -0,0 +1,16 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* city
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-02-22 16:20+0000\n"
+"PO-Revision-Date: 2013-02-22 10:21-0600\n"
+"Last-Translator: Isaac Lopez <isaac@xxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"

=== added file 'city/i18n/es_VE.po'
--- city/i18n/es_VE.po	1970-01-01 00:00:00 +0000
+++ city/i18n/es_VE.po	2013-12-11 21:08:57 +0000
@@ -0,0 +1,16 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* city
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-02-22 16:20+0000\n"
+"PO-Revision-Date: 2013-02-22 10:21-0600\n"
+"Last-Translator: Isaac Lopez <isaac@xxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"

=== added file 'city/i18n/fr.po'
--- city/i18n/fr.po	1970-01-01 00:00:00 +0000
+++ city/i18n/fr.po	2013-12-11 21:08:57 +0000
@@ -0,0 +1,63 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# 	* city
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-12-11 21:05+0000\n"
+"PO-Revision-Date: 2013-12-11 16:08-0500\n"
+"Last-Translator: Sandy Carter <sandy.carter@xxxxxxxxxxxxxxxxxxxx>\n"
+"Language-Team: \n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.7\n"
+
+#. module: city
+#: view:res.country.city:0
+msgid "City"
+msgstr "Ville"
+
+#. module: city
+#: view:res.partner:0
+msgid "onchange_city(city)"
+msgstr ""
+
+#. module: city
+#: field:res.country.city,name:0
+msgid "Name"
+msgstr "Nom"
+
+#. module: city
+#: field:res.country.city,country_id:0
+msgid "Country"
+msgstr "Pays"
+
+#. module: city
+#: model:res.groups,name:city.group_res_country_city_manager
+msgid "City Manager"
+msgstr "Gestionnaire de villes"
+
+#. module: city
+#: help:res.country.city,name:0
+msgid "Administrative divisions of a country."
+msgstr "Division administrative d'un pays."
+
+#. module: city
+#: model:ir.model,name:city.model_res_partner
+msgid "Partner"
+msgstr "Partenaire"
+
+#. module: city
+#: model:ir.actions.act_window,name:city.action_country_city
+#: model:ir.ui.menu,name:city.menu_country_city_partner
+msgid "Cities"
+msgstr "Villes"
+
+#. module: city
+#: model:ir.model,name:city.model_res_country_city
+msgid "Country city"
+msgstr "Pays de la ville"

=== added file 'city/res_city.py'
--- city/res_city.py	1970-01-01 00:00:00 +0000
+++ city/res_city.py	2013-12-11 21:08:57 +0000
@@ -0,0 +1,46 @@
+# -*- encoding: utf-8 -*-
+###########################################################################
+#    Module Writen to OpenERP, Open Source Management Solution
+#
+#    Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/
+#    All Rights Reserved.
+#    info Vauxoo (info@xxxxxxxxxx)
+############################################################################
+#    Coded by: moylop260 (moylop260@xxxxxxxxxx)
+#              Isaac Lopez (isaac@xxxxxxxxxx)
+############################################################################
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import osv, fields
+from openerp import tools
+from openerp.tools.translate import _
+
+import math
+import re
+import logging
+from lxml import etree
+
+
+class res_country_city(osv.Model):
+    _description = "Country city"
+    _name = 'res.country.city'
+    _columns = {
+        'name': fields.char('Name', size=64, required=True, select=True,
+                            help='Administrative divisions of a country.'),
+        'country_id': fields.many2one('res.country', string='Country', required=True),
+    }
+    _order = 'name'

=== added file 'city/res_city_view.xml'
--- city/res_city_view.xml	1970-01-01 00:00:00 +0000
+++ city/res_city_view.xml	2013-12-11 21:08:57 +0000
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <!--
+          City
+        -->
+
+        <record id="view_country_city_tree" model="ir.ui.view">
+            <field name="name">res.country.city.tree</field>
+            <field name="model">res.country.city</field>
+            <field name="arch" type="xml">
+                <tree string="City">
+                    <field name="name"/>
+                    <field name="country_id"/>
+                </tree>
+            </field>
+        </record>
+
+        <record id="view_country_city_form" model="ir.ui.view">
+            <field name="name">res.country.city.form</field>
+            <field name="model">res.country.city</field>
+            <field name="arch" type="xml">
+                <form string="City" version="7.0">
+                    <group>
+                        <field name="name"/>
+                        <field name="country_id"/>
+                    </group>
+                </form>
+            </field>
+        </record>
+
+        <record id="action_country_city" model="ir.actions.act_window">
+            <field name="name">Cities</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">res.country.city</field>
+            <field name="view_type">form</field>
+            <field name="view_id" ref="view_country_city_tree"/>
+        </record>
+
+          <menuitem action="action_country_city" id="menu_country_city_partner" parent="base.menu_localisation" sequence="1" groups="base.group_no_one"/>
+    </data>
+</openerp>

=== added file 'city/res_partner.py'
--- city/res_partner.py	1970-01-01 00:00:00 +0000
+++ city/res_partner.py	2013-12-11 21:08:57 +0000
@@ -0,0 +1,59 @@
+# -*- encoding: utf-8 -*-
+###########################################################################
+#    Module Writen to OpenERP, Open Source Management Solution
+#
+#    Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
+#    All Rights Reserved.
+#    info Vauxoo (info@xxxxxxxxxx)
+############################################################################
+#    Coded by: moylop260 (moylop260@xxxxxxxxxx)
+#              Julio Serna (julio@xxxxxxxxxx)
+#              Isaac Lopez (isaac@xxxxxxxxxx)
+############################################################################
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import orm, fields
+
+
+class res_partner(orm.BaseModel):
+    _inherit = 'res.partner'
+
+    _columns = {
+        'city': fields.many2one('res.country.city', 'City'),
+    }
+
+    def fields_view_get(self, cr, user, view_id=None, view_type='form',
+                        context=None, toolbar=False, submenu=False):
+        if (not view_id and view_type == 'form' and context
+                and context.get('force_email', False)):
+            view_id = self.pool.get('ir.model.data').get_object_reference(
+                cr, user, 'base', 'res_partner_form_city_01')[1]
+        res = super(res_partner, self).fields_view_get(
+            cr, user, view_id, view_type, context, toolbar=toolbar,
+            submenu=submenu)
+        if view_type == 'form':
+            res['arch'] = self.fields_view_get_address(
+                cr, user, res['arch'], context=context)
+        return res
+
+    def onchange_city(self, cr, uid, ids, city, context=None):
+        return {
+            'value': {
+                'country_id': self.pool.get('res.country.city').browse(
+                    cr, uid, city, context=context).country_id.id
+            }
+        } if city else {}

=== added file 'city/res_partner_view.xml'
--- city/res_partner_view.xml	1970-01-01 00:00:00 +0000
+++ city/res_partner_view.xml	2013-12-11 21:08:57 +0000
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record  model="ir.ui.view" id="res_partner_form_city_01">
+            <field name="name">res.partner.form_city_01</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_partner_form"/>
+            <field name="arch" type="xml">
+                
+                <field  name='city' position="attributes">
+                    <attribute name="on_change">onchange_city(city)</attribute>
+                </field>
+
+            </field>
+        </record>
+
+    </data>
+</openerp>
+

=== added directory 'city/security'
=== added file 'city/security/city_security.xml'
--- city/security/city_security.xml	1970-01-01 00:00:00 +0000
+++ city/security/city_security.xml	2013-12-11 21:08:57 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        
+        <record model="res.groups" id="group_res_country_city_manager">
+            <field name="name">City Manager</field>
+        </record>
+        
+    </data>
+</openerp>

=== added file 'city/security/ir.model.access.csv'
--- city/security/ir.model.access.csv	1970-01-01 00:00:00 +0000
+++ city/security/ir.model.access.csv	2013-12-11 21:08:57 +0000
@@ -0,0 +1,3 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_res_country_city_manager,res_country_city_manager,model_res_country_city,group_res_country_city_manager,1,1,1,1
+access_res_country_city_user,res_country_city_user,model_res_country_city,,1,0,0,0


References