diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 064ba419ebd..012bde42eff 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1351,11 +1351,11 @@ class account_invoice_line(osv.osv): 'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null'), 'product_id': fields.many2one('product.product', 'Product', ondelete='set null'), 'account_id': fields.many2one('account.account', 'Account', required=True, domain=[('type','<>','view'), ('type', '<>', 'closed')], help="The income or expense account related to the selected product."), - 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Account')), + 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price')), 'price_subtotal': fields.function(_amount_line, string='Subtotal', type="float", digits_compute= dp.get_precision('Account'), store=True), - 'quantity': fields.float('Quantity', required=True), - 'discount': fields.float('Discount (%)', digits_compute= dp.get_precision('Account')), + 'quantity': fields.float('Quantity', digits_compute= dp.get_precision('Product Unit of Measure'), required=True), + 'discount': fields.float('Discount (%)', digits_compute= dp.get_precision('Discount')), 'invoice_line_tax_id': fields.many2many('account.tax', 'account_invoice_line_tax', 'invoice_line_id', 'tax_id', 'Taxes', domain=[('parent_id','=',False)]), 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'), 'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True), diff --git a/addons/auth_reset_password/static/src/js/reset_password.js b/addons/auth_reset_password/static/src/js/reset_password.js index 41b48c7e59b..13cf070a548 100644 --- a/addons/auth_reset_password/static/src/js/reset_password.js +++ b/addons/auth_reset_password/static/src/js/reset_password.js @@ -31,7 +31,7 @@ openerp.auth_reset_password = function(instance) { }, do_reset_password: function(db, email) { var self = this; - instance.connection.session_authenticate(db, 'anonymous', 'anonymous', true).pipe(function () { + instance.session.session_authenticate(db, 'anonymous', 'anonymous', true).pipe(function () { var func = new instance.web.Model("res.users").get_func("send_reset_password_request"); return func(email).then(function(res) { // show message diff --git a/addons/auth_signup/static/src/js/auth_signup.js b/addons/auth_signup/static/src/js/auth_signup.js index 7384fe1e5f5..9dda111f044 100644 --- a/addons/auth_signup/static/src/js/auth_signup.js +++ b/addons/auth_signup/static/src/js/auth_signup.js @@ -12,7 +12,7 @@ openerp.auth_signup = function(instance) { return false; } - var cnx = instance.connection; + var cnx = instance.session; if (cnx.session_is_valid()) { self._signup(); } else { @@ -83,7 +83,7 @@ openerp.auth_signup = function(instance) { type: 'ir.actions.client', tag: 'login', params: { - db: instance.connection.db, + db: instance.session.db, login: email, password: password, login_successful: function() { diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index d6d584aa62e..cf82011d27a 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -22,6 +22,7 @@ import time from osv import fields,osv from tools.translate import _ +import decimal_precision as dp class delivery_carrier(osv.osv): _name = "delivery.carrier" @@ -237,8 +238,8 @@ class delivery_grid_line(osv.osv): 'max_value': fields.float('Maximum Value', required=True), 'price_type': fields.selection([('fixed','Fixed'),('variable','Variable')], 'Price Type', required=True), 'variable_factor': fields.selection([('weight','Weight'),('volume','Volume'),('wv','Weight * Volume'), ('price','Price')], 'Variable Factor', required=True), - 'list_price': fields.float('Sale Price', required=True), - 'standard_price': fields.float('Cost Price', required=True), + 'list_price': fields.float('Sale Price', digits_compute= dp.get_precision('Product Price'), required=True), + 'standard_price': fields.float('Cost Price', digits_compute= dp.get_precision('Product Price'), required=True), } _defaults = { 'type': lambda *args: 'weight', diff --git a/addons/edi/static/src/js/edi.js b/addons/edi/static/src/js/edi.js index 24bf17a2f88..78e90852c38 100644 --- a/addons/edi/static/src/js/edi.js +++ b/addons/edi/static/src/js/edi.js @@ -6,7 +6,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({ this._super(); this.db = db; this.token = token; - this.session = openerp.connection; + this.session = openerp.session; this.template = "EdiEmpty"; this.content = ""; this.sidebar = ""; @@ -108,7 +108,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({ }); openerp.edi.edi_view = function (db, token) { - openerp.connection.session_bind().then(function () { + openerp.session.session_bind().then(function () { new openerp.edi.EdiView(null,db,token).appendTo($("body").addClass('openerp')); }); } @@ -188,7 +188,7 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({ }); openerp.edi.edi_import = function (url) { - openerp.connection.session_bind().then(function () { + openerp.session.session_bind().then(function () { new openerp.edi.EdiImport(null,url).appendTo($("body").addClass('openerp')); }); } diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index c690b91bb54..991437f3600 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -72,7 +72,7 @@ class hr_expense_expense(osv.osv): 'account_move_id': fields.many2one('account.move', 'Ledger Posting'), 'line_ids': fields.one2many('hr.expense.line', 'expense_id', 'Expense Lines', readonly=True, states={'draft':[('readonly',False)]} ), 'note': fields.text('Note'), - 'amount': fields.function(_amount, string='Total Amount'), + 'amount': fields.function(_amount, string='Total Amount', digits_compute= dp.get_precision('Account')), 'invoice_id': fields.many2one('account.invoice', "Employee's Invoice"), 'currency_id': fields.many2one('res.currency', 'Currency', required=True), 'department_id':fields.many2one('hr.department','Department'), @@ -258,8 +258,8 @@ class hr_expense_line(osv.osv): 'date_value': fields.date('Date', required=True), 'expense_id': fields.many2one('hr.expense.expense', 'Expense', ondelete='cascade', select=True), 'total_amount': fields.function(_amount, string='Total', digits_compute=dp.get_precision('Account')), - 'unit_amount': fields.float('Unit Price', digits_compute=dp.get_precision('Account')), - 'unit_quantity': fields.float('Quantities' ), + 'unit_amount': fields.float('Unit Price', digits_compute=dp.get_precision('Product Price')), + 'unit_quantity': fields.float('Quantities', digits_compute= dp.get_precision('Product Unit of Measure')), 'product_id': fields.many2one('product.product', 'Product', domain=[('hr_expense_ok','=',True)]), 'uom_id': fields.many2one('product.uom', 'Unit of Measure'), 'description': fields.text('Description'), diff --git a/addons/hr_timesheet_invoice/report/report_analytic.py b/addons/hr_timesheet_invoice/report/report_analytic.py index 0ff758189ff..469e13e71b6 100644 --- a/addons/hr_timesheet_invoice/report/report_analytic.py +++ b/addons/hr_timesheet_invoice/report/report_analytic.py @@ -72,7 +72,7 @@ class report_account_analytic_line_to_invoice(osv.osv): 'account_id':fields.many2one('account.analytic.account', 'Analytic account', readonly=True), 'product_uom_id':fields.many2one('product.uom', 'Unit of Measure', readonly=True), 'unit_amount': fields.float('Units', readonly=True), - 'sale_price': fields.float('Sale price', readonly=True, digits_compute=dp.get_precision('Sale Price')), + 'sale_price': fields.float('Sale price', readonly=True, digits_compute=dp.get_precision('Product Price')), 'amount': fields.float('Amount', readonly=True, digits_compute=dp.get_precision('Account')), 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True), diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index e268f3db5dd..bfabd2002bd 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -120,7 +120,7 @@ Normal - the campaign runs normally and automatically sends all emails and repor 'Status',), 'activity_ids': fields.one2many('marketing.campaign.activity', 'campaign_id', 'Activities'), - 'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for running this campaign. You may also specify variable cost and revenue on each campaign activity. Cost and Revenue statistics are included in Campaign Reporting.", digits_compute=dp.get_precision('Purchase Price')), + 'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for running this campaign. You may also specify variable cost and revenue on each campaign activity. Cost and Revenue statistics are included in Campaign Reporting.", digits_compute=dp.get_precision('Product Price')), } _defaults = { @@ -435,8 +435,8 @@ class marketing_campaign_activity(osv.osv): 'from_ids': fields.one2many('marketing.campaign.transition', 'activity_to_id', 'Previous Activities'), - 'variable_cost': fields.float('Variable Cost', help="Set a variable cost if you consider that every campaign item that has reached this point has entailed a certain cost. You can get cost statistics in the Reporting section", digits_compute=dp.get_precision('Purchase Price')), - 'revenue': fields.float('Revenue', help="Set an expected revenue if you consider that every campaign item that has reached this point has generated a certain revenue. You can get revenue statistics in the Reporting section", digits_compute=dp.get_precision('Sale Price')), + 'variable_cost': fields.float('Variable Cost', help="Set a variable cost if you consider that every campaign item that has reached this point has entailed a certain cost. You can get cost statistics in the Reporting section", digits_compute=dp.get_precision('Product Price')), + 'revenue': fields.float('Revenue', help="Set an expected revenue if you consider that every campaign item that has reached this point has generated a certain revenue. You can get revenue statistics in the Reporting section", digits_compute=dp.get_precision('Account')), 'signal': fields.char('Signal', size=128, help='An activity with a signal can be called programmatically. Be careful, the workitem is always created when a signal is sent'), 'keep_if_condition_not_met': fields.boolean("Don't Delete Workitems", diff --git a/addons/marketing_campaign/report/campaign_analysis.py b/addons/marketing_campaign/report/campaign_analysis.py index 0330cd1f7d3..d469be9c25e 100644 --- a/addons/marketing_campaign/report/campaign_analysis.py +++ b/addons/marketing_campaign/report/campaign_analysis.py @@ -63,8 +63,8 @@ class campaign_analysis(osv.osv): 'country_id': fields.related('partner_id', 'country_id', type='many2one', relation='res.country',string='Country'), 'total_cost' : fields.function(_total_cost, string='Cost', - type="float", digits_compute=dp.get_precision('Purchase Price')), - 'revenue': fields.float('Revenue', readonly=True, digits_compute=dp.get_precision('Sale Price')), + type="float", digits_compute=dp.get_precision('Account')), + 'revenue': fields.float('Revenue', readonly=True, digits_compute=dp.get_precision('Account')), 'count' : fields.integer('# of Actions', readonly=True), 'state': fields.selection([('todo', 'To Do'), ('exception', 'Exception'), ('done', 'Done'), diff --git a/addons/membership/membership.py b/addons/membership/membership.py index f6bcc5087e6..3439f97f833 100644 --- a/addons/membership/membership.py +++ b/addons/membership/membership.py @@ -146,7 +146,7 @@ class membership_line(osv.osv): 'date_to': fields.date('To', readonly=True), 'date_cancel': fields.date('Cancel date'), 'date': fields.date('Join Date', help="Date on which member has joined the membership"), - 'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Sale Price'), required=True, help='Amount for the membership'), + 'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Product Price'), required=True, help='Amount for the membership'), 'account_invoice_line': fields.many2one('account.invoice.line', 'Account Invoice line', readonly=True), 'account_invoice_id': fields.related('account_invoice_line', 'invoice_id', type='many2one', relation='account.invoice', string='Invoice', readonly=True), 'state': fields.function(_state, @@ -447,7 +447,7 @@ Partner() class product_template(osv.osv): _inherit = 'product.template' _columns = { - 'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Sale Price')), + 'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Product Price')), } product_template() diff --git a/addons/membership/wizard/membership_invoice.py b/addons/membership/wizard/membership_invoice.py index d0be223158f..4ef16b99d82 100644 --- a/addons/membership/wizard/membership_invoice.py +++ b/addons/membership/wizard/membership_invoice.py @@ -29,7 +29,7 @@ class membership_invoice(osv.osv_memory): _description = "Membership Invoice" _columns = { 'product_id': fields.many2one('product.product','Membership', required=True), - 'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Sale Price'), required=True), + 'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Product Price'), required=True), } def onchange_product(self, cr, uid, ids, product_id=False): """This function returns value of product's member price based on product id. diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 9b3b724306f..527505d8ea5 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -138,7 +138,7 @@ class report_custom(report_rml): """ % (_('Components'), _('Components suppliers'), _('Quantity'),_('Cost Price per Unit of Measure'), _('Supplier Price per Unit of Measure')) - purchase_price_digits = rml_obj.get_digits(dp='Purchase Price') + purchase_price_digits = rml_obj.get_digits(dp='Product Price') for product in product_pool.browse(cr, uid, ids, context=context): product_uom_name = to_xml(product.uom_id.name) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index c9dc3f5e7bc..f41abb58c08 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -692,10 +692,10 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'to_invoice': fields.boolean('To Invoice'), 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok','=',True)], required=True), 'invoiced': fields.boolean('Invoiced',readonly=True), - 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price')), - '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')), + 'price_subtotal': fields.function(_amount_line, string='Subtotal',digits_compute= dp.get_precision('Account')), 'tax_id': fields.many2many('account.tax', 'repair_operation_line_tax', 'repair_operation_line_id', 'tax_id', 'Taxes'), - 'product_uom_qty': fields.float('Quantity', digits_compute= dp.get_precision('Product UoS'), required=True), + 'product_uom_qty': fields.float('Quantity', digits_compute= dp.get_precision('Product Unit of Measure'), required=True), 'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True), 'prodlot_id': fields.many2one('stock.production.lot', 'Lot Number',domain="[('product_id','=',product_id)]"), 'invoice_line_id': fields.many2one('account.invoice.line', 'Invoice Line', readonly=True), @@ -784,10 +784,10 @@ class mrp_repair_fee(osv.osv, ProductChangeMixin): 'repair_id': fields.many2one('mrp.repair', 'Repair Order Reference', required=True, ondelete='cascade', select=True), 'name': fields.char('Description', size=64, select=True,required=True), 'product_id': fields.many2one('product.product', 'Product'), - 'product_uom_qty': fields.float('Quantity', digits=(16,2), required=True), + 'product_uom_qty': fields.float('Quantity', digits_compute= dp.get_precision('Product Unit of Measure'), required=True), 'price_unit': fields.float('Unit Price', required=True), 'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True), - 'price_subtotal': fields.function(_amount_line, string='Subtotal',digits_compute= dp.get_precision('Sale Price')), + 'price_subtotal': fields.function(_amount_line, string='Subtotal',digits_compute= dp.get_precision('Account')), 'tax_id': fields.many2many('account.tax', 'repair_fee_line_tax', 'repair_fee_line_id', 'tax_id', 'Taxes'), 'invoice_line_id': fields.many2one('account.invoice.line', 'Invoice Line', readonly=True), 'to_invoice': fields.boolean('To Invoice'), diff --git a/addons/point_of_sale/static/src/js/pos_widgets.js b/addons/point_of_sale/static/src/js/pos_widgets.js index bebbb3c1591..9a27be29381 100644 --- a/addons/point_of_sale/static/src/js/pos_widgets.js +++ b/addons/point_of_sale/static/src/js/pos_widgets.js @@ -674,7 +674,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa self.$('.loader img').hide(); return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_pos_session_opening']], ['res_id']) .pipe( _.bind(function(res){ - return instance.connection.rpc('/web/action/load', {'action_id': res[0]['res_id']}) + return instance.session.rpc('/web/action/load', {'action_id': res[0]['res_id']}) .pipe(_.bind(function(result){ var action = result.result; this.do_action(action); diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index 806d9683e68..c333000621a 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -407,18 +407,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('Product Price')), '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('Product Price'), 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('Product Price')), 'price_max_margin': fields.float('Max. Price Margin', - digits_compute= dp.get_precision('Sale Price')), + digits_compute= dp.get_precision('Product Price')), '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 2a62d9c2531..ae99711a5ec 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -272,8 +272,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('Product 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('Product Price'), 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."), @@ -518,8 +518,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('Product Price')), + 'lst_price' : fields.function(_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Product Price')), '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), @@ -528,8 +528,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('Product Price')), + 'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Product Price')), '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'), @@ -878,7 +878,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('Product 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"), } _order = 'min_quantity asc' pricelist_partnerinfo() diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml index 94a262f4dc6..80dbfac564d 100644 --- a/addons/product/product_data.xml +++ b/addons/product/product_data.xml @@ -157,12 +157,12 @@ parameter) will see those record just disappear. - - Sale Price + + Product Price 2 - - Purchase Price + + Discount 2 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..1daf6de034e 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -143,7 +143,6 @@ class purchase_order(osv.osv): STATE_SELECTION = [ ('draft', 'Draft PO'), - ('wait', 'Waiting'), ('sent', 'RFQ Sent'), ('confirmed', 'Waiting Approval'), ('approved', 'Purchase Order'), @@ -190,15 +189,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 +803,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/purchase_view.xml b/addons/purchase/purchase_view.xml index 6730e32913e..9cb5430ed4e 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -180,16 +180,15 @@