[FIX] Fixed method missing due to crm_base / crm_case separation; fixed a strange bug with a yml test in crm_lead (must be investigated); fixed a data file called twice.
bzr revid: tde@openerp.com-20120523162903-hc7oewrx2twzs6u4
This commit is contained in:
@@ -66,7 +66,6 @@ Creates a dashboard for CRM that includes:
|
||||
],
|
||||
'init_xml': [
|
||||
'crm_data.xml',
|
||||
'crm_meeting_data.xml',
|
||||
'crm_lead_data.xml',
|
||||
'crm_meeting_data.xml',
|
||||
'crm_phonecall_data.xml',
|
||||
|
||||
@@ -189,6 +189,31 @@ class crm_base(object):
|
||||
- ``state`` (selection field)
|
||||
"""
|
||||
|
||||
def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
|
||||
""" This function returns value of partner email based on Partner Address
|
||||
:param add: Id of Partner's address
|
||||
:param email: Partner's email ID
|
||||
"""
|
||||
data = {'value': {'email_from': False, 'phone':False}}
|
||||
if 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:
|
||||
del data['value']['phone']
|
||||
return data
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part, email=False):
|
||||
""" This function returns value of partner address based on partner
|
||||
:param part: Partner's id
|
||||
:param email: Partner's email ID
|
||||
"""
|
||||
data={}
|
||||
if part:
|
||||
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['contact'])
|
||||
data.update(self.onchange_partner_address_id(cr, uid, ids, addr['contact'])['value'])
|
||||
return {'value': data}
|
||||
|
||||
def case_open(self, cr, uid, ids, context=None):
|
||||
""" Opens case """
|
||||
cases = self.browse(cr, uid, ids, context=context)
|
||||
|
||||
@@ -20,12 +20,16 @@
|
||||
##############################################################################
|
||||
|
||||
from base_calendar import base_calendar
|
||||
from crm import crm_base
|
||||
from crm import crm_base, crm_case
|
||||
import logging
|
||||
from osv import fields, osv
|
||||
import tools
|
||||
from tools.translate import _
|
||||
|
||||
class crm_lead(crm_case, osv.osv):
|
||||
""" CRM Leads """
|
||||
_name = 'crm.lead'
|
||||
|
||||
class crm_meeting(crm_base, osv.Model):
|
||||
""" Model for CRM meetings """
|
||||
_name = 'crm.meeting'
|
||||
|
||||
Reference in New Issue
Block a user