Mayur Maheshwari(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-product-margin-coverage-mma into
lp:openobject-addons.
Requested reviews:
Rucha (Open ERP) (rpa-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-product-margin-coverage-mma/+merge/76541
Hello,
product_margin: yml improvement is done
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-product-margin-coverage-mma/+merge/76541
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-product-margin-coverage-mma.
=== modified file 'product_margin/__openerp__.py'
--- product_margin/__openerp__.py 2011-03-18 11:08:16 +0000
+++ product_margin/__openerp__.py 2011-09-22 10:18:40 +0000
@@ -37,6 +37,7 @@
'wizard/product_margin_view.xml',
'product_margin_view.xml'
],
+ 'test':['test/product_margin.yml'],
'demo_xml': [],
'installable': True,
'active': False,
=== added directory 'product_margin/test'
=== added file 'product_margin/test/product_margin.yml'
--- product_margin/test/product_margin.yml 1970-01-01 00:00:00 +0000
+++ product_margin/test/product_margin.yml 2011-09-22 10:18:40 +0000
@@ -0,0 +1,52 @@
+
+-
+ In order to test the product_margin module, I will create product and product.category,
+
+-
+ I create product.category .
+-
+ !record {model: product.category, id: product_category_computer0}:
+ name: Computer
+
+-
+ I create product HP Desktop PCs .
+-
+ !record {model: product.product, id: product_product_hpdesktoppcs0}:
+ categ_id: product_margin.product_category_computer0
+ cost_method: standard
+ mes_type: fixed
+ list_price: 450
+ standard_price: 300
+ name: HP Desktop PCs
+ procure_method: make_to_stock
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+
+-
+ I create product margin record .
+-
+ !record {model: product.margin, id: product_margin_wiz0}:
+ from_date: !eval "'%s-01-01' %(datetime.now().year)"
+ to_date: !eval "'%s-12-31' %(datetime.now().year)"
+ invoice_state: open_paid
+
+-
+ I open margin for HP Desktop PCs.
+-
+ !python {model: product.margin}: |
+ self.action_open_window(cr, uid, [ref("product_margin_wiz0")], {"lang": 'en_US',
+ "search_default_filter_to_sell": "1", "tz": False, "active_model": "product.product", "disable_log": True,
+ "active_ids": [ref("product_product_hpdesktoppcs0")], "active_id": ref("product_product_hpdesktoppcs0")})
+-
+ I Read the Fields of Product.
+-
+ !python {model: product.product}: |
+ fields = ['sale_avg_price', 'expected_margin_rate', 'total_margin_rate', 'total_cost', 'sale_num_invoiced',
+ 'total_margin', 'sales_gap', 'purchase_num_invoiced', 'expected_margin', 'turnover']
+ self.read(cr, uid, [ref("product_margin_wiz0")], fields, {"lang": 'en_US',
+ "search_default_filter_to_sell": "1", "tz": False, "active_model": "product.product",
+ "bin_size": True, "active_ids": [ref("product_product_hpdesktoppcs0")],
+ "active_id": ref("product_product_hpdesktoppcs0")})
+
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp