diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py
index 7e9748c2523..c19c12c06d7 100644
--- a/addons/product/report/product_pricelist.py
+++ b/addons/product/report/product_pricelist.py
@@ -112,7 +112,7 @@ class product_pricelist(report_sxw.rml_parse):
return res
def _get_price(self,pricelist_id, product_id,qty):
- sale_price_digits = self.get_digits(dp='Sale Price')
+ sale_price_digits = self.get_digits(dp='Product Price')
pool = pooler.get_pool(self.cr.dbname)
price_dict = pool.get('product.pricelist').price_get(self.cr, self.uid, [pricelist_id], product_id, qty, context=self.localcontext)
if price_dict[pricelist_id]:
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index b02e959301f..ba03b95b71f 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -190,15 +190,15 @@ class purchase_order(osv.osv):
'purchase.order.line': (_get_order, ['date_planned'], 10),
}
),
- 'amount_untaxed': fields.function(_amount_all, digits_compute= dp.get_precision('Purchase Price'), string='Untaxed Amount',
+ 'amount_untaxed': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Untaxed Amount',
store={
'purchase.order.line': (_get_order, None, 10),
}, multi="sums", help="The amount without tax"),
- 'amount_tax': fields.function(_amount_all, digits_compute= dp.get_precision('Purchase Price'), string='Taxes',
+ 'amount_tax': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Taxes',
store={
'purchase.order.line': (_get_order, None, 10),
}, multi="sums", help="The tax amount"),
- 'amount_total': fields.function(_amount_all, digits_compute= dp.get_precision('Purchase Price'), string='Total',
+ 'amount_total': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Total',
store={
'purchase.order.line': (_get_order, None, 10),
}, multi="sums",help="The total amount"),
@@ -804,8 +804,8 @@ class purchase_order_line(osv.osv):
'product_id': fields.many2one('product.product', 'Product', domain=[('purchase_ok','=',True)], change_default=True),
'move_ids': fields.one2many('stock.move', 'purchase_line_id', 'Reservation', readonly=True, ondelete='set null'),
'move_dest_id': fields.many2one('stock.move', 'Reservation Destination', ondelete='set null'),
- 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Purchase Price')),
- 'price_subtotal': fields.function(_amount_line, string='Subtotal', digits_compute= dp.get_precision('Purchase Price')),
+ 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price')),
+ 'price_subtotal': fields.function(_amount_line, string='Subtotal', digits_compute= dp.get_precision('Account')),
'order_id': fields.many2one('purchase.order', 'Order Reference', select=True, required=True, ondelete='cascade'),
'account_analytic_id':fields.many2one('account.analytic.account', 'Analytic Account',),
'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True),
diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml
index f92dbd8a48a..dedee77e8a1 100644
--- a/addons/purchase/report/order.rml
+++ b/addons/purchase/report/order.rml
@@ -274,10 +274,10 @@
[[ formatLang(line.product_qty ) ]] [[ line.product_uom.name ]]
- [[ formatLang(line.price_unit, digits=get_digits(dp='Purchase Price') ) ]]
+ [[ formatLang(line.price_unit, digits=get_digits(dp='Product Price') ) ]]
- [[ formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price'), currency_obj=o.pricelist_id.currency_id ) ]]
+ [[ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]
@@ -293,7 +293,7 @@
Net Total :
- [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Purchase Price'), currency_obj=o.pricelist_id.currency_id ) ]]
+ [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]
@@ -306,7 +306,7 @@
Taxes :
- [[ formatLang(o.amount_tax, dp='Purchase Price', currency_obj=o.pricelist_id.currency_id) ]]
+ [[ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]
@@ -319,7 +319,7 @@
Total :
- [[ formatLang(o.amount_total, digits=get_digits(dp='Purchase Price') , currency_obj=o.pricelist_id.currency_id) ]]
+ [[ formatLang(o.amount_total, digits=get_digits(dp='Account') , currency_obj=o.pricelist_id.currency_id) ]]
diff --git a/addons/purchase/res_config.py b/addons/purchase/res_config.py
index 4acbfaa49c4..6beac5a4cd0 100644
--- a/addons/purchase/res_config.py
+++ b/addons/purchase/res_config.py
@@ -59,21 +59,12 @@ class purchase_config_settings(osv.osv_memory):
help="""Purchase Requisitions are used when you want to request quotations from several suppliers for a given set of products.
You can configure per product if you directly do a Request for Quotation
to one supplier or if you want a purchase requisition to negotiate with several suppliers."""),
- 'decimal_precision': fields.integer('specify decimal precision on price',help="As an example, a decimal precision of 2 will allow prices like: 9.99 EUR, whereas a decimal precision of 4 will allow prices like: 0.0231 EUR per unit."),
}
_defaults = {
'default_invoice_method': 'manual',
}
- def get_default_dp(self, cr, uid, fields, context=None):
- dp = self.pool.get('ir.model.data').get_object(cr,uid, 'product','decimal_purchase')
- return {'decimal_precision': dp.digits}
-
- def set_default_dp(self, cr, uid, ids, context=None):
- config = self.browse(cr, uid, ids[0], context)
- dp = self.pool.get('ir.model.data').get_object(cr,uid, 'product','decimal_purchase')
- dp.write({'digits': config.decimal_precision})
diff --git a/addons/purchase/res_config_view.xml b/addons/purchase/res_config_view.xml
index a490bea557c..23d89f1a7f1 100644
--- a/addons/purchase/res_config_view.xml
+++ b/addons/purchase/res_config_view.xml
@@ -32,10 +32,6 @@
-
-
-
-
diff --git a/addons/sale/report/sale_order.rml b/addons/sale/report/sale_order.rml
index 8fecc17e62c..9f7ba06db95 100644
--- a/addons/sale/report/sale_order.rml
+++ b/addons/sale/report/sale_order.rml
@@ -266,13 +266,13 @@
[[ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty) ]] [[ line.product_uos and line.product_uos.name or line.product_uom.name ]]
- [[ formatLang(line.price_unit ) ]]
+ [[ formatLang(line.price_unit , digits=get_digits(dp='Product Price'))]]
- [[ formatLang(line.discount) ]]
+ [[ formatLang(line.discount, digits=get_digits(dp='Discount'))]]
- [[ formatLang(line.price_subtotal, digits=get_digits(dp='Sale Price'), currency_obj=o.pricelist_id.currency_id) ]]
+ [[ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id) ]]
@@ -288,7 +288,7 @@
Net Total :
- [[ formatLang(o.amount_untaxed, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]]
+ [[ formatLang(o.amount_untaxed, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]
@@ -301,7 +301,7 @@
Taxes :
- [[ formatLang(o.amount_tax, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]]
+ [[ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]
@@ -314,7 +314,7 @@
Total :
- [[ formatLang(o.amount_total, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]]
+ [[ formatLang(o.amount_total, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]
diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py
index 50c8a32cfa6..0a2e3a49f62 100644
--- a/addons/sale/res_config.py
+++ b/addons/sale/res_config.py
@@ -98,17 +98,7 @@ class sale_configuration(osv.osv_memory):
'module_project_timesheet': fields.boolean("Project Timesheet"),
'module_project_mrp': fields.boolean("Project MRP"),
'module_project': fields.boolean("Project"),
- 'decimal_precision': fields.integer("Decimal precision on prices:",help="As an example, a decimal precision of 2 will allow prices like: 9.99 EUR, whereas a decimal precision of 4 will allow prices like: 0.0231 EUR per unit."),
}
- def _check_decimal(self, cr, uid, ids, context=None):
- for decimal in self.browse(cr, uid, ids, context=context):
- if decimal.decimal_precision > 20:
- return False
- return True
-
- _constraints = [
- (_check_decimal, 'Digits must be between 0 to 20 ', ['decimal_precision']),
- ]
def default_get(self, cr, uid, fields, context=None):
ir_model_data = self.pool.get('ir.model.data')
@@ -139,14 +129,6 @@ class sale_configuration(osv.osv_memory):
'time_unit': _get_default_time_unit,
}
- def get_default_dp(self, cr, uid, fields, context=None):
- dp = self.pool.get('ir.model.data').get_object(cr, uid, 'product','decimal_sale')
- return {'decimal_precision': dp.digits}
-
- def set_default_dp(self, cr, uid, ids, context=None):
- config = self.browse(cr, uid, ids[0], context)
- dp = self.pool.get('ir.model.data').get_object(cr, uid, 'product','decimal_sale')
- dp.write({'digits': config.decimal_precision})
def set_sale_defaults(self, cr, uid, ids, context=None):
ir_values = self.pool.get('ir.values')
diff --git a/addons/sale/res_config_view.xml b/addons/sale/res_config_view.xml
index 37d58be5f0f..e07fcccedb2 100644
--- a/addons/sale/res_config_view.xml
+++ b/addons/sale/res_config_view.xml
@@ -95,10 +95,6 @@
-
-
-
-
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 722b22ba602..566b1ea2caa 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -247,19 +247,19 @@ class sale_order(osv.osv):
fnct_search=_invoiced_search, type='boolean', help="It indicates that an invoice has been paid."),
'note': fields.text('Terms and conditions'),
- 'amount_untaxed': fields.function(_amount_all, digits_compute= dp.get_precision('Sale Price'), string='Untaxed Amount',
+ 'amount_untaxed': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Untaxed Amount',
store = {
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
multi='sums', help="The amount without tax."),
- 'amount_tax': fields.function(_amount_all, digits_compute= dp.get_precision('Sale Price'), string='Taxes',
+ 'amount_tax': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Taxes',
store = {
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
},
multi='sums', help="The tax amount."),
- 'amount_total': fields.function(_amount_all, digits_compute= dp.get_precision('Sale Price'), string='Total',
+ 'amount_total': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Total',
store = {
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
@@ -1114,8 +1114,8 @@ class sale_order_line(osv.osv):
'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True),
'invoiced': fields.boolean('Invoiced', readonly=True),
'procurement_id': fields.many2one('procurement.order', 'Procurement'),
- 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price'), readonly=True, states={'draft': [('readonly', False)]}),
- 'price_subtotal': fields.function(_amount_line, string='Subtotal', digits_compute= dp.get_precision('Sale Price')),
+ 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price'), readonly=True, states={'draft': [('readonly', False)]}),
+ 'price_subtotal': fields.function(_amount_line, string='Subtotal', digits_compute= dp.get_precision('Account')),
'tax_id': fields.many2many('account.tax', 'sale_order_tax', 'order_line_id', 'tax_id', 'Taxes', readonly=True, states={'draft': [('readonly', False)]}),
'type': fields.selection([('make_to_stock', 'from stock'), ('make_to_order', 'on order')], 'Procurement Method', required=True, readonly=True, states={'draft': [('readonly', False)]},
help="If 'on order', it triggers a procurement when the sale order is confirmed to create a task, purchase order or manufacturing order linked to this sale order line."),
@@ -1127,7 +1127,7 @@ class sale_order_line(osv.osv):
'product_uos': fields.many2one('product.uom', 'Product UoS'),
'product_packaging': fields.many2one('product.packaging', 'Packaging'),
'move_ids': fields.one2many('stock.move', 'sale_line_id', 'Inventory Moves', readonly=True),
- 'discount': fields.float('Discount', digits=(16, 2), readonly=True, states={'draft': [('readonly', False)]}),
+ 'discount': fields.float('Discount (%)', digits_compute= dp.get_precision('Discount'), readonly=True, states={'draft': [('readonly', False)]}),
'number_packages': fields.function(_number_packages, type='integer', string='Number Packages'),
'th_weight': fields.float('Weight', readonly=True, states={'draft': [('readonly', False)]}),
'state': fields.selection([('cancel', 'Cancelled'),('draft', 'Draft'),('confirmed', 'Confirmed'),('exception', 'Exception'),('done', 'Done')], 'Status', required=True, readonly=True,
@@ -1205,7 +1205,7 @@ class sale_order_line(osv.osv):
pu = 0.0
if uosqty:
pu = round(line.price_unit * line.product_uom_qty / uosqty,
- self.pool.get('decimal.precision').precision_get(cr, uid, 'Sale Price'))
+ self.pool.get('decimal.precision').precision_get(cr, uid, 'Product Price'))
fpos = line.order_id.fiscal_position or False
account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, account_id)
if not account_id:
diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py
index 0952d820ebe..a672c6b680a 100644
--- a/addons/sale/wizard/sale_make_invoice_advance.py
+++ b/addons/sale/wizard/sale_make_invoice_advance.py
@@ -39,7 +39,7 @@ class sale_advance_payment_inv(osv.osv_memory):
'product_id': fields.many2one('product.product', 'Advance Product',
help="""Select a product of type service which is called 'Advance Product'.
You may have to create it and set it as a default value on this field."""),
- 'amount': fields.float('Advance Amount', digits_compute= dp.get_precision('Sale Price'),
+ 'amount': fields.float('Advance Amount', digits_compute= dp.get_precision('Account'),
help="The amount to be invoiced in advance."),
}