summaryrefslogtreecommitdiff
path: root/addons/procurement
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2013-11-25 16:00:54 +0100
committerChristophe Simonis <chs@openerp.com>2013-11-25 16:00:54 +0100
commitbb1e256f5b24bb4fc4b64e1fa973f86a30e4bace (patch)
tree95f1de1c67b507b0d10786d04aa0f98bcd22243a /addons/procurement
parentf148061b9455e39d3b3e6f316a5c7d586e1aad88 (diff)
parent7baee2822180db919e6754f04c0fa9bc8aaafe92 (diff)
[MERGE] forward port of branch saas-2 up to revid 9010 dle@openerp.com-20131125143003-vjtzj1c5051pdnk3
bzr revid: chs@openerp.com-20131125150054-b135qshkx6icakgk
Diffstat (limited to 'addons/procurement')
-rw-r--r--addons/procurement/procurement.py10
-rw-r--r--addons/procurement/procurement_workflow.xml6
-rw-r--r--addons/procurement/schedulers.py1
3 files changed, 11 insertions, 6 deletions
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index 032952aa511..c2878df69cb 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -181,10 +181,6 @@ class procurement_order(osv.osv):
"""
return all(procurement.move_id.state == 'cancel' for procurement in self.browse(cr, uid, ids, context=context))
- #This Function is create to avoid a server side Error Like 'ERROR:tests.mrp:name 'check_move' is not defined'
- def check_move(self, cr, uid, ids, context=None):
- pass
-
def check_move_done(self, cr, uid, ids, context=None):
""" Checks if move is done or not.
@return: True or False.
@@ -297,6 +293,12 @@ class procurement_order(osv.osv):
"""
return False
+ def check_move(self, cr, uid, ids, context=None):
+ """ Check whether the given procurement can be satisfied by an internal move,
+ typically a pulled flow. By default, it's False. Overwritten by the `stock_location` module.
+ """
+ return False
+
def check_conditions_confirm2wait(self, cr, uid, ids):
""" condition on the transition to go from 'confirm' activity to 'confirm_wait' activity """
return not self.test_cancel(cr, uid, ids)
diff --git a/addons/procurement/procurement_workflow.xml b/addons/procurement/procurement_workflow.xml
index 76b54370ef2..d4068a6eada 100644
--- a/addons/procurement/procurement_workflow.xml
+++ b/addons/procurement/procurement_workflow.xml
@@ -147,13 +147,15 @@
<record id="trans_confirm_mto_make_done" model="workflow.transition">
<!-- This transition is there to unblock products that would be in MTO with a supply method that would be
- produce or buy without MRP or purchase module installed. These modules overwrite the check_produce()
+ produce or buy, and without MRP or Purchase modules installed. These modules overwrite the check_produce()
and check_buy() methods -so that it invalidates their part of this 'bypass transition'-, and define
their own workflow paths.
+ The stock_location module also introduces a check_move() alternative, for pulled flows that are
+ satisfied with an internal product move. This yields a threefold test for the bypass transition.
-->
<field name="act_from" ref="act_confirm_mto"/>
<field name="act_to" ref="act_make_done"/>
- <field name="condition">not check_produce() and not check_buy()</field>
+ <field name="condition">not check_produce() and not check_buy() and not check_move()</field>
</record>
<record id="trans_make_to_stock_make_done" model="workflow.transition">
diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py
index d82fa94c132..0828b4f10df 100644
--- a/addons/procurement/schedulers.py
+++ b/addons/procurement/schedulers.py
@@ -173,6 +173,7 @@ class procurement_order(osv.osv):
'company_id': orderpoint.company_id.id,
'product_uom': orderpoint.product_uom.id,
'location_id': orderpoint.location_id.id,
+ 'warehouse_id': orderpoint.warehouse_id.id,
'procure_method': 'make_to_order',
'origin': orderpoint.name}