Nicola Malcontenti - Agile BG has proposed merging lp:~agilebg/openobject-italia/adding_l10n_it_base_crm into lp:openobject-italia/7.0.
Requested reviews: OpenERP Italia core devs (openobject-italia-core-devs) For more details, see: https://code.launchpad.net/~agilebg/openobject-italia/adding_l10n_it_base_crm/+merge/194814 Italian Localization module - CRM version Funcionalities: - Campi provincia e regione su Lead/Opportunity - Automatistmi su crm.lead -- https://code.launchpad.net/~agilebg/openobject-italia/adding_l10n_it_base_crm/+merge/194814 Your team OpenERP Italia core devs is requested to review the proposed merge of lp:~agilebg/openobject-italia/adding_l10n_it_base_crm into lp:openobject-italia/7.0.
=== added directory 'l10n_it_base_crm' === added file 'l10n_it_base_crm/__init__.py' --- l10n_it_base_crm/__init__.py 1970-01-01 00:00:00 +0000 +++ l10n_it_base_crm/__init__.py 2013-11-12 09:40:55 +0000 @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) +# Author: Nicola Malcontenti <[email protected]> +# Copyright (C) 2013 Associazione OpenERP Italia +# (<http://www.openerp-italia.org>). +# +# 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 crm === added file 'l10n_it_base_crm/__openerp__.py' --- l10n_it_base_crm/__openerp__.py 1970-01-01 00:00:00 +0000 +++ l10n_it_base_crm/__openerp__.py 2013-11-12 09:40:55 +0000 @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) +# Author: Nicola Malcontenti <[email protected]> +# Copyright (C) 2013 Associazione OpenERP Italia +# (<http://www.openerp-italia.org>). +# +# 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': "Italian Localisation - CRM", + 'version': '0.1', + 'category': 'Localisation/Italy', + 'description': """Italian Localization module - CRM version + +Funcionalities: +- Campi provincia e regione su Lead/Opportunity +- Automatistmi su crm.lead +""", + 'author': 'Agile Business Group', + 'website': 'http://www.agilebg.com', + 'license': 'AGPL-3', + "depends": ['crm','l10n_it_base'], + "data": ['crm/crm_view.xml' + ], + "demo": [], + 'test': [ + ], + "active": False, + "installable": True +} \ No newline at end of file === added directory 'l10n_it_base_crm/crm' === added file 'l10n_it_base_crm/crm/__init__.py' --- l10n_it_base_crm/crm/__init__.py 1970-01-01 00:00:00 +0000 +++ l10n_it_base_crm/crm/__init__.py 2013-11-12 09:40:55 +0000 @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) +# Author: Nicola Malcontenti <[email protected]> +# Copyright (C) 2013 Associazione OpenERP Italia +# (<http://www.openerp-italia.org>). +# +# 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 crm === added file 'l10n_it_base_crm/crm/crm.py' --- l10n_it_base_crm/crm/crm.py 1970-01-01 00:00:00 +0000 +++ l10n_it_base_crm/crm/crm.py 2013-11-12 09:40:55 +0000 @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) +# Author: Nicola Malcontenti <[email protected]> +# Copyright (C) 2013 Associazione OpenERP Italia +# (<http://www.openerp-italia.org>). +# +# 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 +from openerp.osv import fields + + +class crm_lead(orm.Model): + _inherit = 'crm.lead' + + def on_change_city(self, cr, uid, ids, city): + return self.pool.get('res.partner').on_change_city(cr, uid, ids, city) + + def _lead_create_contact(self, cr, uid, lead, name, is_company, + parent_id=False, context=None): + if lead: + partner_id = super(crm_lead, self)._lead_create_contact( + cr, uid, lead, name, is_company, + parent_id=parent_id, context=context + ) + if partner_id: + partner = self.pool.get('res.partner') + vals = { + 'province': lead.province.id, + 'region': lead.region.id, + } + partner.write(cr, uid, partner_id, vals, context=context) + return partner_id + + _columns = { + 'province': fields.many2one('res.province', string='Provincia'), + 'region': fields.many2one('res.region', string='Region'), + } === added file 'l10n_it_base_crm/crm/crm_view.xml' --- l10n_it_base_crm/crm/crm_view.xml 1970-01-01 00:00:00 +0000 +++ l10n_it_base_crm/crm/crm_view.xml 2013-11-12 09:40:55 +0000 @@ -0,0 +1,33 @@ +<?xml version="1.0" ?> +<openerp> + <data> + + <record model="ir.ui.view" id="view_lead_form_inherit_province"> + <field name="name">lead.form.province</field> + <field name="model">crm.lead</field> + <field name="inherit_id" ref="crm.crm_case_form_view_leads"/> + <field name="type">form</field> + <field name="arch" type="xml"> + <field name="country_id" position="before"> + <div class="province_format"> + <field name="province" placeholder="Province" select="2"/> + <field name="region" placeholder="Region"/> + </div> + </field> + </field> + </record> + + <record model="ir.ui.view" id="view_lead_form_inherit_city"> + <field name="name">lead.form.city</field> + <field name="model">crm.lead</field> + <field name="inherit_id" ref="crm.crm_case_form_view_leads"/> + <field name="type">form</field> + <field name="arch" type="xml"> + <field name="city" position="replace" > + <field name="city" placeholder="City" style="width: 70%%" on_change="on_change_city(city)"/> + </field> + </field> + </record> + + </data> +</openerp> \ No newline at end of file
_______________________________________________ Mailing list: https://launchpad.net/~openobject-italia-core-devs Post to : [email protected] Unsubscribe : https://launchpad.net/~openobject-italia-core-devs More help : https://help.launchpad.net/ListHelp

