[IMP] mrp: test case of yml to check workcenter lines after compute
bzr revid: hmo@tinyerp.com-20111209133818-j5zioig52rtedm82
This commit is contained in:
parent
84a0685557
commit
678b8b44e4
|
@ -151,20 +151,23 @@
|
|||
<field name="workcenter_id" ref="mrp_workcenter_0"/>
|
||||
<field name="name">Short time assembly</field>
|
||||
<field name="hour_nbr">2</field>
|
||||
<field name="sequence">5</field>
|
||||
</record>
|
||||
<record id="mrp_routing_workcenter_1" model="mrp.routing.workcenter">
|
||||
<field name="routing_id" ref="mrp_routing_1"/>
|
||||
<field name="workcenter_id" ref="mrp_workcenter_0"/>
|
||||
<field name="name">long time assembly</field>
|
||||
<field name="hour_nbr">5</field>
|
||||
<field name="sequence">15</field>
|
||||
</record>
|
||||
<record id="mrp_routing_workcenter_2" model="mrp.routing.workcenter">
|
||||
<field name="routing_id" ref="mrp_routing_2"/>
|
||||
<record id="mrp_routing_workcenter_3" model="mrp.routing.workcenter">
|
||||
<field name="routing_id" ref="mrp_routing_1"/>
|
||||
<field name="workcenter_id" ref="mrp_workcenter_0"/>
|
||||
<field name="cycle_nbr">0.5</field>
|
||||
<field name="hour_nbr">3</field>
|
||||
<field name="name">assembly main + processor + fan</field>
|
||||
<field name="name">Testing</field>
|
||||
<field name="hour_nbr">1</field>
|
||||
<field name="sequence">10</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_routing_workcenter_4" model="mrp.routing.workcenter">
|
||||
<field name="routing_id" ref="mrp_routing_1"/>
|
||||
<field name="workcenter_id" ref="mrp_workcenter_1"/>
|
||||
|
@ -173,6 +176,15 @@
|
|||
<field name="sequence">5</field>
|
||||
</record>
|
||||
|
||||
<record id="mrp_routing_workcenter_2" model="mrp.routing.workcenter">
|
||||
<field name="routing_id" ref="mrp_routing_2"/>
|
||||
<field name="workcenter_id" ref="mrp_workcenter_0"/>
|
||||
<field name="cycle_nbr">0.5</field>
|
||||
<field name="hour_nbr">3</field>
|
||||
<field name="sequence">5</field>
|
||||
<field name="name">assembly main + processor + fan</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Resource: mrp.bom
|
||||
-->
|
||||
|
@ -571,6 +583,7 @@
|
|||
<field name="product_id" ref="product.product_product_shelfofcm0"/>
|
||||
<field name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field name="product_qty">1.0</field>
|
||||
<field name="routing_id" ref="mrp.mrp_routing_1"/>
|
||||
</record>
|
||||
|
||||
<!-- BoMs for 1 Shelf 100cm
|
||||
|
@ -681,6 +694,7 @@
|
|||
<field name="product_id" ref="product.product_product_assemblysection0"/>
|
||||
<field name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field name="product_qty">1.0</field>
|
||||
<field name="routing_id" ref="mrp.mrp_routing_0"/>
|
||||
|
||||
</record>
|
||||
|
||||
|
@ -703,6 +717,7 @@
|
|||
<field name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field name="product_qty">1.0</field>
|
||||
<field name="name">Rear panel SHE100</field>
|
||||
<field name="routing_id" ref="mrp.mrp_routing_0"/>
|
||||
</record>
|
||||
<record id="mrp_bom_rearpanelarm1_wood002" model="mrp.bom">
|
||||
<field name="sequence">1311</field>
|
||||
|
@ -827,7 +842,6 @@
|
|||
<field name="location_src_id" ref="stock.stock_location_stock"/>
|
||||
<field name="location_dest_id" ref="stock.stock_location_output"/>
|
||||
<field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm0"/>
|
||||
<field name="routing_id" ref="mrp.mrp_routing_0"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
-
|
||||
!record {model: mrp.bom, id: mrp_bom_defaultbomforshelfofcm0}:
|
||||
product_id: product.product_product_shelfofcm0
|
||||
-
|
||||
!record {model: mrp.bom, id: mrp_bom_assemblysection1}:
|
||||
routing_id: mrp.mrp_routing_0
|
||||
-
|
||||
!record {model: mrp.bom, id: mrp_bom_rearpanelarm1}:
|
||||
routing_id: mrp.mrp_routing_0
|
||||
-
|
||||
I create Production Order of Shelf 100cm to produce 5.0 Dozen PCE.
|
||||
-
|
||||
|
@ -11,6 +17,7 @@
|
|||
location_dest_id: stock.stock_location_output
|
||||
product_id: product.product_product_shelfofcm0
|
||||
bom_id: mrp_bom_defaultbomforshelfofcm0
|
||||
routing_id: mrp.mrp_routing_1
|
||||
product_uom: product.product_uom_dozen
|
||||
product_qty: 5.0
|
||||
|
||||
|
|
|
@ -66,6 +66,37 @@
|
|||
assert woodmm0, "Production line is not generated for WOOD002."
|
||||
assert metalcleats, "Production line is not generated for METC000."
|
||||
assert woodmm10, "Production line is not generated for WOOD010."
|
||||
|
||||
-
|
||||
Now I check workcenter lines.
|
||||
-
|
||||
!python {model: mrp.production}: |
|
||||
order = self.browse(cr, uid, ref("mrp_production_shelf100cm"), context=context)
|
||||
routing = order.routing_id
|
||||
assert len(order.workcenter_lines), "Workcenter lines are not generated proper."
|
||||
for line in order.workcenter_lines:
|
||||
if line.name == "Short time assembly - Assembly Section":
|
||||
assert line.sequence, "Sequence is not correspond: %s" % (line.name)
|
||||
assert line.cycle == (4*5*12), "Cycle is not correspond: %s" % (line.name)
|
||||
assert line.hour == (2*4*5*12), "Hours is not correspond: %s"% (line.name)
|
||||
elif line.name == "Short time assembly - Rear Panel SHE100":
|
||||
assert line.sequence, "Sequence is not correspond: %s" % (line.name)
|
||||
assert line.cycle == (1*5*12), "Cycle is not correspond: %s" % (line.name)
|
||||
assert line.hour == (2*1*5*12), "Hours is not correspond: %s"% (line.name)
|
||||
elif line.name == "long time assembly - Shelf of 100cm":
|
||||
assert line.sequence, "Sequence is not correspond: %s" % (line.name)
|
||||
assert line.cycle == (1*5*12), "Cycle is not correspond: %s" % (line.name)
|
||||
assert line.hour == (5*1*5*12), "Hours is not correspond: %s"% (line.name)
|
||||
elif line.name == "Testing - Shelf of 100cm":
|
||||
assert line.sequence, "Sequence is not correspond: %s" % (line.name)
|
||||
assert line.cycle == (1*5*12), "Cycle is not correspond: %s" % (line.name)
|
||||
assert line.hour == (1*1*5*12), "Hours is not correspond: %s"% (line.name)
|
||||
elif line.name == "Packing - Shelf of 100cm":
|
||||
assert line.sequence, "Sequence is not correspond: %s" % (line.name)
|
||||
assert line.cycle == (1*5*12), "Cycle is not correspond: %s" % (line.name)
|
||||
assert line.hour == (0.5*1*5*12), "Hours is not correspond: %s"% (line.name)
|
||||
else:
|
||||
raise AssertionError('unknown workcenter line: %s' % line)
|
||||
-
|
||||
I confirm the Production Order.
|
||||
-
|
||||
|
|
Loading…
Reference in New Issue