Merge lp:~unifield-team/unifield-addons/addons-utp-872-create-hook into lp:unifield-addons

Proposed by jftempo
Status: Merged
Merged at revision: 4601
Proposed branch: lp:~unifield-team/unifield-addons/addons-utp-872-create-hook
Merge into: lp:unifield-addons
Diff against target: 22 lines (+6/-3)
1 file modified
purchase/purchase.py (+6/-3)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/addons-utp-872-create-hook
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+199549@code.launchpad.net
To post a comment you must log in.

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-12-18 20:24:01 +0000
4@@ -314,12 +314,15 @@
5
6 return True
7
8- #TODO: implement messages system
9+ #UTP-872: extracted this method for a particularly check with sync
10+ def _hook_check_po_no_line(self, po, context):
11+ if not po.order_line:
12+ raise osv.except_osv(_('Error !'), _('You can not confirm purchase order without Purchase Order Lines.'))
13+
14 def wkf_confirm_order(self, cr, uid, ids, context=None):
15 todo = []
16 for po in self.browse(cr, uid, ids, context=context):
17- if not po.order_line:
18- raise osv.except_osv(_('Error !'),_('You can not confirm purchase order without Purchase Order Lines.'))
19+ self._hook_check_po_no_line(po, context)
20 for line in po.order_line:
21 if line.state=='draft':
22 todo.append(line.id)

Subscribers

People subscribed via source and target branches

to all changes: