[IMP]demo data of product and yml test of point of sale.
bzr revid: dka@tinyerp.com-20131025122415-b1cssqumzdowxjrb
This commit is contained in:
@@ -81,12 +81,12 @@
|
||||
discount: 0.0
|
||||
qty: 3.0
|
||||
-
|
||||
I check that the total of the order is equal to 450*2 + 300*3*1.05 and the tax of the order is equal to 900 -(450 * 2 / 1.1) + 300*0.05*3
|
||||
I check that the total of the order is equal to 450*2 + 300*3*1.10 and the tax of the order is equal to 900 -(450 * 2) + 300*1.10*3
|
||||
-
|
||||
!python {model: pos.order}: |
|
||||
order = self.browse(cr, uid, ref('pos_order_pos0'))
|
||||
assert(abs(order.amount_total - (450*2 + 300*3*1.05)) < 0.01), "The order has a wrong amount, tax included"
|
||||
assert(abs(order.amount_tax - (900-(450*2/1.1) + 300*0.05*3)) < 0.01), "The order has a wrong tax amount"
|
||||
assert(abs(order.amount_total - (450*2 + 300*3*1.10)) < 0.01), "The order has a wrong amount, tax included"
|
||||
assert(abs(order.amount_tax - (900-(450*2) + 300*0.10*3)) < 0.01), "The order has a wrong tax amount"
|
||||
-
|
||||
I want to add a global discount of 5 percent using the wizard
|
||||
-
|
||||
@@ -99,11 +99,11 @@
|
||||
self.apply_discount(cr, uid, [ref("pos_discount_0")], {"active_model": "pos.order",
|
||||
"active_ids": [ref("pos_order_pos0")], "active_id": ref("pos_order_pos0"), })
|
||||
-
|
||||
I check that the total of the order is now equal to (450*2 + 300*3*1.05)*0.95
|
||||
I check that the total of the order is now equal to (450*2 + 300*3*1.10)*0.95
|
||||
-
|
||||
!python {model: pos.order}: |
|
||||
order = self.browse(cr, uid, ref('pos_order_pos0'))
|
||||
assert(abs(order.amount_total - (450*2 + 300*3*1.05)*0.95) < 0.01), "The order has a wrong total including tax and discounts"
|
||||
assert(abs(order.amount_total - (450*2 + 300*3*1.10)*0.95) < 0.01), "The order has a wrong total including tax and discounts"
|
||||
-
|
||||
I click on the "Make Payment" wizard to pay the PoS order with a partial amount of 100.0 EUR
|
||||
-
|
||||
@@ -124,13 +124,13 @@
|
||||
-
|
||||
!python {model: pos.make.payment}: |
|
||||
defs = self.default_get(cr, uid, ['amount'], {'active_id': ref('pos_order_pos0')})
|
||||
assert abs(defs['amount'] - ((450*2 + 300*3*1.05)*0.95-100.0)) < 0.01, "The remaining balance is incorrect"
|
||||
assert abs(defs['amount'] - ((450*2 + 300*3*1.10)*0.95-100.0)) < 0.01, "The remaining balance is incorrect"
|
||||
-
|
||||
I pay the remaining balance.
|
||||
-
|
||||
!record {model: pos.make.payment, id: pos_make_payment_1, context: '{"active_id": ref("pos_order_pos0"), "active_ids": [ref("pos_order_pos0")]}' }:
|
||||
amount: !eval >
|
||||
(450*2 + 300*3*1.05)*0.95-100.0
|
||||
(450*2 + 300*3*1.10)*0.95-100.0
|
||||
-
|
||||
I click on the validate button to register the payment.
|
||||
-
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
-
|
||||
!record {model: pos.make.payment, id: pos_make_payment_2, context: '{"active_id": ref("pos_order_pos1"), "active_ids": [ref("pos_order_pos1")]}' }:
|
||||
amount: !eval >
|
||||
(450*2 + 300*3*1.05)*0.95
|
||||
(450*2 + 300*3*1.10)*0.95
|
||||
-
|
||||
I click on the validate button to register the payment.
|
||||
-
|
||||
@@ -43,4 +43,4 @@
|
||||
I test that the total of the attached invoice is correct
|
||||
-
|
||||
!assert {model: pos.order, id: pos_order_pos1, string: Invoice not correct}:
|
||||
- amount_total == (450*2 + 300*3*1.05)*0.95
|
||||
- amount_total == (450*2 + 300*3*1.10)*0.95
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
<field name="product_tmpl_id" ref="product_template_3"/>
|
||||
<field name="default_code">PCSC234</field>
|
||||
<field name="variants">SC234</field>
|
||||
<field name="price_extra">10</field>
|
||||
<field name="price_extra">0.0</field>
|
||||
<field name="description">17" LCD Monitor
|
||||
Processor AMD 8-Core
|
||||
512MB RAM
|
||||
@@ -119,7 +119,7 @@ HDD SH-1</field>
|
||||
<field name="product_tmpl_id" ref="product_template_3"/>
|
||||
<field name="default_code">PCSC349</field>
|
||||
<field name="variants">SC349</field>
|
||||
<field name="price_extra">300</field>
|
||||
<field name="price_extra">300.0</field>
|
||||
<field name="description">19" LCD Monitor
|
||||
Processor Core i5 2.70 Ghz
|
||||
2GB RAM
|
||||
@@ -130,7 +130,7 @@ HDD SH-1</field>
|
||||
<field name="product_tmpl_id" ref="product_template_3"/>
|
||||
<field name="default_code">PC-DEM</field>
|
||||
<field name="variants">Custom</field>
|
||||
<field name="price_extra">450</field>
|
||||
<field name="price_extra">450.0</field>
|
||||
<field name="description">Custom computer assembled on order based on customer's requirement.</field>
|
||||
</record>
|
||||
|
||||
@@ -149,14 +149,14 @@ HDD SH-1</field>
|
||||
<field name="product_tmpl_id" ref="product_template_6"/>
|
||||
<field name="default_code">LCD15</field>
|
||||
<field name="variants">15inch</field>
|
||||
<field name="price_extra">100</field>
|
||||
<field name="price_extra">0.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_7" model="product.product">
|
||||
<field name="product_tmpl_id" ref="product_template_6"/>
|
||||
<field name="default_code">LCD17</field>
|
||||
<field name="variants">17inch</field>
|
||||
<field name="price_extra">150</field>
|
||||
<field name="price_extra">150.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_8" model="product.template">
|
||||
@@ -172,7 +172,7 @@ HDD SH-1</field>
|
||||
<field name="product_tmpl_id" ref="product_template_8"/>
|
||||
<field name="default_code">KeyQ</field>
|
||||
<field name="variants">QWERTY</field>
|
||||
<field name="price_extra">2.0</field>
|
||||
<field name="price_extra">0.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_9" model="product.product">
|
||||
@@ -195,7 +195,7 @@ HDD SH-1</field>
|
||||
<field name="product_tmpl_id" ref="product_template_10"/>
|
||||
<field name="default_code">M-Opt</field>
|
||||
<field name="variants">Optical</field>
|
||||
<field name="price_extra">1.0</field>
|
||||
<field name="price_extra">0.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_11" model="product.product">
|
||||
@@ -209,7 +209,7 @@ HDD SH-1</field>
|
||||
<field name="product_tmpl_id" ref="product_template_10"/>
|
||||
<field name="default_code">M-Wir</field>
|
||||
<field name="variants">Wireless</field>
|
||||
<field name="price_extra">7.50</field>
|
||||
<field name="price_extra">1.50</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_13" model="product.template">
|
||||
@@ -225,21 +225,21 @@ HDD SH-1</field>
|
||||
<field name="product_tmpl_id" ref="product_template_13"/>
|
||||
<field name="default_code">RAM-SR5</field>
|
||||
<field name="variants">1GB-SR5</field>
|
||||
<field name="price_extra">5.0</field>
|
||||
<field name="price_extra">0.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_14" model="product.product">
|
||||
<field name="product_tmpl_id" ref="product_template_13"/>
|
||||
<field name="default_code">RAM-SR2</field>
|
||||
<field name="variants">2GB-SR2</field>
|
||||
<field name="price_extra">15.0</field>
|
||||
<field name="price_extra">10.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_15" model="product.product">
|
||||
<field name="product_tmpl_id" ref="product_template_13"/>
|
||||
<field name="default_code">RAM-SR3</field>
|
||||
<field name="variants">1GB-SR3</field>
|
||||
<field name="price_extra">5.0</field>
|
||||
<field name="price_extra">0.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_16" model="product.template">
|
||||
@@ -269,21 +269,21 @@ HDD SH-1</field>
|
||||
<field name="product_tmpl_id" ref="product_template_17"/>
|
||||
<field name="default_code">HDD-SH1</field>
|
||||
<field name="variants">180GB-SH1</field>
|
||||
<field name="price_extra">5.0</field>
|
||||
<field name="price_extra">0.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_18" model="product.product">
|
||||
<field name="product_tmpl_id" ref="product_template_17"/>
|
||||
<field name="default_code">HDD-SH2</field>
|
||||
<field name="variants">180GB-SH2</field>
|
||||
<field name="price_extra">250.0</field>
|
||||
<field name="price_extra">175.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_19" model="product.product">
|
||||
<field name="product_tmpl_id" ref="product_template_17"/>
|
||||
<field name="default_code">HDD-DEM</field>
|
||||
<field name="variants">On Demand</field>
|
||||
<field name="price_extra">300.0</field>
|
||||
<field name="price_extra">275.0</field>
|
||||
<field name="description">On demand hard-disk having capacity based on requirement.</field>
|
||||
</record>
|
||||
|
||||
@@ -307,7 +307,7 @@ HDD SH-1</field>
|
||||
<field name="product_tmpl_id" ref="product_template_20"/>
|
||||
<field name="default_code">MBa20</field>
|
||||
<field name="variants">A20Z7</field>
|
||||
<field name="price_extra">100.0</field>
|
||||
<field name="price_extra">50.0</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_22" model="product.template">
|
||||
@@ -376,7 +376,7 @@ QWERTY keyboard</field>
|
||||
<field name="product_tmpl_id" ref="product_template_25"/>
|
||||
<field name="default_code">LAP-S3</field>
|
||||
<field name="variants">S3450</field>
|
||||
<field name="price_extra">550.0</field>
|
||||
<field name="price_extra">295.0</field>
|
||||
<field name="description">17" Monitor
|
||||
6GB RAM
|
||||
Hi-Speed 234Q Processor
|
||||
@@ -387,7 +387,7 @@ QWERTY keyboard</field>
|
||||
<field name="product_tmpl_id" ref="product_template_25"/>
|
||||
<field name="default_code">LAP-CUS</field>
|
||||
<field name="variants">Customized</field>
|
||||
<field name="price_extra">645.0</field>
|
||||
<field name="price_extra">695.0</field>
|
||||
<field name="description">Custom Laptop based on customer's requirement.</field>
|
||||
</record>
|
||||
|
||||
@@ -419,7 +419,7 @@ QWERTY keyboard</field>
|
||||
<field name="product_tmpl_id" ref="product_template_29"/>
|
||||
<field name="default_code">PD-SP2</field>
|
||||
<field name="variants">4GB-SP2</field>
|
||||
<field name="price_extra">10</field>
|
||||
<field name="price_extra">0.0</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@ QWERTY keyboard</field>
|
||||
<field name="product_tmpl_id" ref="product_template_29"/>
|
||||
<field name="default_code">PD-SP4</field>
|
||||
<field name="variants">8GB-SP4</field>
|
||||
<field name="price_extra">85</field>
|
||||
<field name="price_extra">45</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_31" model="product.template">
|
||||
@@ -458,7 +458,7 @@ QWERTY keyboard</field>
|
||||
<field name="product_tmpl_id" ref="product_template_32"/>
|
||||
<field name="default_code">HEAD</field>
|
||||
<field name="variants">Standard</field>
|
||||
<field name="price_extra">3</field>
|
||||
<field name="price_extra">0.0</field>
|
||||
<field name="description">Hands free headset for laptop PC with in-line microphone and headphone plug.</field>
|
||||
</record>
|
||||
|
||||
@@ -466,7 +466,7 @@ QWERTY keyboard</field>
|
||||
<field name="product_tmpl_id" ref="product_template_32"/>
|
||||
<field name="default_code">HEAD-USB</field>
|
||||
<field name="variants">USB</field>
|
||||
<field name="price_extra">10</field>
|
||||
<field name="price_extra">30.0</field>
|
||||
<field name="description">Headset for laptop PC with USB connector.</field>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user