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

Proposed by jftempo
Status: Merged
Merged at revision: 4536
Proposed branch: lp:~unifield-team/unifield-addons/uf-788
Merge into: lp:unifield-addons
Diff against target: 29 lines (+12/-0)
1 file modified
procurement/procurement.py (+12/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/uf-788
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+102466@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 'procurement/procurement.py'
2--- procurement/procurement.py 2011-09-21 14:41:14 +0000
3+++ procurement/procurement.py 2012-04-18 09:25:23 +0000
4@@ -377,6 +377,16 @@
5 for computing their own purpose
6 @return: True"""
7 return True
8+
9+ def _hook_check_mts_on_message(self, cr, uid, context=None, *args, **kwargs):
10+ '''
11+ Please copy this to your module's method also.
12+ This hook belongs to the _check_make_to_stock_product method from procurement>procurement.py>procurement.order
13+
14+ - allow to modify the message written back to procurement order
15+ '''
16+ message = kwargs['message']
17+ return message
18
19 def _check_make_to_stock_product(self, cr, uid, procurement, context=None):
20 """ Checks procurement move state.
21@@ -397,6 +407,8 @@
22 message = _("No minimum orderpoint rule defined.")
23 elif not ok:
24 message = _("Not enough stock.")
25+ # hook on message value
26+ message = self._hook_check_mts_on_message(cr, uid, context=context, message=message, procurement=procurement)
27
28 if message:
29 self.log(cr, uid, procurement.id, _("Procurement '%s' is in exception: ") % (procurement.name) + message)

Subscribers

People subscribed via source and target branches

to all changes: