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
1=== modified file 'framework_agreement/model/purchase.py'
2--- framework_agreement/model/purchase.py 2014-02-05 08:47:53 +0000
3+++ framework_agreement/model/purchase.py 2014-02-18 13:48:02 +0000
4@@ -36,13 +36,19 @@
5 res.update([x.id for x in row.order_line])
6 return res
7
8+ def _get_po_line_store(self, cr, uid, ids, context=None):
9+ return ids
10+
11+
12 _store_tuple = (_get_po_store, ['framework_agreement_id'], 20)
13+ _line_store_tuple = (_get_po_line_store, [], 20)
14
15 _columns = {'framework_agreement_id': fields.related('order_id',
16 'framework_agreement_id',
17 type='many2one',
18 readonly=True,
19- store={'purchase.order': _store_tuple},
20+ store={'purchase.order': _store_tuple,
21+ 'purchase.order.line': _line_store_tuple},
22 relation='framework.agreement',
23 string='Agreement')}
24

Subscribers

People subscribed via source and target branches