openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #04506
[Merge] lp:~openerp-dev/openobject-addons/trunk-crm_improvement-uco into lp:~openerp-dev/openobject-addons/trunk-openerp_crm_imp
tfr (Openerp) has proposed merging lp:~openerp-dev/openobject-addons/trunk-crm_improvement-uco into lp:~openerp-dev/openobject-addons/trunk-openerp_crm_imp.
Requested reviews:
OpenERP buildbot (openerp-buildbot)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-crm_improvement-uco/+merge/54483
[IMP] crm (Leads/Opportunities):
---------------------------------------------------
* [REF] Removed repeated code.
* [FIX] Solves the issue with web-client, everytime we save the record one history record is been created.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-crm_improvement-uco/+merge/54483
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-openerp_crm_imp.
=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py 2011-03-09 06:21:48 +0000
+++ crm/crm_lead.py 2011-03-23 09:14:25 +0000
@@ -273,9 +273,9 @@
def write(self, cr, uid, ids, vals, context=None):
if not context:
context = {}
-
if 'date_closed' in vals:
return super(crm_lead,self).write(cr, uid, ids, vals, context=context)
+<<<<<<< TREE
if 'stage_id' in vals and vals['stage_id']:
stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, vals['stage_id'], context=context)
@@ -287,11 +287,13 @@
elif case.type == 'opportunity':
message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
self.log(cr, uid, case.id, message)
+=======
+>>>>>>> MERGE-SOURCE
return super(crm_lead,self).write(cr, uid, ids, vals, context)
def stage_historize(self, cr, uid, ids, stage, context=None):
stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
- self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
+ self.history(cr, uid, ids, _("Changed Stage to: ") + stage_obj.name, details=_("Changed Stage to: ") + stage_obj.name)
for case in self.browse(cr, uid, ids, context=context):
if case.type == 'lead':
message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
@@ -303,19 +305,13 @@
def stage_next(self, cr, uid, ids, context=None):
stage = super(crm_lead, self).stage_next(cr, uid, ids, context=context)
if stage:
- stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
- if stage_obj.on_change:
- data = {'probability': stage_obj.probability}
- self.write(cr, uid, ids, data)
+ self.stage_historize(cr, uid, ids, stage, context=context)
return stage
def stage_previous(self, cr, uid, ids, context=None):
stage = super(crm_lead, self).stage_previous(cr, uid, ids, context=context)
if stage:
- stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
- if stage_obj.on_change:
- data = {'probability': stage_obj.probability}
- self.write(cr, uid, ids, data)
+ self.stage_historize(cr, uid, ids, stage, context=context)
return stage
def message_new(self, cr, uid, msg, context=None):