[IMP] Adapt demo data and tests mrp repair

bzr revid: jco@openerp.com-20140124123036-w63uzmrkg08qoil0
This commit is contained in:
Josse Colpaert 2014-01-24 13:30:36 +01:00
parent 6801d0c5af
commit 44f3e6de66
3 changed files with 14 additions and 54 deletions

View File

@ -480,7 +480,7 @@ class mrp_repair(osv.osv):
move_id = move_obj.create(cr, uid, {
'name': repair.name,
'product_id': repair.product_id.id,
'product_uom': repair.product_uom.id,
'product_uom': repair.product_uom.id or repair.product_id.uom_id.id,
'product_qty': repair.product_qty,
'partner_id': repair.address_id and repair.address_id.id or False,
'location_id': repair.location_id.id,

View File

@ -1,25 +1,13 @@
-
!record {model: stock.move, id: stock_move_pcbasicpc0}:
company_id: base.main_company
date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
date_expected: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
location_dest_id: stock.stock_location_14
location_id: stock.stock_location_stock
name: '[PCSC234] PC Assemble SC234'
product_id: product.product_product_3
product_qty: 1.0
product_uom: product.product_uom_unit
product_uos_qty: 1.0
-
!record {model: mrp.repair, id: mrp_repair_rmrp1}:
address_id: base.res_partner_address_1
guarantee_limit: !eval datetime.today().strftime("%Y-%m-%d")
invoice_method: 'none'
product_id: product.product_product_3
product_uom: product.product_uom_unit
partner_invoice_id: base.res_partner_address_1
location_dest_id: stock.stock_location_14
location_id: stock.stock_location_14
picking_type_id: stock.picking_type_out
move_id: 'stock_move_pcbasicpc0'
location_id: stock.stock_location_stock
name: RMA00004
operations:
- location_dest_id: stock.location_production
@ -39,29 +27,16 @@
product_uom: product.product_uom_unit
price_unit: 50.0
partner_id: base.res_partner_9
product_id: product.product_product_3
-
!record {model: stock.move, id: stock.stock_move_stockmvmrp1}:
company_id: base.main_company
date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
date_expected: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
location_dest_id: stock.stock_location_14
location_id: stock.stock_location_stock
name: '[PC-DEM] PC on Demand'
product_id: product.product_product_5
product_qty: 1.0
product_uom: product.product_uom_unit
product_uos_qty: 1.0
-
!record {model: mrp.repair, id: mrp_repair_rmrp0}:
product_id: product.product_product_5
product_uom: product.product_uom_unit
address_id: base.res_partner_address_1
guarantee_limit: !eval datetime.today().strftime("%Y-%m-%d")
invoice_method: 'after_repair'
partner_invoice_id: base.res_partner_address_1
location_dest_id: stock.stock_location_14
location_id: stock.stock_location_14
picking_type_id: stock.picking_type_out
move_id: 'stock.stock_move_stockmvmrp1'
location_id: stock.stock_location_stock
name: RMA-00007
operations:
- location_dest_id: stock.location_production
@ -81,29 +56,16 @@
product_uom: product.product_uom_unit
price_unit: 50.0
partner_id: base.res_partner_9
product_id: product.product_product_5
-
!record {model: stock.move, id: stock.stock_move_stockmvmrp2}:
company_id: base.main_company
date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
date_expected: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S")
location_dest_id: stock.stock_location_14
location_id: stock.stock_location_stock
name: '[LCD15] 15” LCD Monitor'
product_id: product.product_product_6
product_qty: 1.0
product_uom: product.product_uom_unit
product_uos_qty: 1.0
-
!record {model: mrp.repair, id: mrp_repair_rmrp2}:
product_id: product.product_product_6
product_uom: product.product_uom_unit
address_id: base.res_partner_address_1
guarantee_limit: !eval datetime.today().strftime("%Y-%m-%d")
invoice_method: 'b4repair'
partner_invoice_id: base.res_partner_address_1
location_dest_id: stock.stock_location_14
location_dest_id: stock.stock_location_stock
location_id: stock.stock_location_14
picking_type_id: stock.picking_type_out
move_id: 'stock.stock_move_stockmvmrp2'
name: RMA-00011
operations:
- location_dest_id: stock.location_production
@ -122,5 +84,4 @@
product_uom_qty: 1.0
product_uom: product.product_uom_unit
price_unit: 50.0
partner_id: base.res_partner_9
product_id: product.product_product_6
partner_id: base.res_partner_9

View File

@ -8,7 +8,7 @@
-
!workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rmrp1}
-
I start the repairing process by clicking on "Start Repair" button for Invoice Method 'No Invoice'.
I start the repairing process by clicking on "Start Repair" button for Invoice Method 'No Invoice'.
-
!workflow {model: mrp.repair, action: repair_ready, ref: mrp_repair_rmrp1}
-
@ -22,9 +22,8 @@
!workflow {model: mrp.repair, action: action_repair_end, ref: mrp_repair_rmrp1}
-
I define Invoice Method 'No Invoice' option in this repair order.
So, I check that Invoice should not be created for this repair order.
So, I check that Invoice has not been created for this repair order.
-
!python {model: mrp.repair}: |
repair_id = self.browse(cr, uid, [ref('mrp_repair_rmrp1')], context=context)[0]
assert not repair_id.invoice_id.id, "Invoice should not exist for this repair order"
assert not repair_id.invoice_id.id, "Invoice should not exist for this repair order"