Merge lp:~unifield-team/unifield-addons/uf-653 into lp:unifield-addons

Proposed by Quentin THEURET @Amaris
Status: Needs review
Proposed branch: lp:~unifield-team/unifield-addons/uf-653
Merge into: lp:unifield-addons
Diff against target: 32 lines (+15/-0)
1 file modified
purchase/purchase.py (+15/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/uf-653
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+185488@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

4565. By <email address hidden>

[uf-653] add a hook on validation of purchase order for having the validation date

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'purchase/purchase.py'
2--- purchase/purchase.py 2012-08-14 21:31:14 +0000
3+++ purchase/purchase.py 2013-09-13 13:11:25 +0000
4@@ -311,6 +311,20 @@
5 context = {}
6 if isinstance(ids, (int, long)):
7 ids = [ids]
8+ return True
9+
10+ def _hook_update_validation_date(self, cr, uid, ids, context=None):
11+ '''
12+ Please copy this to your module's method also.
13+ This hook belongs to the wkf_confirm_order method from purchase>purchase.py>purchase_order
14+
15+ - allow to execute code in order to update the validation date for computing the internal validation lead-time in the KPI module
16+ '''
17+ # Some verifications
18+ if context is None:
19+ context = {}
20+ if isinstance(ids, (int, long)):
21+ ids = [ids]
22
23 return True
24
25@@ -332,6 +346,7 @@
26 self.pool.get('purchase.order.line').action_confirm(cr, uid, todo, context)
27 for id in ids:
28 self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid})
29+ self._hook_update_validation_date(cr, uid, ids, context=context)
30 return True
31
32 def wkf_warn_buyer(self, cr, uid, ids):

Subscribers

People subscribed via source and target branches

to all changes: