Merge lp:~camptocamp/purchase-wkfl/7.0-fix-missing-trigger-nbi into lp:~purchase-core-editors/purchase-wkfl/7.0

Proposed by Nicolas Bessi - Camptocamp
Status: Merged
Merged at revision: 27
Proposed branch: lp:~camptocamp/purchase-wkfl/7.0-fix-missing-trigger-nbi
Merge into: lp:~purchase-core-editors/purchase-wkfl/7.0
Diff against target: 23 lines (+7/-1)
1 file modified
framework_agreement/model/purchase.py (+7/-1)
To merge this branch: bzr merge lp:~camptocamp/purchase-wkfl/7.0-fix-missing-trigger-nbi
Reviewer Review Type Date Requested Status
Leonardo Pistone code review Approve
Romain Deheele - Camptocamp (community) code review Approve
Purchase Core Editors Pending
Review via email: mp+206934@code.launchpad.net

Description of the change

[FIX] merge trouble, missing trigger on purchase order line

To post a comment you must log in.
Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

LGTM,

Regards,

Romain

review: Approve (code review)
Revision history for this message
Leonardo Pistone (lepistone) wrote :

LGTM.

Out of curiosity (I approve in any case) why do you actually need the trigger on the purchase line itself? in theory, purchase_id should not change.

review: Approve (code review)
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Leonardo,

In ngo-addons we often have code that create create PO first and in a second step the PO line, in this case trigger is not call.

Revision history for this message
Leonardo Pistone (lepistone) wrote :

thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'framework_agreement/model/purchase.py'
--- framework_agreement/model/purchase.py 2014-02-05 08:47:53 +0000
+++ framework_agreement/model/purchase.py 2014-02-18 13:48:02 +0000
@@ -36,13 +36,19 @@
36 res.update([x.id for x in row.order_line])36 res.update([x.id for x in row.order_line])
37 return res37 return res
3838
39 def _get_po_line_store(self, cr, uid, ids, context=None):
40 return ids
41
42
39 _store_tuple = (_get_po_store, ['framework_agreement_id'], 20)43 _store_tuple = (_get_po_store, ['framework_agreement_id'], 20)
44 _line_store_tuple = (_get_po_line_store, [], 20)
4045
41 _columns = {'framework_agreement_id': fields.related('order_id',46 _columns = {'framework_agreement_id': fields.related('order_id',
42 'framework_agreement_id',47 'framework_agreement_id',
43 type='many2one',48 type='many2one',
44 readonly=True,49 readonly=True,
45 store={'purchase.order': _store_tuple},50 store={'purchase.order': _store_tuple,
51 'purchase.order.line': _line_store_tuple},
46 relation='framework.agreement',52 relation='framework.agreement',
47 string='Agreement')}53 string='Agreement')}
4854

Subscribers

People subscribed via source and target branches