Merge lp:~agilebg/openobject-italia/adding_l10n_it_base_crm into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by Nicola Malcontenti - Agile BG
Status: Merged
Merged at revision: 231
Proposed branch: lp:~agilebg/openobject-italia/adding_l10n_it_base_crm
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 207 lines (+179/-0)
5 files modified
l10n_it_base_crm/__init__.py (+24/-0)
l10n_it_base_crm/__openerp__.py (+45/-0)
l10n_it_base_crm/crm/__init__.py (+24/-0)
l10n_it_base_crm/crm/crm.py (+53/-0)
l10n_it_base_crm/crm/crm_view.xml (+33/-0)
To merge this branch: bzr merge lp:~agilebg/openobject-italia/adding_l10n_it_base_crm
Reviewer Review Type Date Requested Status
Lorenzo Battistini code review Approve
Review via email: mp+194814@code.launchpad.net

Description of the change

Italian Localization module - CRM version

Funcionalities:
- Campi provincia e regione su Lead/Opportunity
- Automatistmi su crm.lead

To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'l10n_it_base_crm'
2=== added file 'l10n_it_base_crm/__init__.py'
3--- l10n_it_base_crm/__init__.py 1970-01-01 00:00:00 +0000
4+++ l10n_it_base_crm/__init__.py 2013-11-12 09:40:55 +0000
5@@ -0,0 +1,24 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
10+# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com>
11+# Copyright (C) 2013 Associazione OpenERP Italia
12+# (<http://www.openerp-italia.org>).
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 published
16+# by the Free Software Foundation, either version 3 of the License, or
17+# (at your option) any later version.
18+#
19+# This program is distributed in the hope that it will be useful,
20+# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+# GNU Affero General Public License for more details.
23+#
24+# You should have received a copy of the GNU Affero General Public License
25+# along with this program. If not, see <http://www.gnu.org/licenses/>.
26+#
27+##############################################################################
28+
29+import crm
30
31=== added file 'l10n_it_base_crm/__openerp__.py'
32--- l10n_it_base_crm/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ l10n_it_base_crm/__openerp__.py 2013-11-12 09:40:55 +0000
34@@ -0,0 +1,45 @@
35+# -*- coding: utf-8 -*-
36+##############################################################################
37+#
38+# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
39+# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com>
40+# Copyright (C) 2013 Associazione OpenERP Italia
41+# (<http://www.openerp-italia.org>).
42+#
43+# This program is free software: you can redistribute it and/or modify
44+# it under the terms of the GNU Affero General Public License as published
45+# by the Free Software Foundation, either version 3 of the License, or
46+# (at your option) any later version.
47+#
48+# This program is distributed in the hope that it will be useful,
49+# but WITHOUT ANY WARRANTY; without even the implied warranty of
50+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51+# GNU Affero General Public License for more details.
52+#
53+# You should have received a copy of the GNU Affero General Public License
54+# along with this program. If not, see <http://www.gnu.org/licenses/>.
55+#
56+##############################################################################
57+
58+{
59+ 'name': "Italian Localisation - CRM",
60+ 'version': '0.1',
61+ 'category': 'Localisation/Italy',
62+ 'description': """Italian Localization module - CRM version
63+
64+Funcionalities:
65+- Campi provincia e regione su Lead/Opportunity
66+- Automatistmi su crm.lead
67+""",
68+ 'author': 'Agile Business Group',
69+ 'website': 'http://www.agilebg.com',
70+ 'license': 'AGPL-3',
71+ "depends": ['crm','l10n_it_base'],
72+ "data": ['crm/crm_view.xml'
73+ ],
74+ "demo": [],
75+ 'test': [
76+ ],
77+ "active": False,
78+ "installable": True
79+}
80\ No newline at end of file
81
82=== added directory 'l10n_it_base_crm/crm'
83=== added file 'l10n_it_base_crm/crm/__init__.py'
84--- l10n_it_base_crm/crm/__init__.py 1970-01-01 00:00:00 +0000
85+++ l10n_it_base_crm/crm/__init__.py 2013-11-12 09:40:55 +0000
86@@ -0,0 +1,24 @@
87+# -*- coding: utf-8 -*-
88+##############################################################################
89+#
90+# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
91+# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com>
92+# Copyright (C) 2013 Associazione OpenERP Italia
93+# (<http://www.openerp-italia.org>).
94+#
95+# This program is free software: you can redistribute it and/or modify
96+# it under the terms of the GNU Affero General Public License as published
97+# by the Free Software Foundation, either version 3 of the License, or
98+# (at your option) any later version.
99+#
100+# This program is distributed in the hope that it will be useful,
101+# but WITHOUT ANY WARRANTY; without even the implied warranty of
102+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
103+# GNU Affero General Public License for more details.
104+#
105+# You should have received a copy of the GNU Affero General Public License
106+# along with this program. If not, see <http://www.gnu.org/licenses/>.
107+#
108+##############################################################################
109+
110+import crm
111
112=== added file 'l10n_it_base_crm/crm/crm.py'
113--- l10n_it_base_crm/crm/crm.py 1970-01-01 00:00:00 +0000
114+++ l10n_it_base_crm/crm/crm.py 2013-11-12 09:40:55 +0000
115@@ -0,0 +1,53 @@
116+# -*- coding: utf-8 -*-
117+##############################################################################
118+#
119+# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
120+# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com>
121+# Copyright (C) 2013 Associazione OpenERP Italia
122+# (<http://www.openerp-italia.org>).
123+#
124+# This program is free software: you can redistribute it and/or modify
125+# it under the terms of the GNU Affero General Public License as published
126+# by the Free Software Foundation, either version 3 of the License, or
127+# (at your option) any later version.
128+#
129+# This program is distributed in the hope that it will be useful,
130+# but WITHOUT ANY WARRANTY; without even the implied warranty of
131+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
132+# GNU Affero General Public License for more details.
133+#
134+# You should have received a copy of the GNU Affero General Public License
135+# along with this program. If not, see <http://www.gnu.org/licenses/>.
136+#
137+##############################################################################
138+
139+from openerp.osv import orm
140+from openerp.osv import fields
141+
142+
143+class crm_lead(orm.Model):
144+ _inherit = 'crm.lead'
145+
146+ def on_change_city(self, cr, uid, ids, city):
147+ return self.pool.get('res.partner').on_change_city(cr, uid, ids, city)
148+
149+ def _lead_create_contact(self, cr, uid, lead, name, is_company,
150+ parent_id=False, context=None):
151+ if lead:
152+ partner_id = super(crm_lead, self)._lead_create_contact(
153+ cr, uid, lead, name, is_company,
154+ parent_id=parent_id, context=context
155+ )
156+ if partner_id:
157+ partner = self.pool.get('res.partner')
158+ vals = {
159+ 'province': lead.province.id,
160+ 'region': lead.region.id,
161+ }
162+ partner.write(cr, uid, partner_id, vals, context=context)
163+ return partner_id
164+
165+ _columns = {
166+ 'province': fields.many2one('res.province', string='Provincia'),
167+ 'region': fields.many2one('res.region', string='Region'),
168+ }
169
170=== added file 'l10n_it_base_crm/crm/crm_view.xml'
171--- l10n_it_base_crm/crm/crm_view.xml 1970-01-01 00:00:00 +0000
172+++ l10n_it_base_crm/crm/crm_view.xml 2013-11-12 09:40:55 +0000
173@@ -0,0 +1,33 @@
174+<?xml version="1.0" ?>
175+<openerp>
176+ <data>
177+
178+ <record model="ir.ui.view" id="view_lead_form_inherit_province">
179+ <field name="name">lead.form.province</field>
180+ <field name="model">crm.lead</field>
181+ <field name="inherit_id" ref="crm.crm_case_form_view_leads"/>
182+ <field name="type">form</field>
183+ <field name="arch" type="xml">
184+ <field name="country_id" position="before">
185+ <div class="province_format">
186+ <field name="province" placeholder="Province" select="2"/>
187+ <field name="region" placeholder="Region"/>
188+ </div>
189+ </field>
190+ </field>
191+ </record>
192+
193+ <record model="ir.ui.view" id="view_lead_form_inherit_city">
194+ <field name="name">lead.form.city</field>
195+ <field name="model">crm.lead</field>
196+ <field name="inherit_id" ref="crm.crm_case_form_view_leads"/>
197+ <field name="type">form</field>
198+ <field name="arch" type="xml">
199+ <field name="city" position="replace" >
200+ <field name="city" placeholder="City" style="width: 70%%" on_change="on_change_city(city)"/>
201+ </field>
202+ </field>
203+ </record>
204+
205+ </data>
206+</openerp>
207\ No newline at end of file

Subscribers

People subscribed via source and target branches