[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
This commit is contained in:
Benoit Guillot 2012-07-10 14:24:01 +02:00
parent 147381810c
commit 7cb6f34e88
3 changed files with 15 additions and 15 deletions

View File

@ -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)
}

View File

@ -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()

View File

@ -144,12 +144,12 @@ parameter) will see those record just disappear.
<field eval="'product.pricelist,'+str(ref('list0'))" name="value"/>
</record>
<record forcecreate="True" id="decimal_sale" model="decimal.precision">
<field name="name">Sale Price</field>
<record forcecreate="True" id="decimal_price" model="decimal.precision">
<field name="name">Price Unit</field>
<field name="digits">2</field>
</record>
<record forcecreate="True" id="decimal_purchase" model="decimal.precision">
<field name="name">Purchase Price</field>
<record forcecreate="True" id="decimal_discount" model="decimal.precision">
<field name="name">Discount</field>
<field name="digits">2</field>
</record>
<record forcecreate="True" id="decimal_account" model="decimal.precision">