[IMP]:Add menu,spelling correction,set sender name for object
bzr revid: ksa@tinyerp.co.in-20100706120155-ggpmp4gv2es5g23s
This commit is contained in:
parent
680c1231bd
commit
d59d7fd9ff
|
@ -1,7 +1,7 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
|
@ -81,17 +81,17 @@ class tinythunderbird_partner(osv.osv):
|
|||
'date': lambda *a: time.strftime('%Y-%m-%d')
|
||||
}
|
||||
|
||||
def thunderbird_mailcreate(self,cr,user,vals):
|
||||
def thunderbird_mailcreate(self,cr,user,vals):
|
||||
dictcreate = dict(vals)
|
||||
import email
|
||||
header_name = email.Header.decode_header(dictcreate['name'])
|
||||
dictcreate['name'] = header_name and header_name[0] and header_name[0][0]
|
||||
dictcreate['name'] = header_name and header_name[0] and header_name[0][0]
|
||||
add_obj=self.pool.get('res.partner.address')
|
||||
case_pool=self.pool.get(dictcreate.get('object','crm.case'))
|
||||
partner_ids=add_obj.search(cr,user,[('email','=',dictcreate['email_from'])])
|
||||
partner=add_obj.read(cr,user,partner_ids,['partner_id'])
|
||||
partner=add_obj.read(cr,user,partner_ids,['partner_id','name'])
|
||||
if partner and partner[0] and partner[0]['partner_id']:
|
||||
dictcreate.update({'partner_id':partner[0]['partner_id'][0]})
|
||||
dictcreate.update({'partner_id':partner[0]['partner_id'][0],'partner_name':partner[0]['name']})
|
||||
create_id = case_pool.create(cr, user, dictcreate)
|
||||
cases=case_pool.browse(cr,user,[create_id])
|
||||
case_pool._history(cr, user, cases, _('Archive'), history=True, email=False)
|
||||
|
@ -198,7 +198,7 @@ class tinythunderbird_partner(osv.osv):
|
|||
return super(tinythunderbird_partner, self).unlink(cr, uid, ids,context)
|
||||
|
||||
def thunderbird_objectsearch(self,cr,user,vals):
|
||||
obj_list= [('crm.claim', 'Claim'), ('crm.lead','Lead'), ('crm.meeting','Metting'), ('crm.opportunity','Opportunity'), ('crm.phonecall','Phonecall'), ('crm.fundraising','Fund raising'), ('crm.helpdesk','Helpdesk')]
|
||||
obj_list= [('crm.lead','Lead'),('project.issue','Project Issue'), ('hr.applicant','HR Recruitment')]
|
||||
object=[]
|
||||
model_obj = self.pool.get('ir.model')
|
||||
for obj in obj_list:
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue