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
=== modified file 'procurement/procurement.py'
--- procurement/procurement.py 2011-09-21 14:41:14 +0000
+++ procurement/procurement.py 2012-04-18 09:25:23 +0000
@@ -377,6 +377,16 @@
377 for computing their own purpose377 for computing their own purpose
378 @return: True"""378 @return: True"""
379 return True379 return True
380
381 def _hook_check_mts_on_message(self, cr, uid, context=None, *args, **kwargs):
382 '''
383 Please copy this to your module's method also.
384 This hook belongs to the _check_make_to_stock_product method from procurement>procurement.py>procurement.order
385
386 - allow to modify the message written back to procurement order
387 '''
388 message = kwargs['message']
389 return message
380390
381 def _check_make_to_stock_product(self, cr, uid, procurement, context=None):391 def _check_make_to_stock_product(self, cr, uid, procurement, context=None):
382 """ Checks procurement move state.392 """ Checks procurement move state.
@@ -397,6 +407,8 @@
397 message = _("No minimum orderpoint rule defined.")407 message = _("No minimum orderpoint rule defined.")
398 elif not ok:408 elif not ok:
399 message = _("Not enough stock.")409 message = _("Not enough stock.")
410 # hook on message value
411 message = self._hook_check_mts_on_message(cr, uid, context=context, message=message, procurement=procurement)
400412
401 if message:413 if message:
402 self.log(cr, uid, procurement.id, _("Procurement '%s' is in exception: ") % (procurement.name) + message)414 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: