← Back to team overview

savoirfairelinux-openerp team mailing list archive

[Merge] lp:~savoirfairelinux-openerp/openerp-mgmtsystem/bug-1219854 into lp:openerp-mgmtsystem

 

Sandy Carter (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/openerp-mgmtsystem/bug-1219854 into lp:openerp-mgmtsystem.

Requested reviews:
  Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903)
Related bugs:
  Bug #1219854 in OpenERP Management System: "Closing a nonconformity even if an action is not done"
  https://bugs.launchpad.net/openerp-mgmtsystem/+bug/1219854

For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-mgmtsystem/bug-1219854/+merge/183936

Added check in wtk_close which raises an exception if it contains an action that is not 'done'.
-- 
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-mgmtsystem/bug-1219854/+merge/183936
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/openerp-mgmtsystem/bug-1219854.
=== modified file 'mgmtsystem_nonconformity/mgmtsystem_nonconformity.py'
--- mgmtsystem_nonconformity/mgmtsystem_nonconformity.py	2013-08-25 14:58:18 +0000
+++ mgmtsystem_nonconformity/mgmtsystem_nonconformity.py	2013-09-04 17:36:39 +0000
@@ -272,6 +272,8 @@
     def wkf_close(self, cr, uid, ids, context=None):
         """Change state from in progress to closed"""
         o = self.browse(cr, uid, ids, context=context)[0]
+        if [i for i in o.action_ids if i.state != 'done']:
+            raise orm.except_orm(_('Error !'), _('Not all actions have been closed.'))
         if not o.evaluation_date:
             raise orm.except_orm(_('Error !'), _('Effectiveness evaluation must be performed before closing.'))
         self.message_post(cr, uid, self.browse(cr, uid, ids, context=context), _('Close'))


Follow ups