[FIX]: crm*: Fixed problem of duplicating cases with history and date open/close
lp bug: https://launchpad.net/bugs/615257 fixed bzr revid: rpa@tinyerp.com-20100817125400-je0u3im8x945cxig
This commit is contained in:
parent
37cbc3dc4a
commit
852d148e1d
|
@ -73,6 +73,35 @@ class crm_case(object):
|
|||
return False
|
||||
return user.address_id.partner_id.id
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
"""
|
||||
Overrides orm copy method.
|
||||
@param self: the object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param id: Id of mailgate thread
|
||||
@param default: Dictionary of default values for copy.
|
||||
@param context: A standard dictionary for contextual values
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
if default is None:
|
||||
default = {}
|
||||
|
||||
default.update({
|
||||
'message_ids': [],
|
||||
})
|
||||
if hasattr(self, '_columns'):
|
||||
if self._columns.get('date_closed'):
|
||||
default.update({
|
||||
'date_closed': False,
|
||||
})
|
||||
if self._columns.get('date_open'):
|
||||
default.update({
|
||||
'date_open': False
|
||||
})
|
||||
return super(osv.osv, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def _get_default_email(self, cr, uid, context):
|
||||
"""Gives default email address for current user
|
||||
@param self: The object pointer
|
||||
|
|
|
@ -36,7 +36,7 @@ CRM_LEAD_PENDING_STATES = (
|
|||
crm.AVAILABLE_STATES[4][0], # Pending
|
||||
)
|
||||
|
||||
class crm_lead(osv.osv, crm_case):
|
||||
class crm_lead(crm_case, osv.osv):
|
||||
""" CRM Lead Case """
|
||||
_name = "crm.lead"
|
||||
_description = "Lead"
|
||||
|
|
|
@ -26,18 +26,18 @@ from osv import fields, osv
|
|||
from tools.translate import _
|
||||
import time
|
||||
|
||||
class crm_lead(osv.osv, crm_case):
|
||||
class crm_lead(crm_case, osv.osv):
|
||||
""" CRM Leads """
|
||||
_name = 'crm.lead'
|
||||
crm_lead()
|
||||
|
||||
class crm_phonecall(osv.osv, crm_case):
|
||||
class crm_phonecall(crm_case, osv.osv):
|
||||
""" CRM Phonecall """
|
||||
_name = 'crm.phonecall'
|
||||
crm_phonecall()
|
||||
|
||||
|
||||
class crm_meeting(osv.osv, crm_case):
|
||||
class crm_meeting(crm_case, osv.osv):
|
||||
""" CRM Meeting Cases """
|
||||
|
||||
_name = 'crm.meeting'
|
||||
|
|
|
@ -26,7 +26,7 @@ import crm
|
|||
import time
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
class crm_phonecall(osv.osv, crm_case):
|
||||
class crm_phonecall(crm_case, osv.osv):
|
||||
""" Phonecall Cases """
|
||||
|
||||
_name = "crm.phonecall"
|
||||
|
|
|
@ -23,7 +23,7 @@ from osv import fields, osv
|
|||
from crm import crm
|
||||
import time
|
||||
|
||||
class crm_claim(osv.osv, crm.crm_case):
|
||||
class crm_claim(crm.crm_case, osv.osv):
|
||||
"""
|
||||
Crm claim
|
||||
"""
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
from osv import fields, osv, orm
|
||||
from crm import crm
|
||||
|
||||
class crm_fundraising(osv.osv, crm.crm_case):
|
||||
class crm_fundraising(crm.crm_case, osv.osv):
|
||||
""" Fund Raising Cases """
|
||||
|
||||
_name = "crm.fundraising"
|
||||
|
|
|
@ -23,7 +23,7 @@ from crm import crm
|
|||
from osv import fields, osv
|
||||
import time
|
||||
|
||||
class crm_helpdesk(osv.osv, crm.crm_case):
|
||||
class crm_helpdesk(crm.crm_case, osv.osv):
|
||||
""" Helpdesk Cases """
|
||||
|
||||
_name = "crm.helpdesk"
|
||||
|
|
|
@ -75,7 +75,7 @@ class hr_recruitment_degree(osv.osv):
|
|||
}
|
||||
hr_recruitment_degree()
|
||||
|
||||
class hr_applicant(osv.osv, crm.crm_case):
|
||||
class hr_applicant(crm.crm_case, osv.osv):
|
||||
_name = "hr.applicant"
|
||||
_description = "Applicant"
|
||||
_order = "id desc"
|
||||
|
|
|
@ -34,7 +34,7 @@ from osv.orm import except_orm
|
|||
from tools.translate import _
|
||||
import tools
|
||||
|
||||
class project_issue(osv.osv, crm.crm_case):
|
||||
class project_issue(crm.crm_case, osv.osv):
|
||||
_name = "project.issue"
|
||||
_description = "Project Issue"
|
||||
_order = "priority, id desc"
|
||||
|
|
Loading…
Reference in New Issue