Merge lp:~hsoft/openerp-mgmtsystem/bug-1167918 into lp:openerp-mgmtsystem

Proposed by Virgil Dupras
Status: Merged
Merged at revision: 38
Proposed branch: lp:~hsoft/openerp-mgmtsystem/bug-1167918
Merge into: lp:openerp-mgmtsystem
Diff against target: 16 lines (+2/-2)
1 file modified
mgmtsystem_nonconformity/mgmtsystem_nonconformity.py (+2/-2)
To merge this branch: bzr merge lp:~hsoft/openerp-mgmtsystem/bug-1167918
Reviewer Review Type Date Requested Status
Daniel Reis Approve
Review via email: mp+158458@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Reis (dreis-pt) wrote :

The problem is that the code is trying to run a method on a Browse object, and it should do it on a Model object instead. Instead of "o." it should use a "nc_model." Pointing at a pool's model.

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

My knowledge is fuzzy on calling methods on a Browse object being a bad practice.

If it's a bad practice, why does it seem to work? The "function_proxy" thing seems to have been added with the intent of adding this feature.

http://bazaar.launchpad.net/~openerp/openobject-server/trunk/revision/3353.1.43

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

Well, if it works, I'm learning something new. I'll need to have a closer look at that.

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

> My knowledge is fuzzy on calling methods on a Browse object being a bad practice.
>
> If it's a bad practice, why does it seem to work? The "function_proxy" thing seems to have been added with the intent of adding this feature.
>
> http://bazaar.launchpad.net/~openerp/openobject-server/trunk/revision/3353.1.43
> --
> https://code.launchpad.net/~hsoft/openerp-mgmtsystem/bug-1167918/+merge/158458
> You are subscribed to branch lp:openerp-mgmtsystem.

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

I tested the NC workflow and all stages worked, including the "Open/Start".
And the syntax used is a lot more object oriented than the previues one, so well done.

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 19:24:20 +0000
4@@ -244,10 +244,10 @@
5 self.message_post(cr, uid, self.browse(cr, uid, ids, context=context), _('In Progress'))
6 #Open related Actions
7 if o.immediate_action_id and o.immediate_action_id.state == 'draft':
8- o.immediate_action_id.case_open(cr, uid, [o.immediate_action_id.id])
9+ o.immediate_action_id.case_open()
10 for a in o.action_ids:
11 if a.state == 'draft':
12- a.case_open(cr, uid, [a.id])
13+ a.case_open()
14 return self.write(cr, uid, ids, {'state': 'open', 'evaluation_date': None, 'evaluation_user_id': None}, context=context)
15
16 def action_sign_evaluation(self, cr, uid, ids, context=None):