[IMP] point_of_sale : yml test for point_of_sale & demo data added

bzr revid: jma@tinyerp.com-20100916090339-v7765dg7rgs1nd1s
This commit is contained in:
JMA (OpenERP) 2010-09-16 14:33:39 +05:30
parent 17638f2277
commit a084c48967
3 changed files with 115 additions and 2 deletions

View File

@ -73,7 +73,8 @@ Main features :
'statement_report.xml',
],
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml',],
'test':['test/pos_test.yml',],
'test':['test/pos_test.yml',
'test/pos_report.yml'],
'installable': True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,6 +1,65 @@
<?xml version="1.0"?>
<openerp>
<data>
<!--Resource: pos.order-->
<record id="order_pos1" model="pos.order">
<field model="sale.shop" name="shop_id" search="[]"/>
<field model="res.users" name="user_salesman_id" search="[]"/>
<field name="user_id" ref="base.user_root"/>
<field model="res.partner" name="partner_id" search="[]"/>
<field name="price_type">tax_excluded</field>
<field model="product.pricelist" name="pricelist_id" search="[]"/>
</record>
<record id="order_pos2" model="pos.order">
<field model="sale.shop" name="shop_id" search="[]"/>
<field model="res.users" name="user_salesman_id" search="[]"/>
<field name="user_id" ref="base.user_root"/>
<field model="res.partner" name="partner_id" search="[]"/>
<field name="price_type">tax_excluded</field>
<field model="product.pricelist" name="pricelist_id" search="[]"/>
</record>
<!--Resource: pos.order.line-->
<record id="line1_pos" model="pos.order.line">
<field name="order_id" ref="order_pos1"/>
<field name="date_planned">2010/09/15</field>
<field name="name">[PC3] Medium PC</field>
<field name="product_id" ref="product.product_product_pc3"/>
<field model="res.company" name="company_id" search="[]"/>
<field model="product.uom" name="product_uom" search="[]"/>
<field name="price_unit">450</field>
<field name="qty">2</field>
<field name="notice">No Discount</field>
</record>
<record id="line12_pos" model="pos.order.line">
<field name="order_id" ref="order_pos1"/>
<field name="date_planned">2010/09/15</field>
<field name="name">[PC2] Basic+ PC (assembly on order)</field>
<field name="product_id" ref="product.product_product_pc2"/>
<field model="res.company" name="company_id" search="[]"/>
<field model="product.uom" name="product_uom" search="[]"/>
<field name="price_unit">450</field>
<field name="qty">2</field>
<field name="notice">No Discount</field>
</record>
<record id="line2_pos" model="pos.order.line">
<field name="order_id" ref="order_pos2"/>
<field name="date_planned">2010/09/15</field>
<field name="name">[PC1] Basic PC</field>
<field name="product_id" ref="product.product_product_pc1"/>
<field model="res.company" name="company_id" search="[]"/>
<field model="product.uom" name="product_uom" search="[]"/>
<field name="price_unit">450</field>
<field name="qty">5</field>
<field name="discount">0.10</field>
<field name="notice">Discount Applied</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,53 @@
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Detail Summary report
-
!python {model: pos.order}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.pos.details_summary').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-details_summary report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Invoice report
-
!python {model: pos.order}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.pos.invoice').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-invoice report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point Of Sale, we will print a POS Lines report
-
!python {model: pos.order}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.pos.lines').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-lines report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt report
-
!python {model: pos.order}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.pos.receipt').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt With Reimbursement report
-
!python {model: pos.order}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.pos.receipt.with.remboursment').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt with reimbursement report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a point of sale, we will print a POS Receipt Without Reimbursement report
-
!python {model: pos.order}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.pos.receipt.without.remboursment').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt without reimbursement report'+format), 'wb+').write(data)