From d1eb5e6eaeea968a02b44c1981a18052c6602692 Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Thu, 23 Feb 2012 18:00:59 +0530 Subject: [PATCH 01/17] [IMP]base_address: add module bzr revid: kjo@tinyerp.com-20120223123059-04d0obj53i80z0jq --- addons/base_address/__init__.py | 24 +++++++++++++++++ addons/base_address/__openerp__.py | 42 +++++++++++++++++++++++++++++ addons/base_address/base_address.py | 29 ++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 addons/base_address/__init__.py create mode 100644 addons/base_address/__openerp__.py create mode 100644 addons/base_address/base_address.py diff --git a/addons/base_address/__init__.py b/addons/base_address/__init__.py new file mode 100644 index 00000000000..c4af73d2bb7 --- /dev/null +++ b/addons/base_address/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2012 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +import base_address + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_address/__openerp__.py b/addons/base_address/__openerp__.py new file mode 100644 index 00000000000..1abf12a3597 --- /dev/null +++ b/addons/base_address/__openerp__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2012 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +{ + "name": "base address", + "version": "1.0", + "depends": ["base"], + 'complexity': "easy", + 'description': """ +backwards compatible + """, + "author": "OpenERP SA", + 'category': 'Hidden/Dependency', + 'website': 'http://www.openerp.com', + "init_xml": [], + "demo_xml": [], + "update_xml": [], + "test" : [], + "installable": True, + "auto_install": False, + 'images': [], +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_address/base_address.py b/addons/base_address/base_address.py new file mode 100644 index 00000000000..ddfb4e6572f --- /dev/null +++ b/addons/base_address/base_address.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2012 Tiny SPRL (). +# +# 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 . +# +############################################################################## + +from osv import fields, osv + +class res_partner_address(osv.osv): + _name = "res.partner.address" + _table = "res.partner" + _columns= { + } +res_partner_address() From d39fca9edd4054f0870362ac6a175d28bcea96a0 Mon Sep 17 00:00:00 2001 From: "Bhumika (OpenERP)" Date: Mon, 27 Feb 2012 14:00:38 +0530 Subject: [PATCH 02/17] [REM]: remove base_address module bzr revid: sbh@tinyerp.com-20120227083038-s8cli99znrggf7bu --- addons/base_address/__init__.py | 24 ----------------- addons/base_address/__openerp__.py | 42 ----------------------------- addons/base_address/base_address.py | 29 -------------------- 3 files changed, 95 deletions(-) delete mode 100644 addons/base_address/__init__.py delete mode 100644 addons/base_address/__openerp__.py delete mode 100644 addons/base_address/base_address.py diff --git a/addons/base_address/__init__.py b/addons/base_address/__init__.py deleted file mode 100644 index c4af73d2bb7..00000000000 --- a/addons/base_address/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2012 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -import base_address - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_address/__openerp__.py b/addons/base_address/__openerp__.py deleted file mode 100644 index 1abf12a3597..00000000000 --- a/addons/base_address/__openerp__.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2012 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -{ - "name": "base address", - "version": "1.0", - "depends": ["base"], - 'complexity': "easy", - 'description': """ -backwards compatible - """, - "author": "OpenERP SA", - 'category': 'Hidden/Dependency', - 'website': 'http://www.openerp.com', - "init_xml": [], - "demo_xml": [], - "update_xml": [], - "test" : [], - "installable": True, - "auto_install": False, - 'images': [], -} - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_address/base_address.py b/addons/base_address/base_address.py deleted file mode 100644 index ddfb4e6572f..00000000000 --- a/addons/base_address/base_address.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2012 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -from osv import fields, osv - -class res_partner_address(osv.osv): - _name = "res.partner.address" - _table = "res.partner" - _columns= { - } -res_partner_address() From 92015be2766bf3d3e5d86478f4fd0c73de4d5e86 Mon Sep 17 00:00:00 2001 From: "Bhumika (OpenERP)" Date: Mon, 27 Feb 2012 14:16:11 +0530 Subject: [PATCH 03/17] [Fix] account: fix field name in yml bzr revid: sbh@tinyerp.com-20120227084611-29mx3m5awxivoa8i --- addons/account/account_pre_install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_pre_install.yml b/addons/account/account_pre_install.yml index 13adbe8108f..744a8c4bc99 100644 --- a/addons/account/account_pre_install.yml +++ b/addons/account/account_pre_install.yml @@ -7,8 +7,8 @@ wiz = wizards.browse(cr, uid, ref('account.account_configuration_installer_todo')) part = self.pool.get('res.partner').browse(cr, uid, ref('base.main_partner')) # if we know the country and the wizard has not yet been executed, we do it - if (part.country.id) and (wiz.state=='open'): - mod = 'l10n_'+part.country.code.lower() + if (part.country_id.id) and (wiz.state=='open'): + mod = 'l10n_'+part.country_id.co7de.lower() ids = modules.search(cr, uid, [ ('name','=',mod) ], context=context) if ids: wizards.write(cr, uid, [ref('account.account_configuration_installer_todo')], { From 8d95a3fb832aaa30668a8d1b9dd342c6d8e6332b Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Wed, 29 Feb 2012 17:12:58 +0530 Subject: [PATCH 04/17] [IMP] sale: remove contact address bzr revid: kjo@tinyerp.com-20120229114258-fotdotegzhqbcfb4 --- addons/sale/edi/sale_order.py | 6 +++--- addons/sale/report/sale_order.rml | 6 +++--- addons/sale/sale.py | 10 +++++----- addons/sale/sale_demo.xml | 14 +++++++------- addons/sale/sale_view.xml | 4 ++-- addons/sale/stock.py | 1 - addons/sale/test/edi_sale_order.yml | 3 +-- addons/sale/wizard/sale_make_invoice_advance.py | 1 - 8 files changed, 21 insertions(+), 24 deletions(-) diff --git a/addons/sale/edi/sale_order.py b/addons/sale/edi/sale_order.py index d40d0b613ed..2d9f7ae1778 100644 --- a/addons/sale/edi/sale_order.py +++ b/addons/sale/edi/sale_order.py @@ -82,7 +82,7 @@ class sale_order(osv.osv, EDIMixin): '__import_module': 'purchase', 'company_address': res_company.edi_export_address(cr, uid, order.company_id, context=context), - 'partner_address': res_partner_address.edi_export(cr, uid, [order.partner_order_id], context=context)[0], + 'partner_address': res_partner_address.edi_export(cr, uid, [order.partner_invoice_id], context=context)[0], 'currency': self.pool.get('res.currency').edi_export(cr, uid, [order.pricelist_id.currency_id], context=context)[0], @@ -120,7 +120,7 @@ class sale_order(osv.osv, EDIMixin): edi_document['partner_id'] = (src_company_id, src_company_name) edi_document.pop('partner_address', False) # ignored address_edi_m2o = self.edi_m2o(cr, uid, partner_address, context=context) - edi_document['partner_order_id'] = address_edi_m2o +# edi_document['partner_order_id'] = address_edi_m2o edi_document['partner_invoice_id'] = address_edi_m2o edi_document['partner_shipping_id'] = address_edi_m2o @@ -219,4 +219,4 @@ class sale_order_line(osv.osv, EDIMixin): edi_doc_list.append(edi_doc) return edi_doc_list -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/report/sale_order.rml b/addons/sale/report/sale_order.rml index 26093c0961f..95b8a74fd03 100644 --- a/addons/sale/report/sale_order.rml +++ b/addons/sale/report/sale_order.rml @@ -173,12 +173,12 @@ [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ o.partner_order_id and display_address(o.partner_order_id) ]] + - Tel. : [[ (o.partner_order_id and o.partner_order_id.phone) or removeParentNode('para') ]] - Fax : [[ (o.partner_order_id and o.partner_order_id.fax) or removeParentNode('para') ]] + TVA : [[ (o.partner_id and o.partner_id.vat) or removeParentNode('para') ]] diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 82bfda7b580..5560fd0de15 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -216,7 +216,7 @@ class sale_order(osv.osv): 'user_id': fields.many2one('res.users', 'Salesman', states={'draft': [('readonly', False)]}, select=True), 'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)]}, required=True, change_default=True, select=True), 'partner_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Invoice address for current sales order."), - 'partner_order_id': fields.many2one('res.partner.address', 'Ordering Contact', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="The name and address of the contact who requested the order or quotation."), +# 'partner_order_id': fields.many2one('res.partner.address', 'Ordering Contact', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="The name and address of the contact who requested the order or quotation."), 'partner_shipping_id': fields.many2one('res.partner.address', 'Shipping Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Shipping address for current sales order."), 'incoterm': fields.many2one('stock.incoterms', 'Incoterm', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), @@ -279,7 +279,7 @@ class sale_order(osv.osv): 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'sale.order'), 'invoice_quantity': 'order', 'partner_invoice_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['invoice'])['invoice'], - 'partner_order_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['contact'])['contact'], +# 'partner_order_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['contact'])['contact'], 'partner_shipping_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['delivery'])['delivery'], } _sql_constraints = [ @@ -347,7 +347,7 @@ class sale_order(osv.osv): def onchange_partner_id(self, cr, uid, ids, part): if not part: - return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'partner_order_id': False, 'payment_term': False, 'fiscal_position': False}} + return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'payment_term': False, 'fiscal_position': False}} addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['delivery', 'invoice', 'contact']) part = self.pool.get('res.partner').browse(cr, uid, part) @@ -357,7 +357,7 @@ class sale_order(osv.osv): dedicated_salesman = part.user_id and part.user_id.id or uid val = { 'partner_invoice_id': addr['invoice'], - 'partner_order_id': addr['contact'], +# 'partner_order_id': addr['contact'], 'partner_shipping_id': addr['delivery'], 'payment_term': payment_term, 'fiscal_position': fiscal_position, @@ -430,7 +430,7 @@ class sale_order(osv.osv): 'partner_id': order.partner_id.id, 'journal_id': journal_ids[0], 'address_invoice_id': order.partner_invoice_id.id, - 'address_contact_id': order.partner_order_id.id, +# 'address_contact_id': order.partner_order_id.id, 'invoice_line': [(6, 0, lines)], 'currency_id': order.pricelist_id.currency_id.id, 'comment': order.note, diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml index 5da496a1c4b..08d06c3c918 100644 --- a/addons/sale/sale_demo.xml +++ b/addons/sale/sale_demo.xml @@ -11,7 +11,7 @@ - + picking procurement Invoice after delivery @@ -68,7 +68,7 @@ - + order postpaid @@ -104,7 +104,7 @@ - + prepaid @@ -137,7 +137,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -237,7 +237,7 @@ - + diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 90d3838f5a0..9c9b3d06fec 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -116,11 +116,11 @@ - + - +
diff --git a/addons/sale/stock.py b/addons/sale/stock.py index f13e512c008..b42ed0c7e5d 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -67,7 +67,6 @@ class stock_picking(osv.osv): """ invoice_vals = super(stock_picking, self)._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context) if picking.sale_id: - invoice_vals['address_contact_id'] = picking.sale_id.partner_order_id.id invoice_vals['address_invoice_id'] = picking.sale_id.partner_invoice_id.id invoice_vals['fiscal_position'] = picking.sale_id.fiscal_position.id invoice_vals['payment_term'] = picking.sale_id.payment_term.id diff --git a/addons/sale/test/edi_sale_order.yml b/addons/sale/test/edi_sale_order.yml index 9a207d9f44e..5de0a6c4778 100644 --- a/addons/sale/test/edi_sale_order.yml +++ b/addons/sale/test/edi_sale_order.yml @@ -4,7 +4,6 @@ !record {model: sale.order, id: sale_order_edi_1}: partner_id: base.res_partner_agrolait partner_invoice_id: base.res_partner_address_8invoice - partner_order_id: base.res_partner_address_8invoice partner_shipping_id: base.res_partner_address_8invoice pricelist_id: 1 order_line: @@ -129,4 +128,4 @@ assert sale_line.price_unit == 100 , "unit price is not same, got %s, expected 100"%(sale_line.price_unit,) assert sale_line.product_uom_qty == 2 , "product qty is not same" else: - raise AssertionError('unknown order line: %s' % sale_line) \ No newline at end of file + raise AssertionError('unknown order line: %s' % sale_line) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index cb9bb2fc5bd..a68280afad0 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -93,7 +93,6 @@ class sale_advance_payment_inv(osv.osv_memory): 'account_id': sale.partner_id.property_account_receivable.id, 'partner_id': sale.partner_id.id, 'address_invoice_id': sale.partner_invoice_id.id, - 'address_contact_id': sale.partner_order_id.id, 'invoice_line': [(6, 0, create_ids)], 'currency_id': sale.pricelist_id.currency_id.id, 'comment': '', From 24521ba5c783aeb8ec7316b6e5194b1f13f7aa33 Mon Sep 17 00:00:00 2001 From: "Bhumika (OpenERP)" Date: Wed, 29 Feb 2012 18:11:42 +0530 Subject: [PATCH 05/17] [Fix] sale,crm: remove res.partner.address bzr revid: sbh@tinyerp.com-20120229124142-bd4zb7ta0fjppr4i --- addons/crm/crm.py | 4 +--- addons/crm/crm_lead.py | 24 ++++++++----------- addons/crm/crm_lead_demo.xml | 13 ---------- addons/crm/crm_lead_view.xml | 6 +---- addons/crm/crm_meeting.py | 2 -- addons/crm/crm_meeting_demo.xml | 6 ----- addons/crm/crm_meeting_view.xml | 4 ---- addons/crm/crm_phonecall.py | 16 ++++--------- addons/crm/crm_phonecall_demo.xml | 4 ---- addons/crm/crm_phonecall_view.xml | 6 +---- addons/crm/res_partner.py | 1 - addons/crm/res_partner_view.xml | 2 +- .../wizard/crm_opportunity_to_phonecall.py | 4 ++-- addons/crm/wizard/crm_phonecall_to_partner.py | 7 +++--- addons/email_template/__openerp__.py | 2 +- addons/sale/edi/sale_order.py | 9 ++++--- addons/sale/edi/sale_order_action_data.xml | 4 ++-- addons/sale/report/sale_order.rml | 4 ++-- addons/sale/sale.py | 7 +++--- addons/sale/sale_demo.xml | 6 ----- addons/sale/sale_unit_test.xml | 6 ++--- addons/sale/sale_view.xml | 1 - addons/sale/test/edi_sale_order.yml | 4 ++-- 23 files changed, 40 insertions(+), 102 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 4ebb0b4796d..d4ffe6cf9ae 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -178,7 +178,6 @@ class crm_base(object): date_closed user_id partner_id - partner_address_id """ def _get_default_partner_address(self, cr, uid, context=None): """Gives id of default address for current user @@ -238,7 +237,7 @@ class crm_base(object): """ data = {'value': {'email_from': False, 'phone':False}} if add: - address = self.pool.get('res.partner.address').browse(cr, uid, add) + address = self.pool.get('res.partner').browse(cr, uid, add) data['value'] = {'email_from': address and address.email or False , 'phone': address and address.phone or False} if 'phone' not in self._columns: @@ -254,7 +253,6 @@ class crm_base(object): data={} if part: addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['contact']) - data = {'partner_address_id': addr['contact']} data.update(self.onchange_partner_address_id(cr, uid, ids, addr['contact'])['value']) return {'value': data} diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index b17fa31ac91..c4de42ce972 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -40,7 +40,7 @@ class crm_lead(crm_case, osv.osv): _name = "crm.lead" _description = "Lead/Opportunity" _order = "priority,date_action,id desc" - _inherit = ['mail.thread','res.partner.address'] + _inherit = ['mail.thread','res.partner'] def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None): access_rights_uid = access_rights_uid or uid @@ -194,7 +194,6 @@ class crm_lead(crm_case, osv.osv): # Only used for type opportunity - 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', domain="[('partner_id','=',partner_id)]"), 'probability': fields.float('Probability (%)',group_operator="avg"), 'planned_revenue': fields.float('Expected Revenue'), 'ref': fields.reference('Reference', selection=crm._links_get, size=128), @@ -205,8 +204,8 @@ class crm_lead(crm_case, osv.osv): 'title_action': fields.char('Next Action', size=64), 'stage_id': fields.many2one('crm.case.stage', 'Stage', domain="[('section_ids', '=', section_id)]"), 'color': fields.integer('Color Index'), - 'partner_address_name': fields.related('partner_address_id', 'name', type='char', string='Partner Contact Name', readonly=True), - 'partner_address_email': fields.related('partner_address_id', 'email', type='char', string='Partner Contact Email', readonly=True), + 'partner_address_name': fields.related('partner_id', 'name', type='char', string='Partner Contact Name', readonly=True), + 'partner_address_email': fields.related('partner_id', 'email', type='char', string='Partner Contact Email', readonly=True), 'company_currency': fields.related('company_id', 'currency_id', 'symbol', type='char', string='Company Currency', readonly=True), 'user_email': fields.related('user_id', 'user_email', type='char', string='User Email', readonly=True), 'user_login': fields.related('user_id', 'login', type='char', string='User Login', readonly=True), @@ -230,7 +229,7 @@ class crm_lead(crm_case, osv.osv): """ if not add: return {'value': {'email_from': False, 'country_id': False}} - address = self.pool.get('res.partner.address').browse(cr, uid, add) + address = self.pool.get('res.partner').browse(cr, uid, add) return {'value': {'email_from': address.email, 'phone': address.phone, 'country_id': address.country_id.id}} def on_change_optin(self, cr, uid, ids, optin): @@ -501,8 +500,7 @@ class crm_lead(crm_case, osv.osv): first_opportunity = opportunities_list[0] tail_opportunities = opportunities_list[1:] - fields = ['partner_id', 'title', 'name', 'categ_id', 'channel_id', 'city', 'company_id', 'contact_name', 'country_id', - 'partner_address_id', 'type_id', 'user_id', 'section_id', 'state_id', 'description', 'email', 'fax', 'mobile', + fields = ['partner_id', 'title', 'name', 'categ_id', 'channel_id', 'city', 'company_id', 'contact_name', 'country_id', 'type_id', 'user_id', 'section_id', 'state_id', 'description', 'email', 'fax', 'mobile', 'partner_name', 'phone', 'probability', 'planned_revenue', 'street', 'street2', 'zip', 'create_date', 'date_action_last', 'date_action_next', 'email_from', 'email_cc', 'partner_name'] @@ -546,7 +544,6 @@ class crm_lead(crm_case, osv.osv): 'stage_id': stage_id or False, 'date_action': time.strftime('%Y-%m-%d %H:%M:%S'), 'date_open': time.strftime('%Y-%m-%d %H:%M:%S'), - 'partner_address_id': contact_id, } def _convert_opportunity_notification(self, cr, uid, lead, context=None): @@ -597,14 +594,14 @@ class crm_lead(crm_case, osv.osv): if partner_id: res_partner.write(cr, uid, partner_id, {'section_id': lead.section_id.id or False}) contact_id = res_partner.address_get(cr, uid, [partner_id])['default'] - res = lead.write({'partner_id' : partner_id, 'partner_address_id': contact_id}, context=context) + res = lead.write({'partner_id' : partner_id, }, context=context) return res def _lead_create_partner_address(self, cr, uid, lead, partner_id, context=None): - address = self.pool.get('res.partner.address') + address = self.pool.get('res.partner') return address.create(cr, uid, { - 'partner_id': partner_id, + 'parent_id': partner_id, 'name': lead.contact_name, 'phone': lead.phone, 'mobile': lead.mobile, @@ -694,9 +691,8 @@ class crm_lead(crm_case, osv.osv): 'date' : schedule_time, 'section_id' : section_id or False, 'partner_id': lead.partner_id and lead.partner_id.id or False, - 'partner_address_id': lead.partner_address_id and lead.partner_address_id.id or False, - 'partner_phone' : phone or lead.phone or (lead.partner_address_id and lead.partner_address_id.phone or False), - 'partner_mobile' : lead.partner_address_id and lead.partner_address_id.mobile or False, + 'partner_phone' : phone or lead.phone or (lead.partner_id and lead.partner_id.phone or False), + 'partner_mobile' : lead.partner_id and lead.partner_id.mobile or False, 'priority': lead.priority, } diff --git a/addons/crm/crm_lead_demo.xml b/addons/crm/crm_lead_demo.xml index 830b572676d..e4d32cdaa13 100644 --- a/addons/crm/crm_lead_demo.xml +++ b/addons/crm/crm_lead_demo.xml @@ -103,7 +103,6 @@ - @@ -240,7 +239,6 @@ - opportunity @@ -256,7 +254,6 @@ - opportunity @@ -307,7 +304,6 @@ opportunity - @@ -332,7 +328,6 @@ opportunity - @@ -353,7 +348,6 @@ - opportunity @@ -372,7 +366,6 @@ - opportunity @@ -397,7 +390,6 @@ - opportunity @@ -426,7 +418,6 @@ - opportunity @@ -450,7 +441,6 @@ - opportunity @@ -473,7 +463,6 @@ - opportunity @@ -496,7 +485,6 @@ - opportunity @@ -509,7 +497,6 @@ - opportunity diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 44d83f47634..36fd9084c74 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -259,7 +259,6 @@ date_start="date_action" color="user_id"> - @@ -479,10 +478,7 @@ string="Create" attrs="{'invisible':[('partner_id','!=',False)]}"/> - +