From 8ab9df4b6acedc78963e304cdd3955a6594a9fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 28 Jun 2012 16:05:16 +0200 Subject: [PATCH] [REF] crm_lead: noew independant from res.partner. Added required fields. bzr revid: tde@openerp.com-20120628140516-08ynh9mvnc5k8etk --- addons/crm/crm_lead.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index fa4643db156..5f5d19dde01 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -40,7 +40,7 @@ class crm_lead(base_stage, osv.osv): _name = "crm.lead" _description = "Lead/Opportunity" _order = "priority,date_action,id desc" - _inherit = ['ir.needaction_mixin', 'mail.thread','res.partner'] + _inherit = ['ir.needaction_mixin', 'mail.thread'] def _get_default_section_id(self, cr, uid, context=None): """ Gives default section by checking if present in the context """ @@ -245,6 +245,21 @@ class crm_lead(base_stage, osv.osv): '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), + + # Fields for address, due to separation from crm and res.partner + 'street': fields.char('Street', size=128), + 'street2': fields.char('Street2', size=128), + 'zip': fields.char('Zip', change_default=True, size=24), + 'city': fields.char('City', size=128), + 'state_id': fields.many2one("res.country.state", 'State', domain="[('country_id','=',country_id)]"), + 'country_id': fields.many2one('res.country', 'Country'), + 'country': fields.related('country_id', type='many2one', relation='res.country', string='Country'), # for backward compatibility + 'phone': fields.char('Phone', size=64), + 'fax': fields.char('Fax', size=64), + 'mobile': fields.char('Mobile', size=64), + 'function': fields.char('Function', size=128), + 'title': fields.many2one('res.partner.title','Title'), + 'company_id': fields.many2one('res.company', 'Company', select=1), } _defaults = {