[REF] crm_lead: noew independant from res.partner. Added required fields.

bzr revid: tde@openerp.com-20120628140516-08ynh9mvnc5k8etk
This commit is contained in:
Thibault Delavallée 2012-06-28 16:05:16 +02:00
parent 657c20f671
commit 8ab9df4b6a
1 changed files with 16 additions and 1 deletions

View File

@ -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 = {