[ADD] Product: Add product_test yml

bzr revid: aag@tinyerp.com-20110812100914-sumunc1837xqp9zf
This commit is contained in:
Atik Agewan (OpenERP) 2011-08-12 15:39:14 +05:30
parent 097b76d372
commit a7a52fe5f4
2 changed files with 52 additions and 1 deletions

View File

@ -61,7 +61,7 @@ Print product labels with barcode.
'partner_view.xml',
'process/product_process.xml'
],
'test':['test/product_report.yml'],
'test':['test/product_report.yml','test/product_test.yml'],
'installable': True,
'active': False,
'certificate': '0068861431437',

View File

@ -0,0 +1,51 @@
-
In order to test product,I start by creating a Category
-
!record {model: product.category, id: product_category_suger}:
name: vehicle
type: normal
-
I create a 20KG UOM for 'Suger'
-
!record {model: product.uom, id: product_20k_uom_suger}:
name: 20KG
uom_type: bigger
category_id: 2
rounding: 0.010
factor_inv: 20
-
I create a 10KG UOM for 'Suger'
-
!record {model: product.uom, id: product_10k_uom_suger}:
name: 10KG
uom_type: bigger
category_id: 2
rounding: 0.010
factor_inv: 10
-
I create a new product 'Suger'
-
!record {model: product.product, id: product_suger_id1}:
categ_id: 'product.product_category_suger'
cost_method: standard
name: Cycle
procure_method: make_to_order
seller_delay: '1'
standard_price: 400.0
uom_id: product.product_20k_uom_suger
uom_po_id: product.product_20k_uom_suger
volume: 0.0
warranty: 0.0
weight: 0.0
weight_net: 0.0
-
I test onchanged on Uom, Create Dublicate Product and Delete original Product.
-
!python {model: product.product}: |
from tools.translate import _
ids = []
ids.append(ref("product_suger_id1"))
self.onchange_uom(cr ,uid, ids, ref("product.product_20k_uom_suger"), ref("product_10k_uom_suger"))
self.copy(cr, uid, ids[0])
self.unlink(cr, uid, ids)
-