summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2013-08-01 15:21:50 +0200
committerOlivier Dony <odo@openerp.com>2013-08-01 15:21:50 +0200
commit957fa4e2dab422ce6aebf7b86b2d054ab93ca083 (patch)
treee443669c5047988e43186e051ab73eb7ade61242
parent1a04d7b12870fd4752b664c91d5d2fc5ddefd0e1 (diff)
parent2c876092880c9bea0254d6778a5f2a34f69c1fb5 (diff)
[MERGE] mrp: confirmation of procurements when production order is confirmed was broken + fix and re-enable tests
During the workflow signalling refactoring the signal for confirming the procurements was sent to the wrong model, thus having no effect at all. In addition the MRP tests were incorrectly disabled and did not cover this case properly. They were re-enabled and corrected to cover it. bzr revid: odo@openerp.com-20130801132150-gfp1saryq48249pu
-rw-r--r--addons/mrp/__openerp__.py6
-rw-r--r--addons/mrp/mrp.py2
-rw-r--r--addons/mrp/test/order_process.yml7
3 files changed, 10 insertions, 5 deletions
diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py
index 6e025ae2d90..83f0a4f11eb 100644
--- a/addons/mrp/__openerp__.py
+++ b/addons/mrp/__openerp__.py
@@ -77,9 +77,9 @@ Dashboard / Reports for MRP will include:
#TODO: This yml tests are needed to be completely reviewed again because the product wood panel is removed in product demo as it does not suit for new demo context of computer and consultant company
# so the ymls are too complex to change at this stage
'test': [
-# 'test/order_demo.yml',
-# 'test/order_process.yml',
-# 'test/cancel_order.yml',
+ 'test/order_demo.yml',
+ 'test/order_process.yml',
+ 'test/cancel_order.yml',
],
'installable': True,
'application': True,
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index f51f7292c76..82db2ace570 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -885,7 +885,7 @@ class mrp_production(osv.osv):
'move_id': shipment_move_id,
'company_id': production.company_id.id,
})
- self.signal_button_confirm(cr, uid, [procurement_id])
+ procurement_order.signal_button_confirm(cr, uid, [procurement_id])
return procurement_id
def _make_production_internal_shipment_line(self, cr, uid, production_line, shipment_id, parent_move_id, destination_location_id=False, context=None):
diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml
index acbfea48182..801f20f0747 100644
--- a/addons/mrp/test/order_process.yml
+++ b/addons/mrp/test/order_process.yml
@@ -94,6 +94,11 @@
procurement_ids = procurement.search(cr, uid, [('move_id','=',move_line.id)])
assert procurement_ids, "Procurement should be created for shipment line of raw materials."
shipment_procurement = procurement.browse(cr, uid, procurement_ids[0], context=context)
+ # procurement state should be `confirmed` at this stage, except if mrp_jit is installed, in which
+ # case it could already be in `running` or `exception` state (not enough stock)
+ expected_states = ('confirmed', 'running', 'exception')
+ assert shipment_procurement.state in expected_states, 'Procurement state is `%s` for %s, expected one of %s' % \
+ (shipment_procurement.state, shipment_procurement.product_id.name, expected_states)
assert shipment_procurement.date_planned == date_planned, "Planned date is not correspond in procurement."
assert shipment_procurement.product_id.id == order_line.product_id.id, "Product is not correspond in procurement."
assert shipment_procurement.product_qty == order_line.product_qty, "Qty is not correspond in procurement."
@@ -157,9 +162,9 @@
scrap_location_id = scrap_location_ids[0]
order = self.browse(cr, uid, ref("mrp_production_test1"))
for move in order.move_lines:
- move.action_consume(move.product_qty)
if move.product_id.id == ref("product.product_product_6"):
move.action_scrap(5.0, scrap_location_id)
+ move.action_consume(move.product_qty)
-
I produce product.
-