← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-784594-asr into lp:openobject-addons

 

Ashutosh Srivastava(Open ERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-784594-asr into lp:openobject-addons.

Requested reviews:
  Bhumika (OpenERP) (sbh-openerp)
Related bugs:
  Bug #784594 in OpenERP Addons: "Duplicating a survey copies too much information"
  https://bugs.launchpad.net/openobject-addons/+bug/784594

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-784594-asr/+merge/61758
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-784594-asr/+merge/61758
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-784594-asr.
=== modified file 'survey/survey.py'
--- survey/survey.py	2011-01-18 11:54:45 +0000
+++ survey/survey.py	2011-05-20 12:55:57 +0000
@@ -96,8 +96,13 @@
     def copy(self, cr, uid, ids, default=None, context=None):
         vals = {}
         current_rec = self.read(cr, uid, ids, context=context)
+        if current_rec.has_key('state'):
+            val = current_rec['state']
+            if val['state'] in ('open'):
+                raise osv.except_osv(_('Error!'),_('Cannot open the  duplicate survey in open state'))
         title = current_rec.get('title') + ' (Copy)'
         vals.update({'title':title})
+        vals.update({'history':[],'tot_start_survey':0,'tot_comp_survey':0})
         return super(survey, self).copy(cr, uid, ids, vals, context=context)
 
     def action_print_survey(self, cr, uid, ids, context=None):


Follow ups