From 63e8f6738fef5083d212bb3f45aeda738d053e50 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Wed, 5 Jan 2011 10:33:29 +0530 Subject: [PATCH] [IMP] purchase_*, sale_*, stock_*: replace the static dates with current dates using eval bzr revid: psi@tinyerp.co.in-20110105050329-n0qjh6ur7k7jeikp --- addons/purchase/test/procurement_buy.yml | 36 ++-- addons/purchase/test/purchase_from_manual.yml | 4 +- addons/purchase/test/purchase_from_order.yml | 24 +-- .../purchase/test/purchase_from_picking.yml | 7 +- .../test/purchase_requisition.yml | 78 +++---- .../test/purchase_requisition_exclusive.yml | 48 ++--- addons/sale/test/advance_invoice.yml | 22 +- addons/sale/test/invoice_on_ordered_qty.yml | 24 +-- addons/sale/test/invoice_on_shipped_qty.yml | 25 +-- addons/sale/test/manual_order_policy.yml | 4 +- addons/sale/test/picking_order_policy.yml | 27 +-- addons/sale/test/postpaid_order_policy.yml | 46 ++--- addons/sale/test/prepaid_order_policy.yml | 22 +- addons/sale/test/sale_procurement.yml | 10 +- addons/sale/test/so_make_invoice.yml | 6 +- addons/sale/test/so_make_line_invoice.yml | 28 +-- addons/sale_margin/test/sale_margin.yml | 4 +- addons/sale_mrp/test/sale_mrp.yml | 8 +- addons/stock/test/stock_test.yml | 192 +++++++++--------- .../test/stock_invoice_directly.yml | 22 +- .../test/stock_location_pull_flow.yml | 94 ++++----- .../test/stock_location_push_flow.yml | 34 ++-- .../test/stock_no_autopicking.yml | 4 +- addons/stock_planning/test/stock_planning.yml | 56 ++--- 24 files changed, 414 insertions(+), 411 deletions(-) diff --git a/addons/purchase/test/procurement_buy.yml b/addons/purchase/test/procurement_buy.yml index 2afd6c2fb62..83eec43594b 100755 --- a/addons/purchase/test/procurement_buy.yml +++ b/addons/purchase/test/procurement_buy.yml @@ -1,9 +1,9 @@ - - In order to test the procurement with product type buy in OpenERP, I will create product + In order to test the procurement with product type buy in OpenERP, I will create product and then I will create procurement for this product. -- +- I create product. -- +- !record {model: product.product, id: product_product_cddrive0}: categ_id: product.product_category_3 cost_method: standard @@ -27,12 +27,12 @@ name: base.res_partner_asus min_qty: 2.0 qty: 5.0 -- +- I create procurement order. -- +- !record {model: procurement.order, id: procurement_order_testcase0}: company_id: base.main_company - date_planned: '2010-07-07 15:38:53' + date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S') location_id: stock.stock_location_stock name: Test Case priority: '1' @@ -43,13 +43,13 @@ product_uos: product.product_uom_unit product_uos_qty: 0.0 state: draft -- +- I confirm on procurement order. -- +- !workflow {model: procurement.order, action: button_confirm, ref: procurement_order_testcase0} -- +- I run the scheduler. -- +- !function {model: procurement.order, name: run_scheduler}: - model: procurement.order search: "[]" @@ -66,19 +66,19 @@ !python {model: procurement.order}: | from tools.translate import _ proc_ids = self.browse(cr, uid, [ref('procurement_order_testcase0')])[0] - assert(proc_ids.state == 'running'), _('Exception') -- + assert(proc_ids.state == 'running'), _('Exception') +- I confirm and Approve the purchase order. -- +- !python {model: purchase.order}: | procurement_obj = self.pool.get('procurement.order') proc_ids = procurement_obj.browse(cr, uid, [ref('procurement_order_testcase0')])[0] import netsvc wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'purchase.order',proc_ids.purchase_id.id,'purchase_confirm', cr) -- + wf_service.trg_validate(uid, 'purchase.order',proc_ids.purchase_id.id,'purchase_confirm', cr) +- I receive the order of the supplier ASUStek from the Incoming Shipments menu. -- +- !python {model: stock.picking }: | import time procurement_obj = self.pool.get('procurement.order') @@ -96,7 +96,7 @@ 'product_id': move.product_id, 'product_qty': move.product_qty, 'product_uom': move.product_uom.id, - } + } self.do_partial(cr, uid, [picking.id], partial_datas) - I confirm the Reservation. @@ -111,4 +111,4 @@ !python {model: procurement.order}: | from tools.translate import _ proc_ids = self.browse(cr, uid, [ref('procurement_order_testcase0')])[0] - assert(proc_ids.state == 'done'), _('Order is not in done state') + assert(proc_ids.state == 'done'), _('Order is not in done state') diff --git a/addons/purchase/test/purchase_from_manual.yml b/addons/purchase/test/purchase_from_manual.yml index 6b95748bc4d..2739d74110e 100755 --- a/addons/purchase/test/purchase_from_manual.yml +++ b/addons/purchase/test/purchase_from_manual.yml @@ -28,11 +28,11 @@ - !record {model: purchase.order, id: purchase_order_po1}: company_id: base.main_company - date_order: '2010-05-11' + date_order: !eval time.strftime('%Y-%m-%d') invoice_method: manual location_id: stock.stock_location_stock order_line: - - date_planned: '2010-05-13' + - date_planned: !eval time.strftime('%Y-%m-%d') name: iPod price_unit: 100.0 product_id: 'product_product_ipod0' diff --git a/addons/purchase/test/purchase_from_order.yml b/addons/purchase/test/purchase_from_order.yml index ca089db7821..3acc68cb51b 100755 --- a/addons/purchase/test/purchase_from_order.yml +++ b/addons/purchase/test/purchase_from_order.yml @@ -23,16 +23,16 @@ weight_net: 0.0 - In order to test the purchase flow,I create a new record where "invoice_method" is From Order. -- +- I create purchase order for iPod. -- +- !record {model: purchase.order, id: purchase_order_po0}: company_id: base.main_company - date_order: '2010-05-11' + date_order: !eval time.strftime('%Y-%m-%d') invoice_method: order location_id: stock.stock_location_stock order_line: - - date_planned: '2010-05-13' + - date_planned: !eval time.strftime('%Y-%m-%d') name: iPod price_unit: 100.0 product_id: 'product_product_ipod0' @@ -42,20 +42,20 @@ partner_address_id: base.res_partner_address_7 partner_id: base.res_partner_4 pricelist_id: purchase.list0 -- +- Initially purchase order is in the draft state. - !assert {model: purchase.order, id: purchase_order_po0}: - - state == 'draft' + - state == 'draft' - I confirm the purchase order for iPod. - !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po0} -- +- I check that the order which was initially in the draft state has transit to confirm state. - !assert {model: purchase.order, id: purchase_order_po0}: - - state == 'approved' + - state == 'approved' - I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line. - @@ -76,7 +76,7 @@ I create invoice for products in the purchase order. - !python {model: purchase.order.line_invoice}: | - pur_obj=self.pool.get('purchase.order') + pur_obj=self.pool.get('purchase.order') ids = [] pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po0")) for line in pur_id1.order_line: @@ -104,7 +104,7 @@ I check that the order which was initially in the confirmed state has transit to approved state. - !assert {model: purchase.order, id: purchase_order_po0}: - - state == 'approved' + - state == 'approved' - I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved. - @@ -112,7 +112,7 @@ pur_id=self.browse(cr, uid, ref("purchase_order_po0")) assert(pur_id.date_approve) - - I check that an entry gets created in the pickings. + I check that an entry gets created in the pickings. - !python {model: purchase.order}: | pur_id=self.browse(cr, uid, ref("purchase_order_po0")) @@ -132,7 +132,7 @@ - I check that Traceability moves are created. - - I check that an invoice_ids field of Delivery&Invoices gets bind with the value. + I check that an invoice_ids field of Delivery&Invoices gets bind with the value. - !python {model: purchase.order}: | pur_id2=self.browse(cr, uid, ref("purchase_order_po0")) diff --git a/addons/purchase/test/purchase_from_picking.yml b/addons/purchase/test/purchase_from_picking.yml index 357d865b9c9..94239ba28c4 100755 --- a/addons/purchase/test/purchase_from_picking.yml +++ b/addons/purchase/test/purchase_from_picking.yml @@ -28,11 +28,11 @@ - !record {model: purchase.order, id: purchase_order_po2}: company_id: base.main_company - date_order: '2010-05-11' + date_order: !eval time.strftime('%Y-%m-%d') invoice_method: picking location_id: stock.stock_location_stock order_line: - - date_planned: '2010-05-13' + - date_planned: !eval time.strftime('%Y-%m-%d') name: iPod price_unit: 100.0 product_id: 'product_product_ipod0' @@ -132,10 +132,11 @@ Then I create an invoice from picking by clicking on "Create Invoice" wizard - !python {model: stock.invoice.onshipping}: | + import time pur_obj=self.pool.get('purchase.order') pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2")) pick_ids = [x.id for x in pur_id1.picking_ids] - id = self.create(cr, uid, {'invoice_date': '2010-05-11', 'journal_id': ref('account.expenses_journal')}, + id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.expenses_journal')}, {'active_ids': pick_ids}) self.create_invoice(cr, uid, [id], {"active_ids": pick_ids, "active_id": pick_ids[0]}) - diff --git a/addons/purchase_requisition/test/purchase_requisition.yml b/addons/purchase_requisition/test/purchase_requisition.yml index c61a83a9b39..fb5fa774fc3 100755 --- a/addons/purchase_requisition/test/purchase_requisition.yml +++ b/addons/purchase_requisition/test/purchase_requisition.yml @@ -2,10 +2,10 @@ - In order to test the purchase requisition module, I will do a sale order -> purchase_requisition -> purchase flow and I will buy the required products at two different suppliers. -- +- I start by creating a new product 'Laptop ACER', which is purchased at Asustek, in MTO, with the generation of purchase requisitions. -- +- !record {model: product.product, id: product_product_laptopacer0}: categ_id: product.product_category_3 cost_method: standard @@ -26,12 +26,12 @@ warranty: 0.0 weight: 0.0 weight_net: 0.0 - list_price: 100.0 -- + list_price: 100.0 +- Then I sell 5 Laptop ACER to the customer Agrolait, sale order TEST/TENDER/0001. -- +- !record {model: sale.order, id: sale_order_testtender0}: - date_order: '2010-05-10' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: TEST/TENDER/0001 order_line: @@ -53,43 +53,43 @@ picking_policy: direct pricelist_id: product.list0 shop_id: sale.shop -- +- I confirm the sale order. -- +- !workflow {model: sale.order, action: order_confirm, ref: sale_order_testtender0} -- +- I launch the scheduler to compute all procurements, and specify all requisitions orders. -- +- !python {model: procurement.order.compute.all}: | proc_obj = self.pool.get('procurement.order') proc_obj._procure_confirm(cr,uid) - On the purchase requisition, I create a new purchase order for the supplier 'DistriPC' by clicking on - the button 'New RfQ'. This opens a window to ask me the supplier and I set DistriPC . -- + the button 'New RfQ'. This opens a window to ask me the supplier and I set DistriPC . +- !record {model: purchase.requisition.partner, id: purchase_requisition_partner_0}: partner_address_id: base.res_partner_address_7 partner_id: base.res_partner_4 -- +- I create a new purchase order. -- +- !python {model: purchase.requisition.partner}: | req_obj = self.pool.get('purchase.requisition') ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER')]) self.create_order(cr, uid, [ref("purchase_requisition_partner_0")], {"lang": 'en_US', "active_model": "purchase.requisition", "tz": False, "record_id": 1, "active_ids": ids, "active_id": ids[0], }) - + - - I check that I have two purchase orders on the purchase requisition. + I check that I have two purchase orders on the purchase requisition. - !python {model: purchase.order}: | - from tools.translate import _ + from tools.translate import _ order_ids =self.search(cr, uid, [('origin','=','TEST/TENDER/0001')]) ids=len(order_ids) - assert(ids == 2), _('Purchase Order not Created') + assert(ids == 2), _('Purchase Order not Created') -- +- I set the purchase requisition as 'Not Exclusive'. - !python {model: purchase.requisition}: | @@ -98,49 +98,49 @@ - I change the quantities so that the purchase order for DistriPC includes 3 pieces and the purchase order for Asustek includes 2 pieces. -- +- !python {model: purchase.order}: | - line_obj=self.pool.get('purchase.order.line') - partner_obj=self.pool.get('res.partner') + line_obj=self.pool.get('purchase.order.line') + partner_obj=self.pool.get('res.partner') requistion_obj=self.pool.get('purchase.requisition') - requistion_ids =requistion_obj.search(cr, uid, [('origin','=','Laptop ACER')]) - partner_id1=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0] - partner_id2=partner_obj.search(cr,uid,[('name','=','Distrib PC')])[0] + requistion_ids =requistion_obj.search(cr, uid, [('origin','=','Laptop ACER')]) + partner_id1=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0] + partner_id2=partner_obj.search(cr,uid,[('name','=','Distrib PC')])[0] purchase_id1= self.search(cr, uid, [('partner_id','=',partner_id1),('requisition_id','in',requistion_ids)]) purchase_id2= self.search(cr, uid, [('partner_id','=',partner_id2),('requisition_id','in',requistion_ids)]) order_line1=self.browse(cr, uid, purchase_id1, context)[0].order_line[0].id order_line2=self.browse(cr, uid, purchase_id2, context)[0].order_line[0].id line_obj.write(cr, uid, order_line1, {'product_qty':2}) - line_obj.write(cr, uid, order_line2, {'product_qty':3}) + line_obj.write(cr, uid, order_line2, {'product_qty':3}) - I confirm and validate both purchase orders. - !python {model: purchase.order}: | order_ids= self.search(cr, uid, []) import netsvc - wf_service = netsvc.LocalService("workflow") - for id in order_ids: - wf_service.trg_validate(uid, 'purchase.order',id,'purchase_confirm', cr) - wf_service.trg_validate(uid, 'purchase.order',id,'purchase_approve', cr) + wf_service = netsvc.LocalService("workflow") + for id in order_ids: + wf_service.trg_validate(uid, 'purchase.order',id,'purchase_confirm', cr) + wf_service.trg_validate(uid, 'purchase.order',id,'purchase_approve', cr) - I check that the delivery order of the customer is in state 'Waiting Goods'. - !python {model: stock.picking }: | - from tools.translate import _ + from tools.translate import _ picking_id = self.search(cr, uid, [('origin','=','TEST/TENDER/0001')]) if picking_id: pick=self.browse(cr,uid,picking_id[0]) assert (pick.state =='confirmed'),_('Picking is not in confirm state.') - assert (pick.move_lines[0].state == 'waiting'), _('Stock Move is not Waiting state.') - + assert (pick.move_lines[0].state == 'waiting'), _('Stock Move is not Waiting state.') + - I receive the order of the supplier Asustek from the Incoming Products menu. - !python {model: stock.picking }: | import time - partner_obj=self.pool.get('res.partner') + partner_obj=self.pool.get('res.partner') order_obj=self.pool.get('purchase.order') - partner_id=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0] + partner_id=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0] picking_id = self.search(cr, uid, [('address_id.partner_id','=',partner_id),('type','=','in')]) if picking_id: pick=self.browse(cr,uid,picking_id[0]) @@ -154,14 +154,14 @@ 'product_id': move.product_id.id, 'product_qty': move.product_qty, 'product_uom': move.product_uom.id, - } + } self.do_partial(cr, uid, picking_id,partial_datas) - I receive the order of the supplier DistriPC from the Incoming Shipments menu. -- +- !python {model: stock.picking }: | import time - partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0] + partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0] picking_id = self.search(cr, uid, [('address_id.partner_id','=',partner_id),('type','=','in')]) if picking_id: pick=self.browse(cr,uid,picking_id[0]) @@ -175,7 +175,7 @@ 'product_id': move.product_id.id, 'product_qty': move.product_qty, 'product_uom': move.product_uom.id, - } + } self.do_partial(cr, uid, picking_id,partial_datas) - I check that the delivery order of the customer is in the state Available. diff --git a/addons/purchase_requisition/test/purchase_requisition_exclusive.yml b/addons/purchase_requisition/test/purchase_requisition_exclusive.yml index 7e798e59b35..1ab9bca9493 100755 --- a/addons/purchase_requisition/test/purchase_requisition_exclusive.yml +++ b/addons/purchase_requisition/test/purchase_requisition_exclusive.yml @@ -3,7 +3,7 @@ purchase flow and I will buy the required products at two different suppliers. - I start by creating a new product 'Laptop ACER', which is purchased at Asustek, in MTO, - with the generation of purchase requisitions. + with the generation of purchase requisitions. - !record {model: product.product, id: product_product_laptopacer1}: categ_id: product.product_category_3 @@ -17,16 +17,16 @@ - delay: 1 name: base.res_partner_asus qty: 5.0 - min_qty: 1.0 + min_qty: 1.0 supply_method: buy type: product uom_id: product.product_uom_unit - uom_po_id: product.product_uom_unit -- + uom_po_id: product.product_uom_unit +- Then I sell 5 Laptop ACER to the customer Agrolait, sale order TEST/TENDER/0002 -- +- !record {model: sale.order, id: sale_order_testtender1}: - date_order: '2010-04-20' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: TEST/TENDER/0002 order_line: @@ -45,21 +45,21 @@ partner_shipping_id: base.res_partner_address_8 picking_policy: direct pricelist_id: product.list0 - shop_id: sale.shop -- + shop_id: sale.shop +- I confirm sale order. -- +- !workflow {model: sale.order, action: order_confirm, ref: sale_order_testtender1} -- +- I launch the scheduler to compute all procurements, and planify all requisitions orders. -- +- !python {model: procurement.order.compute.all}: | proc_obj = self.pool.get('procurement.order') proc_obj._procure_confirm(cr,uid) - I should find a purchase requisition with the origin 'TEST/TENDER/0002', that includes a request for 5 Laptop ACER, and a purchase order on the default supplier for this product. -- +- !python {model: purchase.requisition}: | requisition_ids =self.search(cr, uid, [('origin','=','Laptop ACER1')]) ids=len(requisition_ids) @@ -67,15 +67,15 @@ - On the purchase requisition, I create a new purchase order for the supplier 'DistriPC' by clicking on the button 'New Request for Quotation'. This opens a window to ask me the supplier and I set DistriPC . -- +- I Create purchase.requisition.partner . -- +- !record {model: purchase.requisition.partner, id: purchase_requisition_partner_0}: partner_address_id: base.res_partner_address_7 partner_id: base.res_partner_4 -- +- I create a new purchase order for the supplier 'DistriPC'. -- +- !python {model: purchase.requisition.partner}: | req_obj = self.pool.get('purchase.requisition') ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')]) @@ -83,31 +83,31 @@ 'en_US', "active_model": "purchase.requisition", "tz": False, "record_id": 1, "active_ids": ids, "active_id": ids[0], }) - - I set the purchase requisition as 'Exclusive' -- + I set the purchase requisition as 'Exclusive' +- !python {model: purchase.requisition}: | ids =self.search(cr, uid, [('origin','=','Laptop ACER1')]) self.write(cr,uid,ids[0],{'exclusive': 'exclusive' }) - - I confirm and validate the Request for Quotation of ASUStek. + I confirm and validate the Request for Quotation of ASUStek. - !python {model: purchase.order}: | partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0] req_obj = self.pool.get('purchase.requisition') - ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')]) + ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')]) purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0] import netsvc - wf_service = netsvc.LocalService("workflow") + wf_service = netsvc.LocalService("workflow") if purchase_id: wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_confirm', cr) - wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_approve', cr) + wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_approve', cr) - I check that Request for Quotation of DistriPC is cancelled. -- +- !python {model: purchase.order}: | partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0] req_obj = self.pool.get('purchase.requisition') - ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')]) + ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')]) purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0] state=self.browse(cr,uid,purchase_id).state assert (state=='cancel') diff --git a/addons/sale/test/advance_invoice.yml b/addons/sale/test/advance_invoice.yml index b4a985ec4e8..d582a7c3e37 100755 --- a/addons/sale/test/advance_invoice.yml +++ b/addons/sale/test/advance_invoice.yml @@ -1,9 +1,9 @@ - In order to test the Deposit wizard of sale module in the Open-ERP, I create a Sale Order for LG Viewty Smart for qty 100 having order_policy manual. -- +- !record {model: sale.order, id: sale_order_so5}: - date_order: '2010-07-17' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order order_line: - name: LG Viewty Smart @@ -26,14 +26,14 @@ shop_id: sale.shop - I use the Advance Payment wizard. -- +- !record {model: sale.advance.payment.inv, id: sale_advance_payment_inv_0}: amount: 1000.0 product_id: product.product_product_pc3 qtty: 3.0 -- +- Then I click on the "Create Partial Invoice" button -- +- !python {model: sale.advance.payment.inv}: | self.create_invoices(cr, uid, [ref("sale_advance_payment_inv_0")], {"lang": 'en_US', "active_model": 'sale.order', "active_ids": [ref("sale_order_so5")], "tz": @@ -43,8 +43,8 @@ - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so5")) - assert so.invoice_ids, "Invoices has not been generated for sale_order_so5" -- + assert so.invoice_ids, "Invoices has not been generated for sale_order_so5" +- I open the Invoice for the SO. - !python {model: account.invoice}: | @@ -91,18 +91,18 @@ assert(sale_id.invoiced == True), "Paid has not been set to true" - I confirm the Sale Order. -- +- !workflow {model: sale.order, action: order_confirm, ref: sale_order_so5} - I click on "Create Invoice" button of Sales order to create the invoice. -- +- !workflow {model: sale.order, action: manual_invoice, ref: sale_order_so5} - I verify whether the invoice has been generated for SO - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so5")) - assert so.invoice_ids[1], "Invoices has not been generated for sale_order_so5" + assert so.invoice_ids[1], "Invoices has not been generated for sale_order_so5" - I open the Invoice for the SO. - @@ -124,7 +124,7 @@ assert invoice_id, "Invoice is not in the open state" - I assign an analytic journal to the bank journal -- +- !record {model: account.journal, id: sale.account_journal_bankjournal0}: analytic_journal_id: account.cose_journal_sale - diff --git a/addons/sale/test/invoice_on_ordered_qty.yml b/addons/sale/test/invoice_on_ordered_qty.yml index 96154f3cac8..785b2d8835e 100755 --- a/addons/sale/test/invoice_on_ordered_qty.yml +++ b/addons/sale/test/invoice_on_ordered_qty.yml @@ -1,10 +1,10 @@ - In order to test the Sale module in OpenERP, - I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Shipping & Manual Invoice' and Invoice on 'Ordered quantities' + I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Shipping & Manual Invoice' and Invoice on 'Ordered quantities' in order to create an invoice based on the ordered quantity - !record {model: sale.order, id: sale_order_so9}: - date_order: '2010-07-17' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO006 order_line: @@ -26,13 +26,13 @@ picking_policy: direct pricelist_id: product.list0 shop_id: sale.shop -- +- I confirm the Sale Order. -- +- !workflow {model: sale.order, action: order_confirm, ref: sale_order_so9} - I verify that the picking has been generated for the sale order -- +- !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so9")) assert so.picking_ids,"Picking has not been generated for sale_order_so9" @@ -40,10 +40,10 @@ Then I confirm the picking - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: '2010-07-17 17:52:09' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - Then I done the picking -- +- !python {model: stock.picking }: | import time sale_order_obj = self.pool.get('sale.order') @@ -62,11 +62,11 @@ 'product_id': move.product_id.id, 'product_qty': '100', 'product_uom': move.product_uom.id, - } + } self.do_partial(cr, uid, [pick.id],partial_datas) - I click on Create Invoice button to create the invoice. -- +- !workflow {model: sale.order, action: manual_invoice, ref: sale_order_so9} - I verify whether the invoice has been generated for SO @@ -87,7 +87,7 @@ for inv_lines in inv_brw.invoice_line: qty1 = inv_lines.quantity assert qty1==qty, "Quantities are not same" -- +- I open the Invoice for the SO. - !python {model: account.invoice}: | @@ -100,7 +100,7 @@ wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr) - Assign analytic journal into bank journal -- +- !record {model: account.journal, id: sale.account_journal_bankjournal0}: analytic_journal_id: account.cose_journal_sale - @@ -116,7 +116,7 @@ ref('account.period_8'), ref('sale.account_journal_bankjournal0'), name='test') - - I verify the invoice are in paid state or not. + I verify the invoice are in paid state or not. - !python {model: account.invoice}: | sale_order_obj = self.pool.get('sale.order') diff --git a/addons/sale/test/invoice_on_shipped_qty.yml b/addons/sale/test/invoice_on_shipped_qty.yml index fb217302ce4..bf2795e0f5b 100755 --- a/addons/sale/test/invoice_on_shipped_qty.yml +++ b/addons/sale/test/invoice_on_shipped_qty.yml @@ -3,7 +3,7 @@ I create a Sale Order for Slider Mobile for 200 quantity having Shipping Policy 'Invoice from Picking' and Invoice on 'Shipped quantities' - !record {model: sale.order, id: sale_order_so6}: - date_order: '2010-07-17' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO006BIS order_line: @@ -25,13 +25,13 @@ picking_policy: direct pricelist_id: product.list0 shop_id: sale.shop -- +- I confirm the Sale Order. -- +- !workflow {model: sale.order, action: order_confirm, ref: sale_order_so6} - I verify that the picking has been generated for the sale order -- +- !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so6")) assert so.picking_ids,"Picking has not been generated for sale_order_so6" @@ -39,10 +39,10 @@ Then I click on the "Product Sent" button of Outgoing Shipments - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: '2010-07-17 17:52:09' -- + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') +- I change the quantity on the picking to 199, and confirm partially 100 PCE. -- +- !python {model: stock.picking }: | import time sale_order_obj = self.pool.get('sale.order') @@ -69,10 +69,11 @@ Then I click on 'Create Invoices' button - !python {model: stock.invoice.onshipping}: | - sale_obj = self.pool.get('sale.order') + import time + sale_obj = self.pool.get('sale.order') sale_id = sale_obj.browse(cr, uid, ref("sale_order_so6")) ids = [x.id for x in sale_id.picking_ids] - wiz_id = self.create(cr, uid, {'invoice_date': '2010-07-17', 'journal_id': ref('account.sales_journal')}, + wiz_id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.sales_journal')}, {'active_ids': ids}) self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids, "active_id": ids[0]}) - @@ -98,7 +99,7 @@ for inv_lines in inv_brw.invoice_line: qty1=inv_lines.quantity assert (qty1 == qty), "Quantities are not the same" -- +- I open the Invoice for the SO. - !python {model: account.invoice}: | @@ -111,7 +112,7 @@ wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr) - Assign analytic journal into bank journal -- +- !record {model: account.journal, id: sale.account_journal_bankjournal0}: analytic_journal_id: account.cose_journal_sale - @@ -127,7 +128,7 @@ ref('account.period_8'), ref('sale.account_journal_bankjournal0'), name='test') - - I verify the invoice are in paid state or not. + I verify the invoice are in paid state or not. - !python {model: account.invoice}: | sale_order_obj = self.pool.get('sale.order') diff --git a/addons/sale/test/manual_order_policy.yml b/addons/sale/test/manual_order_policy.yml index 74fb95b19f7..c1535402f9b 100755 --- a/addons/sale/test/manual_order_policy.yml +++ b/addons/sale/test/manual_order_policy.yml @@ -3,7 +3,7 @@ I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Shipping & Manual Invoice' - !record {model: sale.order, id: sale_order_so0}: - date_order: '2010-07-17' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO002 order_line: @@ -208,7 +208,7 @@ Then I click on the "Products Received" button of Incoming Shipments - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: '2010-07-17 17:52:09' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - I click on the "Validate" button - diff --git a/addons/sale/test/picking_order_policy.yml b/addons/sale/test/picking_order_policy.yml index de18c1c4426..4381c78f010 100755 --- a/addons/sale/test/picking_order_policy.yml +++ b/addons/sale/test/picking_order_policy.yml @@ -3,7 +3,7 @@ I create a Sale Order for Slider Mobile for qty 500 having Shipping Policy is 'Invoice from Picking' - !record {model: sale.order, id: sale_order_so7}: - date_order: '2010-07-15' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO007 order_line: @@ -31,7 +31,7 @@ !workflow {model: sale.order, action: order_confirm, ref: sale_order_so7} - I verify that picking has been generated for the sale order. -- +- !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so7")) assert so.picking_ids,"Picking has not been generated for sale_order_so7" @@ -62,10 +62,11 @@ Then I click on 'Create Invoices' button - !python {model: stock.invoice.onshipping}: | - sale_obj=self.pool.get('sale.order') + import time + sale_obj=self.pool.get('sale.order') sale_id=sale_obj.browse(cr, uid, ref("sale_order_so7")) ids = [x.id for x in sale_id.picking_ids] - wiz_id = self.create(cr, uid, {'invoice_date': '2010-07-15', 'journal_id': ref('account.sales_journal')}, + wiz_id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.sales_journal')}, {'active_ids': ids}) self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids, "active_id": ids[0]}) - @@ -87,7 +88,7 @@ wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr) - Assign analytic journal into bank journal -- +- !record {model: account.journal, id: sale.account_journal_bankjournal0}: analytic_journal_id: account.cose_journal_sale - @@ -179,7 +180,7 @@ pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)]) for pur in pur_ids: wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_confirm', cr) -- +- I click on the "Approved by supplier" button to approve the purchase order - !python {model: sale.order}: | @@ -196,7 +197,7 @@ for pur in pur_ids: wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr) - - I verify that a picking related to purchase order has been generated. + I verify that a picking related to purchase order has been generated. - !python {model: sale.order}: | modules = self.pool.get('ir.module.module') @@ -208,11 +209,11 @@ pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) po = pur_obj.browse(cr, uid, pur_id)[0] assert(po.picking_ids),"Picking for purchase order has not been generated" -- +- Then I click on the "Products Received" button of Incoming Shipments - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: '2010-07-15 17:52:09' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - I click on the "Validate" button - @@ -276,8 +277,8 @@ 'product_id': move.product_id.id, 'product_qty': move.product_qty, 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) + } + self.do_partial(cr, uid, [pick.id],partial_datas) - I verify that delivery state is done - @@ -289,12 +290,12 @@ pick = self.browse(cr,uid,picking_id[0]) assert (pick.state) =='done', "Picking for SO is not in done state." - - I verify that a "Picked" has been set to true + I verify that a "Picked" has been set to true - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so7")) assert (so.shipped == True), "Picked has not been set to True" -- +- I verify that a sale order is in done state - !python {model: sale.order}: | diff --git a/addons/sale/test/postpaid_order_policy.yml b/addons/sale/test/postpaid_order_policy.yml index bbd015d726b..330c6d17308 100755 --- a/addons/sale/test/postpaid_order_policy.yml +++ b/addons/sale/test/postpaid_order_policy.yml @@ -3,7 +3,7 @@ I create a Sale Order for Slider Mobile for qty 500 having Shipping Policy is 'Invoice on order after Delivery' - !record {model: sale.order, id: sale_order_so8}: - date_order: '2010-07-15' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO008 order_line: @@ -24,19 +24,19 @@ picking_policy: direct pricelist_id: product.list0 shop_id: sale.shop -- +- I confirm the Sale Order. -- - !workflow {model: sale.order, action: order_confirm, ref: sale_order_so8} +- + !workflow {model: sale.order, action: order_confirm, ref: sale_order_so8} - I verify that the picking has been generated for the sale order -- +- !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so8")) assert so.picking_ids,"Picking has not been generated for sale_order_so8" - Then I done the picking -- +- !python {model: stock.picking }: | import time sale_order_obj = self.pool.get('sale.order') @@ -55,7 +55,7 @@ 'product_id': move.product_id.id, 'product_qty': move.product_qty, 'product_uom': move.product_uom.id, - } + } self.do_partial(cr, uid, [pick.id],partial_datas) - I verify that picking order is in done state. @@ -66,7 +66,7 @@ picking_id = self.search(cr, uid, [('origin','=',so.name),('type','=','out')]) if picking_id: pick = self.browse(cr,uid,picking_id[0]) - assert (pick.state == 'done'), "Picking for SO is not in done state." + assert (pick.state == 'done'), "Picking for SO is not in done state." - I verify that delivery order has been generated for sale order - @@ -96,8 +96,8 @@ 'product_id': move.product_id.id, 'product_qty': move.product_qty, 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) + } + self.do_partial(cr, uid, [pick.id],partial_datas) - I verify that delivery state is done - @@ -170,7 +170,7 @@ pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)]) for pur in pur_ids: wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_confirm', cr) -- +- I click on the "Approved by supplier" button to approve the purchase order - !python {model: sale.order}: | @@ -187,7 +187,7 @@ for pur in pur_ids: wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr) - - I verify that a picking related to purchase order has been generated. + I verify that a picking related to purchase order has been generated. - !python {model: sale.order}: | modules = self.pool.get('ir.module.module') @@ -199,11 +199,11 @@ pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) po = pur_obj.browse(cr, uid, pur_id)[0] assert(po.picking_ids),"Picking for purchase order has not been generated" -- +- Then I click on the "Products Received" button of Incoming Shipments - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: '2010-07-15 17:52:09' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - I click on the "Validate" button - @@ -239,7 +239,7 @@ ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')]) assert ids, _('Picking is not in the done state!') - - I verify that a "Picked" has been set to true + I verify that a "Picked" has been set to true - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so8")) @@ -250,20 +250,20 @@ !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so8")) assert so.invoice_ids, "Invoice has not been generated" -- +- I open the Invoice for the SO. -- +- !python {model: account.invoice}: | sale_order_obj = self.pool.get('sale.order') so = sale_order_obj.browse(cr, uid, ref("sale_order_so8")) import netsvc - wf_service = netsvc.LocalService("workflow") + wf_service = netsvc.LocalService("workflow") invoice_ids = so.invoice_ids for invoice in invoice_ids: - wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr) + wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr) - Assign analytic journal into bank journal -- +- !record {model: account.journal, id: sale.account_journal_bankjournal0}: analytic_journal_id: account.cose_journal_sale - @@ -279,7 +279,7 @@ ref('account.period_8'), ref('sale.account_journal_bankjournal0'), name='test') - - I verify the invoice are in paid state or not. + I verify the invoice are in paid state or not. - !python {model: account.invoice}: | modules = self.pool.get('ir.module.module') @@ -291,13 +291,13 @@ invoice_ids = so.invoice_ids for invoice in invoice_ids: assert (invoice.state) =='paid', "Invoice for SO is not in done state." -- +- I verify that Paid has been set to true. - !python {model: sale.order}: | sale_id=self.browse(cr, uid, ref("sale_order_so8")) assert(sale_id.invoiced == True), "Paid has not been set to true" -- +- I verify that sale order is in done state - !python {model: sale.order}: | diff --git a/addons/sale/test/prepaid_order_policy.yml b/addons/sale/test/prepaid_order_policy.yml index 5df007d1465..4bf132e5bee 100755 --- a/addons/sale/test/prepaid_order_policy.yml +++ b/addons/sale/test/prepaid_order_policy.yml @@ -1,8 +1,8 @@ -- +- I create a Sale Order for LG Viewty Smart for qty 500 having Shipping Policy is 'Payment Before Delivery' - !record {model: sale.order, id: sale_order_so1}: - date_order: '2010-07-20' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO001 order_line: @@ -55,7 +55,7 @@ wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr) - I assign an analytic journal to the Bank journal -- +- !record {model: account.journal, id: sale.account_journal_bankjournal0}: analytic_journal_id: account.cose_journal_sale - @@ -71,7 +71,7 @@ ref('account.period_5'), ref('sale.account_journal_bankjournal0'), name='test002') - - I verify the invoice is in done state or not. + I verify the invoice is in done state or not. - !python {model: account.invoice}: | sale_order_obj = self.pool.get('sale.order') @@ -133,7 +133,7 @@ assert proc_ids, _('No Procurements!') - Then I click on the "Run Procurement" button -- +- !python {model: procurement.order}: | sale_order_obj = self.pool.get('sale.order') so = sale_order_obj.browse(cr, uid, ref("sale_order_so1")) @@ -168,7 +168,7 @@ pur_obj=self.pool.get('purchase.order') pur_id=pur_obj.search(cr, uid, [('origin','=',so.name)]) assert pur_id, _('Purchase order has not been generated') -- +- I click on the "Confirm" button to confirm the purchase order - !python {model: sale.order}: | @@ -184,7 +184,7 @@ pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)]) for pur in pur_ids: wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_confirm', cr) -- +- I click on the "Approved by supplier" button to approve the purchase order - !python {model: sale.order}: | @@ -199,9 +199,9 @@ wf_service = netsvc.LocalService("workflow") pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)]) for pur in pur_ids: - wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr) + wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr) - - I verify that a picking related to purchase order has been generated. + I verify that a picking related to purchase order has been generated. - !python {model: sale.order}: | modules = self.pool.get('ir.module.module') @@ -217,7 +217,7 @@ Then I click on the "Products Received" button of Incoming Shipments - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: '2010-07-20 17:52:09' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - I click on the "Validate" button - @@ -253,7 +253,7 @@ ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')]) assert ids, _('Picking is not in the done state!') - - I verify that a "Picked" has been set to true + I verify that a "Picked" has been set to true - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so1")) diff --git a/addons/sale/test/sale_procurement.yml b/addons/sale/test/sale_procurement.yml index f7753948339..923860ebfd3 100755 --- a/addons/sale/test/sale_procurement.yml +++ b/addons/sale/test/sale_procurement.yml @@ -25,7 +25,7 @@ uom_po_id: product.product_uom_kgm - I define Minimum stock rule for my stockable product Wood (qty between 10 and 15) -- +- !record {model: stock.warehouse.orderpoint, id: stock_warehouse_orderpoint_op0}: company_id: base.main_company location_id: stock.stock_location_stock @@ -38,11 +38,11 @@ warehouse_id: stock.warehouse0 - Now I make a sale order for table. -- +- !record {model: sale.order, id: sale_order_so3}: amount_total: 5.0 amount_untaxed: 5.0 - date_order: '2010-04-30' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order order_line: - company_id: base.main_company @@ -65,7 +65,7 @@ shop_id: sale.shop - I confirm the order. -- +- !workflow {model: sale.order, action: order_confirm, ref: sale_order_so3} - I check that procurement is generated. @@ -76,7 +76,7 @@ so = sale_order_obj.browse(cr, uid, ref("sale_order_so3")) proc_ids = self.search(cr, uid, [('origin','=',so.name)]) assert proc_ids, _('No Procurements!') -- +- I run the scheduler. - !function {model: procurement.order, name: run_scheduler}: diff --git a/addons/sale/test/so_make_invoice.yml b/addons/sale/test/so_make_invoice.yml index 053521208bf..727731b4745 100755 --- a/addons/sale/test/so_make_invoice.yml +++ b/addons/sale/test/so_make_invoice.yml @@ -5,7 +5,7 @@ I create a Sale Order for Slider Mobile for qty 100 having order_policy manual. - !record {model: sale.order, id: sale_order_so3}: - date_order: '2010-08-02' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO003 order_line: @@ -34,7 +34,7 @@ I create a Sale Order for products Slider Mobile and LG Viewty Smart for qty 100 having order_policy manual. - !record {model: sale.order, id: sale_order_so4}: - date_order: '2010-08-02' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO004 order_line: @@ -74,7 +74,7 @@ - !record {model: sale.make.invoice, id: sale_make_invoice_1}: grouped: 1 - invoice_date: '2010-08-02' + invoice_date: !eval time.strftime('%Y-%m-%d') - Then I click on the "Create Invoices" button of wizard - diff --git a/addons/sale/test/so_make_line_invoice.yml b/addons/sale/test/so_make_line_invoice.yml index d5e81c9e96c..14d405b0083 100755 --- a/addons/sale/test/so_make_line_invoice.yml +++ b/addons/sale/test/so_make_line_invoice.yml @@ -3,7 +3,7 @@ I create a Sale Order for two products LG Viewty Smart and Slider mobile for qty 100 having order_policy manual. - !record {model: sale.order, id: sale_order_so3}: - date_order: '2010-07-12' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO003 order_line: @@ -27,7 +27,7 @@ product_id: sale.product_product_lgviewtysmart0 product_uos_qty: 100.0 th_weight: 0.0 - type: make_to_order + type: make_to_order order_policy: manual partner_id: sale.res_partner_cleartrail0 partner_invoice_id: sale.res_partner_address_2 @@ -36,9 +36,9 @@ picking_policy: direct pricelist_id: product.list0 shop_id: sale.shop -- +- I confirm the Sale Order. -- +- !workflow {model: sale.order, action: order_confirm, ref: sale_order_so3} - I click on the "Make Invoice" button of sale order line @@ -47,11 +47,11 @@ {} - I click on the "Create Invoice" button of wizard -- +- !python {model: sale.order.line.make.invoice}: | sale_order_obj = self.pool.get('sale.order') so = sale_order_obj.browse(cr, uid, ref("sale_order_so3")) - sol = so.order_line[0] + sol = so.order_line[0] self.make_invoices(cr, uid, [ref("sale_order_line_make_invoice_0")], {"lang": "en_US", "tz": False, "active_model": "sale.order.line", "active_ids": [sol.id], "search_default_uninvoiced": 1, "active_id": sol.id, @@ -61,7 +61,7 @@ - !python {model: sale.order}: | sale_id=self.browse(cr, uid, ref("sale_order_so3")) - sol = sale_id.order_line[0] + sol = sale_id.order_line[0] assert(sol.invoiced == True), "Invoiced has not been set to true" - I verify that an invoice for sale order line has been created. @@ -90,7 +90,7 @@ assert invoice_id, "Invoice is not in the open state" - I assign an analytic journal to the bank journal -- +- !record {model: account.journal, id: sale.account_journal_bankjournal0}: analytic_journal_id: account.cose_journal_sale - @@ -106,7 +106,7 @@ ref('account.period_8'), ref('sale.account_journal_bankjournal0'), name='test') - - I verify that an invoice is in done state. + I verify that an invoice is in done state. - !python {model: account.invoice}: | sale_order_obj = self.pool.get('sale.order') @@ -123,14 +123,14 @@ I create an invoice for another sale order line. I click on the "Make Invoice" button of sale order line - !record {model: sale.order.line.make.invoice, id: sale_order_line_make_invoice_1}: - {} + {} - I click on the "Create Invoice" button of wizard - !python {model: sale.order.line.make.invoice}: | sale_order_obj = self.pool.get('sale.order') so = sale_order_obj.browse(cr, uid, ref("sale_order_so3")) - sol = so.order_line[1] + sol = so.order_line[1] self.make_invoices(cr, uid, [ref("sale_order_line_make_invoice_1")], {"lang": "en_US", "tz": False, "active_model": "sale.order.line", "active_ids": [sol.id], "search_default_uninvoiced": 1, "active_id": sol.id, @@ -146,7 +146,7 @@ - !python {model: sale.order}: | sale_id=self.browse(cr, uid, ref("sale_order_so3")) - sol = sale_id.order_line[1] + sol = sale_id.order_line[1] assert(sol.invoiced == True), "Invoiced has not been set to true" - I verify that "Paid" has been set to False. @@ -175,7 +175,7 @@ assert invoice_id, "Invoice is not in the open state" - Assign analytic journal into bank journal -- +- !record {model: account.journal, id: sale.account_journal_bankjournal0}: analytic_journal_id: account.cose_journal_sale - @@ -191,7 +191,7 @@ ref('account.period_8'), ref('sale.account_journal_bankjournal0'), name='test') - - I verify the invoice is in done state. + I verify the invoice is in done state. - !python {model: account.invoice}: | sale_order_obj = self.pool.get('sale.order') diff --git a/addons/sale_margin/test/sale_margin.yml b/addons/sale_margin/test/sale_margin.yml index c15ea3c2135..75eabce03b1 100755 --- a/addons/sale_margin/test/sale_margin.yml +++ b/addons/sale_margin/test/sale_margin.yml @@ -5,7 +5,7 @@ I place a sale order for product keyboard, quantity 50 - !record {model: sale.order, id: sale_order_so11}: - date_order: '2010-08-04' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO011 order_line: @@ -36,4 +36,4 @@ - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so11")) - assert so.margin, "No margin !" + assert so.margin, "No margin !" diff --git a/addons/sale_mrp/test/sale_mrp.yml b/addons/sale_mrp/test/sale_mrp.yml index 081b65e4611..739eea0d99d 100755 --- a/addons/sale_mrp/test/sale_mrp.yml +++ b/addons/sale_mrp/test/sale_mrp.yml @@ -5,9 +5,9 @@ - !record {model: product.category, id: product_category_allproductssellable0}: name: Mobile Products Sellable -- - I define product category Mobile Services. -- +- + I define product category Mobile Services. +- !record {model: product.category, id: product_category_services0}: name: Mobile Services - @@ -64,7 +64,7 @@ - !record {model: sale.order, id: sale_order_so0}: client_order_ref: ref1 - date_order: '2010-08-4' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: Test_SO001 order_line: diff --git a/addons/stock/test/stock_test.yml b/addons/stock/test/stock_test.yml index 696dd0900c6..762908e6b0c 100755 --- a/addons/stock/test/stock_test.yml +++ b/addons/stock/test/stock_test.yml @@ -2,56 +2,56 @@ - In order to test the stock module, I will create product, create physical inventory ,fill inventory lines from location,split inventory line into production lot - -- + +- I create Asset Account Type. -- +- !record {model: account.account.type, id: account_account_type_asset0}: close_method: balance code: asset name: Asset sign: 1 - -- + +- I create Income Account Type. -- +- !record {model: account.account.type, id: account_account_type_income0}: close_method: unreconciled code: income name: Income sign: 1 - - -- + + +- I create Expense Account Type. -- +- !record {model: account.account.type, id: account_account_type_expense0}: close_method: unreconciled code: expense name: Expense - sign: 1 -- + sign: 1 +- I create Cash Account Type. -- +- !record {model: account.account.type, id: account_account_type_cash0}: close_method: balance code: cash name: Cash sign: 1 - - -- + + +- I create Receivable Account Type. -- +- !record {model: account.account.type, id: account_account_type_receivable0}: close_method: balance code: receivable name: Receivable sign: 1 - - + I create Receivable Account . -- +- !record {model: account.account, id: account_account_receivable0}: code: '40000-stock-test' company_id: base.main_company @@ -61,9 +61,9 @@ parent_right: 2 type: receivable user_type: account_account_type_receivable0 -- +- I create Payable Account. -- +- !record {model: account.account, id: account_account_payable0}: code: '440000-stock-test' company_id: base.main_company @@ -72,10 +72,10 @@ parent_left: 3 parent_right: 4 type: payable - user_type: account_account_type_expense0 -- + user_type: account_account_type_expense0 +- I create Purchase Journal. -- +- !record {model: account.journal, id: account_journal_purchasejournal0}: code: pur company_id: base.main_company @@ -83,10 +83,10 @@ sequence_id: account.sequence_purchase_journal type: purchase view_id: account.account_journal_bank_view - -- + +- I create Sale Journal. -- +- !record {model: account.journal, id: account_journal_salejouran0}: code: sal company_id: base.main_company @@ -94,10 +94,10 @@ sequence_id: account.sequence_sale_journal type: sale view_id: account.account_journal_view - -- + +- I create Expense Account. -- +- !record {model: account.account, id: account_account_expenseaccount0}: code: Expe company_id: base.main_company @@ -107,9 +107,9 @@ parent_right: 6 type: consolidation user_type: account_account_type_asset0 -- +- I create Product Sale Account. -- +- !record {model: account.account, id: account_account_productsale0}: code: '001-stock-test' company_id: base.main_company @@ -117,11 +117,11 @@ name: Product Sale type: other user_type: stock.account_account_type_income0 - - -- + + +- I create Product Purchase Account. -- +- !record {model: account.account, id: account_account_productpurchase0}: code: '0002-stock-test' company_id: base.main_company @@ -129,64 +129,64 @@ name: Product Purchase type: other user_type: account_account_type_expense0 - -- + +- I create partner. -- +- !record {model: res.partner, id: res_partner_shawtrust0}: address: - - country_id: base.in + - country_id: base.in - street: St James House, Vicar Lane, Sheffield lang: en_US name: 'Shaw Trust ' property_account_payable: account_account_payable0 property_account_receivable: account_account_receivable0 -- +- I create partner. -- +- !record {model: res.partner, id: res_partner_diasorinltd0}: address: - country_id: base.in street: Ash House, Ash Road name: DiaSorin Ltd supplier: true - - + + - I create partner. -- +- !record {model: res.partner, id: res_partner_microlinktechnologies0}: address: - street: Kailash Vaibhav, Parksite name: Micro Link Technologies property_account_payable: account_account_payable0 - property_account_receivable: account_account_receivable0 - supplier: true - + property_account_receivable: account_account_receivable0 + supplier: true + - I create partner address. -- +- !record {model: res.partner.address, id: res_partner_address_0}: country_id: base.in partner_id: stock.res_partner_diasorinltd0 street: Ash House, Ash Road title: base.res_partner_title_miss - - -- + + +- I create product.category . -- +- !record {model: product.category, id: product_category_computer0}: name: Computer -- +- I create product HP Pavilion Desktop PCs . -- +- !record {model: product.product, id: product_product_hppaviliondesktoppcs0}: categ_id: stock.product_category_computer0 cost_method: standard mes_type: fixed - list_price: 1000.0 + list_price: 1000.0 name: HP Pavilion Desktop PCs procure_method: make_to_stock seller_ids: @@ -198,11 +198,11 @@ uom_id: product.product_uom_unit uom_po_id: product.product_uom_unit property_account_expense: account_account_productsale0 - property_account_income: account_account_productsale0 - -- + property_account_income: account_account_productsale0 + +- I create product HP CD writers. -- +- !record {model: product.product, id: product_product_hpcdwriters0}: categ_id: stock.product_category_computer0 cost_method: standard @@ -220,14 +220,14 @@ uom_po_id: product.product_uom_unit property_account_expense: account_account_productpurchase0 property_account_income: account_account_productsale0 - -- + +- I create Physical Inventory for the products. -- - !record {model: stock.inventory, id: stock_inventory_physicalinventoy0}: +- + !record {model: stock.inventory, id: stock_inventory_physicalinventoy0}: company_id: base.main_company - date: '2010-05-10 18:19:13' - date_done: '2010-05-10 18:19:59' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') + date_done: !eval time.strftime('%Y-%m-%d %H:%M:%S') inventory_line_id: - company_id: base.main_company location_id: stock.stock_location_stock @@ -241,40 +241,40 @@ product_uom: product.product_uom_unit name: Physical inventory state: draft - -- + +- I confirm the Inventory for HP CD writers. -- +- !python {model: stock.inventory}: | self.action_confirm(cr,uid,[ref('stock_inventory_physicalinventoy0')]) self.action_done(cr,uid,[ref('stock_inventory_physicalinventoy0')]) -- +- I create stock.fill.inventory . -- +- !record {model: stock.fill.inventory, id: stock_fill_inventory_0}: location_id: stock.stock_location_stock - -- + +- I fill inventory for HP CD writers. -- +- !python {model: stock.fill.inventory}: | self.fill_inventory(cr, uid, [ref("stock_fill_inventory_0")], {"lang": 'en_US', "full": "1", "tz": False, "active_model": "stock.inventory", "active_ids": [ref("stock_inventory_physicalinventoy0")], "active_id": ref("stock_inventory_physicalinventoy0"), }) -- +- I create stock.move.split record. -- +- !record {model: stock.move.split, id: stock_move_split_0}: line_ids: - name: '00001-stock-test' - quantity: 5 + quantity: 5 product_id: stock.product_product_hpcdwriters0 - -- + +- I Split into production line. -- +- !python {model: stock.move.split}: | move_obj=self.pool.get('stock.move') product_obj=self.pool.get('product.product') @@ -284,52 +284,52 @@ "stock.move", "active_ids": move_ids, "tz": False, "active_id":move_ids[0] }) - - + In Order to test the picking I create picking with move lines. -- +- !record {model: stock.picking, id: stock_picking_0}: name: test_picking address_id: base.res_partner_address_4 company_id: base.main_company - date: '2010-05-11 15:18:52' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') invoice_state: none move_lines: - company_id: base.main_company - date: '2010-05-11 15:18:57' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') location_dest_id: stock.stock_location_customers location_id: stock.stock_location_stock name: HP CD writers product_id: product.product_product_pc1 product_qty: 3.0 product_uom: product.product_uom_unit - date: '2010-05-11 15:18:57' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') product_uos_qty: 3.0 move_type: direct type: internal - - -- + + +- I click on draft_force_assign on picking. -- +- !python {model: stock.picking}: | self.draft_force_assign(cr, uid, [ref("stock_picking_0")], {"lang": "en_US", "active_model": "ir.ui.menu", "tz": False, "search_default_confirmed": 1, "contact_display": "partner", "active_ids": [ref("stock.menu_action_picking_tree6")], "active_id": ref("stock.menu_action_picking_tree6"), }) - - -- + + +- I click on force_assign on picking. -- +- !python {model: stock.picking}: | self.force_assign(cr, uid, [ref("stock_picking_0")], {"lang": "en_US", "active_model": "ir.ui.menu", "tz": False, "search_default_confirmed": 1, "contact_display": "partner", "active_ids": [ref("stock.menu_action_picking_tree6")], "active_id": ref("stock.menu_action_picking_tree6"), }) - + - I confirm the picking. -- +- !python {model: stock.picking }: | import time pick=self.browse(cr,uid,ref('stock_picking_0')) @@ -343,5 +343,5 @@ 'product_id': move.product_id, 'product_qty': move.product_qty, 'product_uom': move.product_uom.id, - } + } self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas) diff --git a/addons/stock_invoice_directly/test/stock_invoice_directly.yml b/addons/stock_invoice_directly/test/stock_invoice_directly.yml index b5ecb83caf2..6d70540b4d5 100755 --- a/addons/stock_invoice_directly/test/stock_invoice_directly.yml +++ b/addons/stock_invoice_directly/test/stock_invoice_directly.yml @@ -10,8 +10,8 @@ invoice_state: 2binvoiced move_lines: - company_id: base.main_company - date_expected: '2010-08-03 11:05:47' - date: '2010-08-03 11:05:47' + date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S') + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') location_id: stock.stock_location_stock product_id: product.product_product_pc1 product_qty: 3.0 @@ -37,19 +37,19 @@ 1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner", "active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"), }) -- +- I create a record for partial picking. -- +- !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: '2010-08-03 11:25:58' + date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - I make picking order Done. -- +- !python {model: stock.partial.picking}: | pick_obj = self.pool.get('stock.picking') partial = self.browse(cr, uid, ref('stock_partial_picking_0'), context) partial_datas = { - 'delivery_date' : partial.date + 'delivery_date' : partial.date } for pick in pick_obj.browse(cr, uid, [ref('stock_picking_out0')]): for m in pick.move_lines: @@ -59,13 +59,13 @@ 'product_uom' : m.product_uom.id } pick_obj.do_partial(cr, uid, [ref('stock_picking_out0')], partial_datas, context=context) -- +- As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order. -- +- !python {model: stock.invoice.onshipping}: | wiz_id = self.create(cr, uid, {'invoice_date': '2010-08-04', 'journal_id': ref('account.bank_journal')}, {'active_ids': [ref("stock_picking_out0")]}) - self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US", + self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US", "search_default_available": 1, "tz": False, "active_model": "stock.picking", "contact_display": "partner", "active_ids": [ref("stock_picking_out0")], "active_id": ref("stock_picking_out0")}) - @@ -77,4 +77,4 @@ partner = picking[0].address_id.partner_id.id inv_ids = self.search(cr, uid, [('type','=','out_invoice'),('partner_id','=',partner)]) assert inv_ids, 'No Invoice is generated!' - + diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml index f38cb7cdaa6..557162c725d 100755 --- a/addons/stock_location/test/stock_location_pull_flow.yml +++ b/addons/stock_location/test/stock_location_pull_flow.yml @@ -1,41 +1,41 @@ - - In order to test the product pulled flow , I create ,partner,product,procurement -- + In order to test the product pulled flow , I create ,partner,product,procurement +- I create a account type Asset. -- +- !record {model: account.account.type, id: account_account_type_asset0}: close_method: balance code: asset_test name: Asset For Tests sign: 1 -- +- I create a account type income. -- +- !record {model: account.account.type, id: account_account_type_income0}: close_method: unreconciled code: income_test name: Income For Tests sign: 1 -- +- I create a account type Expense. -- +- !record {model: account.account.type, id: account_account_type_expense0}: close_method: unreconciled code: expense_test name: Expense For Tests - sign: 1 -- + sign: 1 +- I create a account type Receivable. -- +- !record {model: account.account.type, id: account_account_type_receivable0}: close_method: balance code: receivable_test name: Receivable For Tests sign: 1 - - + I create a account Receivable. -- +- !record {model: account.account, id: account_account_receivable0}: code: 40000_test company_id: base.main_company @@ -43,19 +43,19 @@ name: Receivable For Tests type: receivable user_type: account_account_type_receivable0 -- +- I create a account Payable. -- +- !record {model: account.account, id: account_account_payable0}: code: 440000_test company_id: base.main_company currency_mode: current name: Payable For Tests type: payable - user_type: account_account_type_expense0 -- + user_type: account_account_type_expense0 +- I create a Purchase Journal. -- +- !record {model: account.journal, id: account_journal_purchasejournal0}: code: pur_test company_id: base.main_company @@ -63,10 +63,10 @@ sequence_id: account.sequence_purchase_journal type: purchase view_id: account.account_journal_bank_view - -- + +- I create a Sale Journal. -- +- !record {model: account.journal, id: account_journal_salejouran0}: code: sal_test company_id: base.main_company @@ -74,10 +74,10 @@ sequence_id: account.sequence_sale_journal type: sale view_id: account.account_journal_view - -- + +- I create an Expense Account -- +- !record {model: account.account, id: account_account_expenseaccount0}: code: Expe_test company_id: base.main_company @@ -85,9 +85,9 @@ name: Expense Account For Tests type: consolidation user_type: account_account_type_asset0 -- +- I create Product Sale account. -- +- !record {model: account.account, id: account_account_productsale0}: code: 001_test company_id: base.main_company @@ -96,9 +96,9 @@ type: other user_type: account_account_type_income0 -- +- I create Product Product Purchase. -- +- !record {model: account.account, id: account_account_productpurchase0}: code: 0002_test company_id: base.main_company @@ -106,9 +106,9 @@ name: Product Purchase For Tests type: other user_type: account_account_type_expense0 -- +- I create a Supplier. -- +- !record {model: res.partner, id: res_partner_shawtrust0}: address: - country_id: base.in @@ -116,16 +116,16 @@ lang: en_US name: 'Shaw Trust ' property_account_payable: account_account_payable0 - property_account_receivable: account_account_receivable0 -- + property_account_receivable: account_account_receivable0 +- I create a product category. -- +- !record {model: product.category, id: product_category_computer0}: name: Computer - I create a product and define the pulled flow condition for stock move. I set shipping type Sending Goods. and set Procurement type to move. -- +- !record {model: product.product, id: product_product_hpcdwriters0}: categ_id: product_category_computer0 cost_method: standard @@ -169,12 +169,12 @@ property_stock_procurement: stock.location_procurement property_stock_production: stock.location_production qty_available: 15 -- +- I create a procurement order. -- +- !record {model: procurement.order, id: procurement_order_test0}: company_id: base.main_company - date_planned: '2010-10-07 18:24:24' + date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S') location_id: stock.stock_location_shop0 name: Testing pulled flow priority: '1' @@ -184,21 +184,21 @@ product_uom: product.product_uom_unit product_uos: product.product_uom_unit product_uos_qty: 0.0 -- +- I confirm the procurement order. -- +- !workflow {model: procurement.order, action: button_confirm, ref: procurement_order_test0} -- +- I launch the scheduler to compute procurement. -- +- !python {model: procurement.order.compute.all}: | proc_obj = self.pool.get('procurement.order') proc_obj._procure_confirm(cr,uid) - - I check the state of procurement order is cancel and stock move is cancel. -- - !python {model: procurement.order }: | - from tools.translate import _ + I check the state of procurement order is cancel and stock move is cancel. +- + !python {model: procurement.order }: | + from tools.translate import _ procurement_ids=self.search(cr, uid, [('id', '=', ref('procurement_order_test0'))]) if procurement_ids: order=self.browse(cr,uid,procurement_ids)[0] @@ -206,14 +206,14 @@ - I check the new procurement order has been created . - - !python {model: procurement.order }: | - from tools.translate import _ + !python {model: procurement.order }: | + from tools.translate import _ procurement_ids=self.search(cr, uid, [('name','=','E001')]) assert len(procurement_ids), "Procurement order hasn't Created." - I check the Outgoing Picking is created for source location Shop 2 and destination shop1. - !python {model: stock.picking }: | - from tools.translate import _ + from tools.translate import _ picking_id = self.search(cr, uid, [('origin','=','Testing pulled flow:E001'),('type','=','out')]) assert len(picking_id), "Picking hasn't Created." diff --git a/addons/stock_location/test/stock_location_push_flow.yml b/addons/stock_location/test/stock_location_push_flow.yml index 1e974682b67..db2ae388317 100755 --- a/addons/stock_location/test/stock_location_push_flow.yml +++ b/addons/stock_location/test/stock_location_push_flow.yml @@ -3,36 +3,36 @@ Push flow specification indicates which location is chained with which location. - I create product category. -- +- !record {model: product.category, id: product_category_computer0}: name: Computer - + - I create Supplier. -- +- !record {model: res.partner, id: res_partner_microlinktechnologies0}: address: - street: Kailash Vaibhav, Parksite name: Micro Link Technologies property_account_payable: account_account_payable0 - property_account_receivable: account_account_receivable0 - supplier: true - + property_account_receivable: account_account_receivable0 + supplier: true + - I create Supplier address. -- +- !record {model: res.partner.address, id: res_partner_address_0}: country_id: base.in partner_id: res_partner_microlinktechnologies0 street: Ash House, Ash Road title: base.res_partner_title_miss - + - I create product and define the pushed flow . - I set the chain location Supplier to stock Input - Stock Input to Quality test and Quality test -Stock . -- + Stock Input to Quality test and Quality test -Stock . +- !record {model: product.product, id: product_product_hpcdwriters0}: categ_id: product_category_computer0 cost_method: standard @@ -62,13 +62,13 @@ property_stock_production: stock.location_production - In order to test pushed flow .I buy the product from Micro Link Technologies supplier. I create a Picking. -- +- !record {model: stock.picking , id: stock_picking_in0}: address_id: res_partner_address_0 company_id: base.main_company invoice_state: none move_lines: - - date_expected: '2010-10-08 15:36:53' + - date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S') location_dest_id: stock.stock_location_stock location_id: stock.stock_location_suppliers name: 'HP CD writers' @@ -79,7 +79,7 @@ name: Pushed Flow Test type: in - - I confirm picking. + I confirm picking. - !python {model: stock.picking }: | self.draft_force_assign(cr, uid, [ref("stock_picking_in0")], {"lang": "en_US", @@ -91,7 +91,7 @@ Stock/Input To Quality test and Quality test To Stock. - I check the move is in waiting state. -- +- !python {model: stock.picking }: | from tools.translate import _ picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')]) @@ -117,11 +117,11 @@ 'product_id': move.product_id.id, 'product_qty': move.product_qty, 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, picking_id,partial_datas) + } + self.do_partial(cr, uid, picking_id,partial_datas) - I check the Outgoing Orders is automatically done. -- +- !python {model: stock.picking }: | from tools.translate import _ picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')]) diff --git a/addons/stock_no_autopicking/test/stock_no_autopicking.yml b/addons/stock_no_autopicking/test/stock_no_autopicking.yml index 34e20eeb6c4..f5e27220e62 100755 --- a/addons/stock_no_autopicking/test/stock_no_autopicking.yml +++ b/addons/stock_no_autopicking/test/stock_no_autopicking.yml @@ -1,5 +1,5 @@ - - In order to test the module with OpenERP, I will make products with No auto-picking + In order to test the module with OpenERP, I will make products with No auto-picking to allow an intermediate picking process to provide raw materials to production orders. - I create product category for measuring the liquid products. Say Litre. @@ -138,7 +138,7 @@ bom_id: mrp_bom_cupoftea0 routing_id: mrp_routing_productionrouting0 company_id: base.main_company - date_planned: '2010-08-03 15:12:32' + date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S') location_dest_id: stock.stock_location_stock location_src_id: stock.stock_location_stock name: MO/00002 diff --git a/addons/stock_planning/test/stock_planning.yml b/addons/stock_planning/test/stock_planning.yml index 23cfc43c821..beb4c654a3e 100755 --- a/addons/stock_planning/test/stock_planning.yml +++ b/addons/stock_planning/test/stock_planning.yml @@ -5,39 +5,39 @@ I create weekly stock periods for the month of July. - I create stock period for the first week of July. -- +- !record {model: stock.period, id: stock_period_01}: - date_start: '2010-07-01 00:00:00' - date_stop: '2010-07-06 23:59:00' - name: 2010, week 27 + date_start: !eval "'%s-07-01 00:00:00' %(datetime.now().year)" + date_stop: !eval "'%s-07-06 23:59:00' %(datetime.now().year)" + name: !eval "'%s, week 27' %(datetime.now().year)" - I create stock period for the second week of July. -- +- !record {model: stock.period, id: stock_period_02}: - date_start: '2010-07-07 00:00:00' - date_stop: '2010-07-12 23:59:00' - name: 2010, week 28 + date_start: !eval "'%s-07-07 00:00:00' %(datetime.now().year)" + date_stop: !eval "'%s-07-12 23:59:00' %(datetime.now().year)" + name: !eval "'%s, week 28' %(datetime.now().year)" - I create stock period for the third week of July. -- +- !record {model: stock.period, id: stock_period_03}: - date_start: '2010-07-15 00:00:00' - date_stop: '2010-07-20 23:59:00' - name: 2010, week 29 + date_start: !eval "'%s-07-15 00:00:00' %(datetime.now().year)" + date_stop: !eval "'%s-07-20 23:59:00' %(datetime.now().year)" + name: !eval "'%s, week 29' %(datetime.now().year)" - I create stock period for the fourth week of July. -- +- !record {model: stock.period, id: stock_period_04}: - date_start: '2010-07-22 00:00:00' - date_stop: '2010-07-27 23:59:00' - name: 2010, week 30 + date_start: !eval "'%s-07-22 00:00:00' %(datetime.now().year)" + date_stop: !eval "'%s-07-27 23:59:00' %(datetime.now().year)" + name: !eval "'%s, week 30' %(datetime.now().year)" - I create stock period for the fifth week of July. -- +- !record {model: stock.period, id: stock_period_05}: - date_start: '2010-07-29 00:00:00' - date_stop: '2010-07-31 23:59:00' - name: 2010, week 31 + date_start: !eval "'%s-07-29 00:00:00' %(datetime.now().year)" + date_stop: !eval "'%s-07-31 23:59:00' %(datetime.now().year)" + name: !eval "'%s, week 31' %(datetime.now().year)" - Now I create the forecast for this period for all PCs. - @@ -46,7 +46,7 @@ period_id: stock_period_03 product_categ_id: product.product_category_pc warehouse_id: stock.warehouse0 -- +- Performing an osv_memory action create_forecast on module stock.sale.forecast.createlines - !python {model: stock.sale.forecast.createlines}: | @@ -56,9 +56,9 @@ }) - I create a sale order for PC1-Basic PC and PC3-Medium PC. -- +- !record {model: sale.order, id: sale_order_so0}: - date_order: '2010-07-20' + date_order: !eval time.strftime('%Y-%m-%d') invoice_quantity: order name: SO006 order_line: @@ -105,17 +105,17 @@ False, "search_default_create_uid": 1, "active_model": "ir.ui.menu", "department_id": False, "active_ids": [ref("stock_planning.menu_stock_sale_forecast_all")], "active_id": ref("stock_planning.menu_stock_sale_forecast_all"), }) -- +- I create Master procurement schedule for the third week of July. -- +- !record {model: stock.planning.createlines, id: stock_planning_createlines_0}: company_id: base.main_company period_id: stock_period_03 product_categ_id: product.product_category_pc warehouse_id: stock.warehouse0 -- +- Performing an osv_memory action create_planning on module stock.planning.createlines -- +- !python {model: stock.planning.createlines}: | self.create_planning(cr, uid, [ref("stock_planning_createlines_0")], {"lang": "en_US", "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_planning_createlines")], @@ -146,5 +146,5 @@ I check whether the procurement orders are created or not. - !python {model: procurement.order}: | - proc_ids = self.search(cr, uid, [('origin','=','MPS(admin) 2010, week 29'),('product_id','=',ref("product.product_product_pc1"))]) + proc_ids = self.search(cr, uid, [('origin','=','MPS(admin) 2011, week 29'),('product_id','=',ref("product.product_product_pc1"))]) assert proc_ids,'No Procurements!'