2008-07-01 15:58:58 +00:00
<?xml version="1.0" encoding="utf-8"?>
2008-09-10 17:56:00 +00:00
<openerp >
2008-06-29 08:26:07 +00:00
<data >
<!-- Resource: sale.order -->
2008-07-01 15:58:58 +00:00
<record id= "test_order_1" model= "sale.order" >
<field model= "product.pricelist" name= "pricelist_id" search= "[]" />
2008-08-12 12:55:37 +00:00
<field name= "user_id" ref= "base.user_root" />
2008-07-01 15:58:58 +00:00
<field model= "res.partner" name= "partner_id" search= "[]" />
2012-03-05 13:25:43 +00:00
<field model= "res.partner" name= "partner_invoice_id" search= "[]" />
<field model= "res.partner" name= "partner_shipping_id" search= "[]" />
2008-06-29 08:26:07 +00:00
</record>
<!-- Resource: sale.order.line -->
2008-07-01 15:58:58 +00:00
<record id= "test_order_1_line_1" model= "sale.order.line" >
2008-06-29 08:26:07 +00:00
<field name= "order_id" ref= "test_order_1" />
2012-08-16 08:42:24 +00:00
<field name= "name" > [PCSC234] PC Assemble SC234</field>
2012-06-29 11:04:24 +00:00
<field name= "product_id" ref= "product.product_product_3" />
2008-06-29 08:26:07 +00:00
<field name= "product_uom" ref= "product.product_uom_unit" />
<field name= "price_unit" > 450</field>
<field name= "product_uom_qty" > 2</field>
<field name= "product_uos_qty" > 2</field>
</record>
2008-07-01 15:58:58 +00:00
<record id= "test_order_1_line_3" model= "sale.order.line" >
2008-06-29 08:26:07 +00:00
<field name= "order_id" ref= "test_order_1" />
2012-08-16 08:42:24 +00:00
<field name= "name" > [HDD-SH2] HDD SH-2</field>
2012-06-29 11:04:24 +00:00
<field name= "product_id" ref= "product.product_product_18" />
2008-06-29 08:26:07 +00:00
<field name= "product_uom" ref= "product.product_uom_unit" />
<field name= "price_unit" > 90</field>
<field name= "product_uom_qty" > 3</field>
<field name= "product_uos_qty" > 3</field>
</record>
2009-11-23 13:47:57 +00:00
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" severity= "error" string= "The amount of the sales order is correctly computed" >
2008-07-01 15:58:58 +00:00
<test expr= "sum([l.price_subtotal for l in order_line]) == amount_untaxed" />
2008-06-29 08:26:07 +00:00
</assert>
2009-11-23 13:47:57 +00:00
2008-07-01 15:58:58 +00:00
<workflow action= "order_confirm" model= "sale.order" ref= "test_order_1" />
2009-11-23 13:47:57 +00:00
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" string= "the sales order is now in 'Manual in progress' state" >
2008-06-29 08:26:07 +00:00
<test expr= "state" > manual</test>
</assert>
2009-11-23 13:47:57 +00:00
2008-08-12 12:55:37 +00:00
<workflow action= "manual_invoice" model= "sale.order" ref= "test_order_1" uid= "base.user_root" />
2009-11-23 13:47:57 +00:00
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" string= "the sales order is now in progress" >
2008-06-29 08:26:07 +00:00
<test expr= "state" > progress</test>
</assert>
2009-11-23 13:47:57 +00:00
2008-06-29 08:26:07 +00:00
<!-- Treat generated invoice -->
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" severity= "fatal" string= "the sales order has now a corresponding invoice" >
2008-07-01 15:58:58 +00:00
<test expr= "len(invoice_ids) == 1" />
2008-06-29 08:26:07 +00:00
</assert>
2009-11-23 13:47:57 +00:00
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" severity= "fatal" string= "the sales order's has the same amount and is currently a draft" >
2008-07-01 15:58:58 +00:00
<test expr= "invoice_ids[0].amount_untaxed == amount_untaxed" />
<test expr= "invoice_ids[0].amount_total == amount_total" />
2008-06-29 08:26:07 +00:00
<test expr= "invoice_ids[0].state" > draft</test>
</assert>
2009-11-23 13:47:57 +00:00
2008-07-01 15:58:58 +00:00
<workflow action= "invoice_open" model= "account.invoice" >
<value eval= "obj(ref('test_order_1')).invoice_ids[0].id" model= "sale.order" />
2008-06-29 08:26:07 +00:00
</workflow>
2009-11-23 13:47:57 +00:00
2008-06-29 08:26:07 +00:00
<function model= "account.invoice" name= "pay_and_reconcile" >
2008-07-01 15:58:58 +00:00
<value eval= "[obj(ref('test_order_1')).invoice_ids[0].id]" model= "sale.order" />
<value eval= "obj(ref('test_order_1')).amount_total" model= "sale.order" />
<value model= "account.account" search= "[('type', '=', 'cash')]" />
<value eval= "ref('account.period_' + str(int(time.strftime('%m'))))" />
<value eval= "ref('account.bank_journal')" />
<value model= "account.account" search= "[('type', '=', 'cash')]" />
<value eval= "ref('account.period_' + str(int(time.strftime('%m'))))" />
<value eval= "ref('account.bank_journal')" />
2008-06-29 08:26:07 +00:00
</function>
2009-11-23 13:47:57 +00:00
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" severity= "fatal" string= "the sales order's invoice is now paid" >
2008-06-29 08:26:07 +00:00
<test expr= "invoice_ids[0].state" > paid</test>
</assert>
2009-11-23 13:47:57 +00:00
2008-06-29 08:26:07 +00:00
<!-- Treat generated picking -->
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" severity= "fatal" string= "the sales order has now a correspending picking" >
2008-07-01 15:58:58 +00:00
<test expr= "len(picking_ids) == 1" />
2008-06-29 08:26:07 +00:00
</assert>
2009-11-23 13:47:57 +00:00
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" severity= "error" string= "the sales order's picking will be sent to the good address and is already confirmed" >
2012-03-30 07:50:32 +00:00
<test expr= "picking_ids[0].partner_id == partner_shipping_id" />
2008-06-29 08:26:07 +00:00
<!-- test expr="picking_ids[0].state">confirmed</test # Desactivated because of MRP_JIT -->
</assert>
2009-11-23 13:47:57 +00:00
2008-06-29 08:26:07 +00:00
<!-- Here we need to use the function tag because action_assign is a method of stock_picking and not part of the workflow -->
<function model= "stock.picking" name= "action_assign" >
2008-07-01 15:58:58 +00:00
<value eval= "[obj(ref('test_order_1')).picking_ids[0].id]" model= "sale.order" />
2008-06-29 08:26:07 +00:00
</function>
2009-11-23 13:47:57 +00:00
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" severity= "fatal" string= "the sales order's picking is now assigned" >
2008-06-29 08:26:07 +00:00
<test expr= "picking_ids[0].state" > assigned</test>
</assert>
2009-11-23 13:47:57 +00:00
2008-06-29 08:26:07 +00:00
<!-- Do the same as in wizard_partial_picking lines 143 - 144 -->
<function model= "stock.picking" name= "action_move" >
2008-07-01 15:58:58 +00:00
<value eval= "[obj(ref('test_order_1')).picking_ids[0].id]" model= "sale.order" />
2008-06-29 08:26:07 +00:00
</function>
2009-11-23 13:47:57 +00:00
2008-07-01 15:58:58 +00:00
<workflow action= "button_done" model= "stock.picking" >
<value eval= "obj(ref('test_order_1')).picking_ids[0].id" model= "sale.order" />
2008-06-29 08:26:07 +00:00
</workflow>
2009-11-23 13:47:57 +00:00
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" string= "the sales order's picking is now done" >
2008-06-29 08:26:07 +00:00
<test expr= "picking_ids[0].state" > done</test>
</assert>
2009-11-23 13:47:57 +00:00
2008-06-29 08:26:07 +00:00
<!-- Run all schedulers -->
2010-05-27 12:47:06 +00:00
<function model= "procurement.order" name= "run_scheduler" />
2009-11-23 13:47:57 +00:00
2010-12-13 06:07:23 +00:00
<assert id= "test_order_1" model= "sale.order" string= "the sales order is now done" >
2008-06-29 08:26:07 +00:00
<test expr= "state" > done</test>
</assert>
</data>
2008-09-10 17:56:00 +00:00
</openerp>