From 7cb6f34e8817a991803ab16fc995b1617b311c02 Mon Sep 17 00:00:00 2001 From: Benoit Guillot Date: Tue, 10 Jul 2012 14:24:01 +0200 Subject: [PATCH] [REF] remove sale and purchase precision and replace it by price unit precision. Add discount precision. bzr revid: benoit.guillot@akretion.com.br-20120710122401-mt3fvdlqy7d2zz5y --- addons/product/pricelist.py | 8 ++++---- addons/product/product.py | 14 +++++++------- addons/product/product_data.xml | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index ea29292f445..2e86192bc7a 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -408,18 +408,18 @@ class product_pricelist_item(osv.osv): 'base_pricelist_id': fields.many2one('product.pricelist', 'If Other Pricelist'), 'price_surcharge': fields.float('Price Surcharge', - digits_compute= dp.get_precision('Sale Price')), + digits_compute= dp.get_precision('Price Unit')), 'price_discount': fields.float('Price Discount', digits=(16,4)), 'price_round': fields.float('Price Rounding', - digits_compute= dp.get_precision('Sale Price'), + digits_compute= dp.get_precision('Price Unit'), help="Sets the price so that it is a multiple of this value.\n" \ "Rounding is applied after the discount and before the surcharge.\n" \ "To have prices that end in 9.99, set rounding 10, surcharge -0.01" \ ), 'price_min_margin': fields.float('Min. Price Margin', - digits_compute= dp.get_precision('Sale Price')), + digits_compute= dp.get_precision('Price Unit')), 'price_max_margin': fields.float('Max. Price Margin', - digits_compute= dp.get_precision('Sale Price')), + digits_compute= dp.get_precision('Price Unit')), 'company_id': fields.related('price_version_id','company_id',type='many2one', readonly=True, relation='res.company', string='Company', store=True) } diff --git a/addons/product/product.py b/addons/product/product.py index a81074aa56e..4506387cd1c 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -297,8 +297,8 @@ class product_template(osv.osv): 'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procurement Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the procurement request."), 'rental': fields.boolean('Can be Rent'), 'categ_id': fields.many2one('product.category','Category', required=True, change_default=True, domain="[('type','=','normal')]" ,help="Select category for the current product"), - 'list_price': fields.float('Sale Price', digits_compute=dp.get_precision('Sale Price'), help="Base price for computing the customer price. Sometimes called the catalog price."), - 'standard_price': fields.float('Cost Price', required=True, digits_compute=dp.get_precision('Purchase Price'), help="Product's cost for accounting stock valuation. It is the base price for the supplier price.", groups="base.group_user"), + 'list_price': fields.float('Sale Price', digits_compute=dp.get_precision('Price Unit'), help="Base price for computing the customer price. Sometimes called the catalog price."), + 'standard_price': fields.float('Cost Price', required=True, digits_compute=dp.get_precision('Price Unit'), help="Product's cost for accounting stock valuation. It is the base price for the supplier price.", groups="base.group_user"), 'volume': fields.float('Volume', help="The volume in m3."), 'weight': fields.float('Gross Weight', digits_compute=dp.get_precision('Stock Weight'), help="The gross weight in Kg."), 'weight_net': fields.float('Net Weight', digits_compute=dp.get_precision('Stock Weight'), help="The net weight in Kg."), @@ -510,8 +510,8 @@ class product_product(osv.osv): 'virtual_available': fields.function(_product_virtual_available, type='float', string='Quantity Available'), 'incoming_qty': fields.function(_product_incoming_qty, type='float', string='Incoming'), 'outgoing_qty': fields.function(_product_outgoing_qty, type='float', string='Outgoing'), - 'price': fields.function(_product_price, type='float', string='Pricelist', digits_compute=dp.get_precision('Sale Price')), - 'lst_price' : fields.function(_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Sale Price')), + 'price': fields.function(_product_price, type='float', string='Pricelist', digits_compute=dp.get_precision('Price Unit')), + 'lst_price' : fields.function(_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Price Unit')), 'code': fields.function(_product_code, type='char', string='Reference'), 'partner_ref' : fields.function(_product_partner_ref, type='char', string='Customer ref'), 'default_code' : fields.char('Reference', size=64, select=True), @@ -520,8 +520,8 @@ class product_product(osv.osv): 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"), 'ean13': fields.char('EAN13', size=13, help="The numbers encoded in EAN-13 bar codes are product identification numbers."), 'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."), - 'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Sale Price')), - 'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Sale Price')), + 'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Price Unit')), + 'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Price Unit')), 'pricelist_id': fields.dummy(string='Pricelist', relation='product.pricelist', type='many2one'), 'name_template': fields.related('product_tmpl_id', 'name', string="Name", type='char', size=128, store=True, select=True), 'color': fields.integer('Color Index'), @@ -845,7 +845,7 @@ class pricelist_partnerinfo(osv.osv): 'name': fields.char('Description', size=64), 'suppinfo_id': fields.many2one('product.supplierinfo', 'Partner Information', required=True, ondelete='cascade'), 'min_quantity': fields.float('Quantity', required=True, help="The minimal quantity to trigger this rule, expressed in the supplier Unit of Measure if any or in the default Unit of Measure of the product otherrwise."), - 'price': fields.float('Unit Price', required=True, digits_compute=dp.get_precision('Purchase Price'), help="This price will be considered as a price for the supplier Unit of Measure if any or the default Unit of Measure of the product otherwise"), + 'price': fields.float('Unit Price', required=True, digits_compute=dp.get_precision('Price Unit'), help="This price will be considered as a price for the supplier Unit of Measure if any or the default Unit of Measure of the product otherwise"), } _order = 'min_quantity asc' pricelist_partnerinfo() diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml index 8f10b7b2762..27ef14923ee 100644 --- a/addons/product/product_data.xml +++ b/addons/product/product_data.xml @@ -144,12 +144,12 @@ parameter) will see those record just disappear. - - Sale Price + + Price Unit 2 - - Purchase Price + + Discount 2