[IMP] mrp: Improved yaml.

bzr revid: uco@tinyerp.com-20100903094711-rvmbd333mavm8muq
This commit is contained in:
uco (Open ERP) 2010-09-03 15:17:11 +05:30
parent d97ac4265b
commit 3db8f8fd6d
5 changed files with 50 additions and 9 deletions

View File

@ -88,10 +88,11 @@
'board_manufacturing_demo.xml'
],
'test': [
'test/mrp_procurement.yml',
'test/mrp_packs.yml',
'test/mrp_phantom_bom.yml',
'test/mrp_production_order.yml',
'test/mrp_procurement.yml'
],
'installable': True,
'active': False,

View File

@ -8,6 +8,10 @@
categ_id: product.cat1
name: Beers
procure_method: make_to_stock
seller_ids:
- delay: 1
name: base.res_partner_agrolait
min_qty: 2.0
supply_method: buy
type: product
uom_id: product.product_uom_unit
@ -19,6 +23,10 @@
categ_id: product.cat1
name: Beers Pack
procure_method: make_to_stock
seller_ids:
- delay: 1
name: base.res_partner_asus
min_qty: 2.0
supply_method: buy
type: product
uom_id: product.product_uom_unit
@ -87,8 +95,9 @@
converted to a picking of 24 beers and a pack of beer, so that my
stock of beers remains exact.
-
!assert {model: stock.picking, id: picking_out, string:pack_of_beer_splitted}:
!assert {model: stock.picking, id: picking_out, string: pack_of_beer_splitted}:
- len(move_lines) == 2
- move_lines[0].product_id.id <> move_lines[1].product_id.id
- move_lines[0].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0'))
- move_lines[1].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0'))

View File

@ -67,7 +67,11 @@
!record {model: product.product, id: product_product_water0}:
categ_id: product.cat1
name: Water
procure_method: make_to_stock
procure_method: make_to_order
seller_ids:
- delay: 1
name: base.res_partner_agrolait
min_qty: 2.0
supply_method: buy
type: consu
uom_id: product_uom_litre0
@ -196,7 +200,7 @@
-
!python {model: procurement.order}: |
from tools.translate import _
proc_ids = self.search(cr, uid, [('state','!=','confirmed')])
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
assert proc_ids, _('No Procurements!')
-
The scheduler runs.
@ -256,7 +260,7 @@
-
!python {model: stock.partial.picking}: |
pick_obj = self.pool.get('stock.picking')
picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')])
picking_ids = pick_obj.search(cr, uid, [('type','=','in'),('state','=','assigned')])
partial = self.browse(cr, uid, 1, context)
partial_datas = {
'delivery_date': partial.date
@ -274,4 +278,29 @@
'product_currency': m.product_currency
})
pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context)
-
Again the scheduler runs.
-
!function {model: procurement.order, name: run_scheduler}:
- model: procurement.order
search: "[('state','!=','confirmed')]"
-
I check my internal picking of "Orange Juice" is done.
-
!python {model: stock.picking}: |
from tools.translate import _
pick_ids = self.search(cr, uid, [('type','=','internal'),('state','=','done')])
assert pick_ids, _('Internal Picking is not done yet!')
-
I check my manufacturing order for "Orange Juice" is ready or not.
-
!python {model: mrp.production}: |
from tools.translate import _
pick_ids = self.search(cr, uid, [('state','=','ready'),('id','=',ref('mrp_production_mo0'))])
assert pick_ids, _('Manufacturing order is not ready!')
-
I start the production order.
-
!workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0}

View File

@ -162,7 +162,7 @@
-
!function {model: procurement.order, name: run_scheduler}:
- model: procurement.order
search: "[]"
search: "[('state','=','confirmed')]"
-
I check that there is one purchase order for Cloth.
-
@ -286,7 +286,7 @@
-
!function {model: procurement.order, name: run_scheduler}:
- model: procurement.order
search: "[]"
search: "[('state','!=','confirmed')]"
-
Check state of manufacturing order for Shirt.
-

View File

@ -86,7 +86,7 @@
-
!python {model: procurement.order}: |
from tools.translate import _
proc_ids = self.search(cr, uid, [('state','!=','confirmed')])
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
assert proc_ids, _('No Procurements!')
-
The scheduler runs.
@ -110,6 +110,8 @@
assert order_ids, _('No manufacturing order!')
-
I start producing that product first. So I marked it as started.
-
!workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0}
-
I create record for producing products with quantity 5.00.
-