[FIX] Make sure the tests for mrp.product.produce do the onchange for consume_lines

bzr revid: jco@openerp.com-20140122092921-rjgehregzpqfreyg
This commit is contained in:
Josse Colpaert 2014-01-22 10:29:21 +01:00
parent 72b0c03b96
commit da22ca89bb
4 changed files with 13 additions and 2 deletions

View File

@ -49,10 +49,12 @@
!python {model: mrp.product.produce}: |
context.update({'active_id': ref('mrp_production_servicetype_mo1')})
-
!record {model: mrp.product.produce, id: mrp_product_produce_1}:
!record {model: mrp.product.produce, id: mrp_product_produce_1, view: mrp.view_mrp_product_produce_wizard}:
mode: 'consume_produce'
-
!python {model: mrp.product.produce}: |
lines = self.on_change_qty(cr, uid, [ref('mrp_product_produce_1')], 1.0, [], context=context)
self.write(cr, uid, [ref('mrp_product_produce_1')], lines['value'], context=context)
self.do_produce(cr, uid, [ref('mrp_product_produce_1')], context=context)
-
I check production order after produced.
@ -117,6 +119,9 @@
mode: 'consume_produce'
-
!python {model: mrp.product.produce}: |
qty = self.browse(cr, uid, ref('mrp_product_produce_2')).product_qty
lines = self.on_change_qty(cr, uid, [ref('mrp_product_produce_2')], qty, [], context=context)
self.write(cr, uid, [ref('mrp_product_produce_2')], lines['value'], context=context)
self.do_produce(cr, uid, [ref('mrp_product_produce_2')], context=context)
-
I check production order after produced.

View File

@ -154,6 +154,9 @@
mode: 'consume_produce'
-
!python {model: mrp.product.produce}: |
qty = self.browse(cr, uid, ref('mrp_product_produce1')).product_qty
lines = self.on_change_qty(cr, uid, [ref('mrp_product_produce1')], qty, [], context=context)
self.write(cr, uid, [ref('mrp_product_produce1')], lines['value'], context=context)
self.do_produce(cr, uid, [ref('mrp_product_produce1')], context=context)
-
I check production order after produced.

View File

@ -70,7 +70,7 @@ class mrp_product_produce(osv.osv_memory):
new_consume_lines = []
for consume in consume_lines:
new_consume_lines.append([0, False, consume]) #Todo for all qtys
new_consume_lines.append([0, False, consume])
return {'value': {'consume_lines': new_consume_lines}}

View File

@ -64,6 +64,9 @@
I finish the production order.
-
!python {model: mrp.product.produce}: |
qty = self.browse(cr, uid, ref('mrp_product_produce0')).product_qty
lines = self.on_change_qty(cr, uid, [ref('mrp_product_produce0')], qty, [], context=context)
self.write(cr, uid, [ref('mrp_product_produce0')], lines['value'], context=context)
self.do_produce(cr, uid, [ref("mrp_product_produce0")], {"active_model": "mrp.production", "active_ids":[ref("mrp_production_mo0")], "active_id": ref("mrp_production_mo0")})
-
I see that stock moves of External Hard Disk including Headset USB are done now.