Merge lp:~hsoft/openerp-mgmtsystem/bug1166555 into lp:openerp-mgmtsystem

Proposed by Virgil Dupras
Status: Merged
Merged at revision: 36
Proposed branch: lp:~hsoft/openerp-mgmtsystem/bug1166555
Merge into: lp:openerp-mgmtsystem
Diff against target: 68 lines (+10/-10)
1 file modified
mgmtsystem_nonconformity/mgmtsystem_nonconformity.py (+10/-10)
To merge this branch: bzr merge lp:~hsoft/openerp-mgmtsystem/bug1166555
Reviewer Review Type Date Requested Status
Daniel Reis Approve
Review via email: mp+157867@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Daniel Reis (dreis-pt) wrote :

Virgil,

The solution should be to fix the code using the depretcated `osv`.
For exemple, `osv.except_osv` should be changed to `orm.except_orm`.

review: Needs Fixing
33. By Virgil Dupras

[FIX] Replaced deprecated osv.except_osv() with orm.except_orm().

Revision history for this message
Virgil Dupras (hsoft) wrote :

Done. I'm not familiar with LP review. What am I supposed to do now, select "Resubmit" under my comment?

Revision history for this message
Daniel Reis (dreis-pt) wrote :

Just push your changes and then post a comment asking for review. No need to select a status.

No dia 11/04/2013, às 19:50, Virgil Dupras <email address hidden> escreveu:

> Done. I'm not familiar with LP review. What am I supposed to do now, select "Resubmit" under my comment?
> --
> https://code.launchpad.net/~hsoft/openerp-mgmtsystem/bug1166555/+merge/157867
> You are reviewing the proposed merge of lp:~hsoft/openerp-mgmtsystem/bug1166555 into lp:openerp-mgmtsystem.

Revision history for this message
Daniel Reis (dreis-pt) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mgmtsystem_nonconformity/mgmtsystem_nonconformity.py'
2--- mgmtsystem_nonconformity/mgmtsystem_nonconformity.py 2013-04-02 14:39:52 +0000
3+++ mgmtsystem_nonconformity/mgmtsystem_nonconformity.py 2013-04-11 18:49:21 +0000
4@@ -204,11 +204,11 @@
5 """Sign-off the analysis"""
6 o = self.browse(cr, uid, ids, context=context)[0]
7 if o.state != 'analysis':
8- raise osv.except_osv(_('Error !'), _('This action can only be done in the Analysis state.'))
9+ raise orm.except_orm(_('Error !'), _('This action can only be done in the Analysis state.'))
10 if o.analysis_date:
11- raise osv.except_osv(_('Error !'), _('Analysis is already approved.'))
12+ raise orm.except_orm(_('Error !'), _('Analysis is already approved.'))
13 if not o.analysis:
14- raise osv.except_osv(_('Error !'), _('Please provide an analysis before approving.'))
15+ raise orm.except_orm(_('Error !'), _('Please provide an analysis before approving.'))
16 vals = {'analysis_date': time.strftime(DATETIME_FORMAT), 'analysis_user_id': uid }
17 self.write(cr, uid, ids, vals, context=context)
18 self.message_post(cr, uid, self.browse(cr, uid, ids, context=context), _('Analysis Approved'))
19@@ -218,7 +218,7 @@
20 """Change state from analysis to pending approval"""
21 o = self.browse(cr, uid, ids, context=context)[0]
22 if not o.analysis_date:
23- raise osv.except_osv(_('Error !'), _('Analysis must be performed before submiting to approval.'))
24+ raise orm.except_orm(_('Error !'), _('Analysis must be performed before submiting to approval.'))
25 self.message_post(cr, uid, self.browse(cr, uid, ids, context=context), _('Pending Approval'))
26 return self.write(cr, uid, ids, {'state': 'pending', 'actions_date': None, 'actions_user_id': None}, context=context)
27
28@@ -226,11 +226,11 @@
29 """Sign-off the action plan"""
30 o = self.browse(cr, uid, ids, context=context)[0]
31 if o.state != 'pending':
32- raise osv.except_osv(_('Error !'), _('This action can only be done in the Pending for Approval state.'))
33+ raise orm.except_orm(_('Error !'), _('This action can only be done in the Pending for Approval state.'))
34 if o.actions_date:
35- raise osv.except_osv(_('Error !'), _('Action plan is already approved.'))
36+ raise orm.except_orm(_('Error !'), _('Action plan is already approved.'))
37 if not self.browse(cr, uid, ids, context=context)[0].analysis_date:
38- raise osv.except_osv(_('Error !'), _('Analysis approved before the review confirmation.'))
39+ raise orm.except_orm(_('Error !'), _('Analysis approved before the review confirmation.'))
40 vals = {'actions_date': time.strftime(DATETIME_FORMAT), 'actions_user_id': uid }
41 self.write(cr, uid, ids, vals, context=context)
42 self.message_post(cr, uid, self.browse(cr, uid, ids, context=context), _('Action Plan Approved'))
43@@ -240,7 +240,7 @@
44 """Change state from pending approval to in progress, and Open the related actions"""
45 o = self.browse(cr, uid, ids, context=context)[0]
46 if not o.actions_date:
47- raise osv.except_osv(_('Error !'), _('Action plan must be approved before opening.'))
48+ raise orm.except_orm(_('Error !'), _('Action plan must be approved before opening.'))
49 self.message_post(cr, uid, self.browse(cr, uid, ids, context=context), _('In Progress'))
50 #Open related Actions
51 if o.immediate_action_id and o.immediate_action_id.state == 'draft':
52@@ -254,7 +254,7 @@
53 """Sign-off the effectiveness evaluation"""
54 o = self.browse(cr, uid, ids, context=context)[0]
55 if o.state != 'open':
56- raise osv.except_osv(_('Error !'), _('This action can only be done in the In Progress state.'))
57+ raise orm.except_orm(_('Error !'), _('This action can only be done in the In Progress state.'))
58 vals = {'evaluation_date': time.strftime(DATETIME_FORMAT), 'evaluation_user_id': uid }
59 self.write(cr, uid, ids, vals, context=context)
60 self.message_post(cr, uid, self.browse(cr, uid, ids, context=context), _('Effectiveness Evaluation Approved'))
61@@ -269,7 +269,7 @@
62 """Change state from in progress to closed"""
63 o = self.browse(cr, uid, ids, context=context)[0]
64 if not o.evaluation_date:
65- raise osv.except_osv(_('Error !'), _('Effectiveness evaluation must be performed before closing.'))
66+ raise orm.except_orm(_('Error !'), _('Effectiveness evaluation must be performed before closing.'))
67 self.message_post(cr, uid, self.browse(cr, uid, ids, context=context), _('Close'))
68 return self.write(cr, uid, ids, {'state': 'done'}, context=context)
69