diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index e765989040b..d9e9bf3907b 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -23,6 +23,8 @@ from osv import osv, fields from osv.orm import intersect import tools.sql from tools.translate import _ +from decimal_precision import decimal_precision as dp + class account_analytic_account(osv.osv): _name = "account.analytic.account" @@ -351,22 +353,47 @@ class account_analytic_account(osv.osv): return res _columns ={ - 'ca_invoiced': fields.function(_ca_invoiced_calc, method=True, type='float', string='Invoiced Amount', help="Total customer invoiced amount for this account."), - 'total_cost': fields.function(_total_cost_calc, method=True, type='float', string='Total Costs', help="Total of costs for this account. It includes real costs (from invoices) and indirect costs, like time spent on timesheets."), - 'ca_to_invoice': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Amount', help="If invoice from analytic account, the remaining amount you can invoice to the customer based on the total costs."), - 'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theorical Revenue', help="Based on the costs you had on the project, what would have been the revenue if all these costs have been invoiced at the normal sale price provided by the pricelist."), - 'hours_quantity': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Hours Tot', help="Number of hours you spent on the analytic account (from timesheet). It computes on all journal of type 'general'."), - 'last_invoice_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Last Invoice Date', help="Date of the last invoice created for this analytic account."), - 'last_worked_invoiced_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Invoiced Cost', help="If invoice from the costs, this is the date of the latest work or cost that have been invoiced."), - 'last_worked_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Cost/Work', help="Date of the latest work done on this account."), - 'hours_qtt_non_invoiced': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Hours', help="Number of hours (from journal of type 'general') that can be invoiced if you invoice based on analytic account."), - 'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, method=True, type='float', string='Invoiced Hours', help="Number of hours that can be invoiced plus those that already have been invoiced."), - 'remaining_hours': fields.function(_remaining_hours_calc, method=True, type='float', string='Remaining Hours', help="Computed using the formula: Maximum Quantity - Hours Tot."), - 'remaining_ca': fields.function(_remaining_ca_calc, method=True, type='float', string='Remaining Revenue', help="Computed using the formula: Max Invoice Price - Invoiced Amount."), - 'revenue_per_hour': fields.function(_revenue_per_hour_calc, method=True, type='float', string='Revenue per Hours (real)', help="Computed using the formula: Invoiced Amount / Hours Tot."), - 'real_margin': fields.function(_real_margin_calc, method=True, type='float', string='Real Margin', help="Computed using the formula: Invoiced Amount - Total Costs."), - 'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical Margin', help="Computed using the formula: Theorial Revenue - Total Costs"), - 'real_margin_rate': fields.function(_real_margin_rate_calc, method=True, type='float', string='Real Margin Rate (%)', help="Computes using the formula: (Real Margin / Total Costs) * 100."), + 'ca_invoiced': fields.function(_ca_invoiced_calc, method=True, type='float', string='Invoiced Amount', + help="Total customer invoiced amount for this account.", + digits_compute=dp.get_precision('Account')), + 'total_cost': fields.function(_total_cost_calc, method=True, type='float', string='Total Costs', + help="Total of costs for this account. It includes real costs (from invoices) and indirect costs, like time spent on timesheets.", + digits_compute=dp.get_precision('Account')), + 'ca_to_invoice': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Amount', + help="If invoice from analytic account, the remaining amount you can invoice to the customer based on the total costs.", + digits_compute=dp.get_precision('Account')), + 'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theorical Revenue', + help="Based on the costs you had on the project, what would have been the revenue if all these costs have been invoiced at the normal sale price provided by the pricelist.", + digits_compute=dp.get_precision('Account')), + 'hours_quantity': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Hours Tot', + help="Number of hours you spent on the analytic account (from timesheet). It computes on all journal of type 'general'."), + 'last_invoice_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Last Invoice Date', + help="Date of the last invoice created for this analytic account."), + 'last_worked_invoiced_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Invoiced Cost', + help="If invoice from the costs, this is the date of the latest work or cost that have been invoiced."), + 'last_worked_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Cost/Work', + help="Date of the latest work done on this account."), + 'hours_qtt_non_invoiced': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Hours', + help="Number of hours (from journal of type 'general') that can be invoiced if you invoice based on analytic account."), + 'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, method=True, type='float', string='Invoiced Hours', + help="Number of hours that can be invoiced plus those that already have been invoiced."), + 'remaining_hours': fields.function(_remaining_hours_calc, method=True, type='float', string='Remaining Hours', + help="Computed using the formula: Maximum Quantity - Hours Tot."), + 'remaining_ca': fields.function(_remaining_ca_calc, method=True, type='float', string='Remaining Revenue', + help="Computed using the formula: Max Invoice Price - Invoiced Amount.", + digits_compute=dp.get_precision('Account')), + 'revenue_per_hour': fields.function(_revenue_per_hour_calc, method=True, type='float', string='Revenue per Hours (real)', + help="Computed using the formula: Invoiced Amount / Hours Tot.", + digits_compute=dp.get_precision('Account')), + 'real_margin': fields.function(_real_margin_calc, method=True, type='float', string='Real Margin', + help="Computed using the formula: Invoiced Amount - Total Costs.", + digits_compute=dp.get_precision('Account')), + 'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical Margin', + help="Computed using the formula: Theorial Revenue - Total Costs", + digits_compute=dp.get_precision('Account')), + 'real_margin_rate': fields.function(_real_margin_rate_calc, method=True, type='float', string='Real Margin Rate (%)', + help="Computes using the formula: (Real Margin / Total Costs) * 100.", + digits_compute=dp.get_precision('Account')), 'month_ids': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='many2many', relation='account_analytic_analysis.summary.month', string='Month'), 'user_ids': fields.function(_analysis_all, method=True, multi='analytic_analysis', type="many2many", relation='account_analytic_analysis.summary.user', string='User'), } diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index cf96028f01c..66c74a72bc9 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -25,6 +25,7 @@ import operator from osv import fields, osv import decimal_precision as dp + class account_analytic_account(osv.osv): _name = 'account.analytic.account' _description = 'Analytic Account' @@ -272,7 +273,7 @@ class account_analytic_line(osv.osv): _columns = { 'name' : fields.char('Description', size=256, required=True), 'date' : fields.date('Date', required=True, select=1), - 'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.'), + 'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.', digits_compute=dp.get_precision('Account')), 'unit_amount' : fields.float('Quantity', help='Specifies the amount of quantity to count.'), 'account_id' : fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True), 'user_id' : fields.many2one('res.users', 'User'), diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index b71e2daa447..7ccd07351f0 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -724,7 +724,7 @@ true, it will allow you to hide the event alarm information without removing it. if alarm_ids: alarm_obj.unlink(cr, uid, alarm_ids) cr.execute('Update %s set base_calendar_alarm_id=NULL, alarm_id=NULL\ - where id=%%d' % model_obj._table,(datas.id,)) + where id=%%s' % model_obj._table,(datas.id,)) return True res_alarm() diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index bcc624d6a67..d22fa98f6e4 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -716,7 +716,7 @@ class basic_calendar_line(osv.osv): """ cr.execute("SELECT COUNT(id) FROM basic_calendar_lines \ - WHERE name='%s' AND calendar_id=%s", + WHERE name=%s AND calendar_id=%s", (vals.get('name'), vals.get('calendar_id'))) res = cr.fetchone() if res: diff --git a/addons/event/event.py b/addons/event/event.py index 7a6e904f6e3..ea4a9cf9b8b 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -28,6 +28,7 @@ import time import tools import decimal_precision as dp + class event_type(osv.osv): """ Event Type """ _name = 'event.type' @@ -225,7 +226,7 @@ class event_event(osv.osv): 'product_id': fields.many2one('product.product', 'Product', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="The invoices of this event registration will be created with this Product. Thus it allows you to set the default label and the accounting info you want by default on these invoices."), 'note': fields.text('Notes', help="Description or Summary of Event", readonly=False, states={'done': [('readonly', True)]}), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist version for current event."), - 'unit_price': fields.related('product_id', 'list_price', type='float', string='Registration Cost', readonly=True, states={'draft':[('readonly',False)]}, help="This will be the default price used as registration cost when invoicing this event. Note that you can specify for each registration a specific amount if you want to"), + 'unit_price': fields.related('product_id', 'list_price', type='float', string='Registration Cost', readonly=True, states={'draft':[('readonly',False)]}, help="This will be the default price used as registration cost when invoicing this event. Note that you can specify for each registration a specific amount if you want to", digits_compute=dp.get_precision('Sale Price')), 'main_speaker_id': fields.many2one('res.partner','Main Speaker', readonly=False, states={'done': [('readonly', True)]}, help="Speaker who are giving speech on event."), 'speaker_ids':fields.many2many('res.partner', 'event_speaker_rel', 'speaker_id', 'partner_id', 'Other Speakers', readonly=False, states={'done': [('readonly', True)]}), 'address_id': fields.many2one('res.partner.address','Location Address', readonly=False, states={'done': [('readonly', True)]}), @@ -306,8 +307,8 @@ class event_registration(osv.osv): 'partner_id': fields.many2one('res.partner', 'Partner', states={'done': [('readonly', True)]}), "partner_invoice_id": fields.many2one('res.partner', 'Partner Invoiced', readonly=True, states={'draft': [('readonly', False)]}), "contact_id": fields.many2one('res.partner.contact', 'Partner Contact', readonly=False, states={'done': [('readonly', True)]}), #TODO: filter only the contacts that have a function into the selected partner_id - "unit_price": fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Event Price'), readonly=True, states={'draft': [('readonly', False)]}), - 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Event Price')), + "unit_price": 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, method=True, string='Subtotal', digits_compute=dp.get_precision('Sale Price')), "badge_ids": fields.one2many('event.registration.badge', 'registration_id', 'Badges', readonly=False, states={'done': [('readonly', True)]}), "event_product": fields.char("Invoice Name", size=128, readonly=True, states={'draft': [('readonly', False)]}), "tobe_invoiced": fields.boolean("To be Invoiced", readonly=True, states={'draft': [('readonly', False)]}), diff --git a/addons/event/wizard/partner_event_registration.py b/addons/event/wizard/partner_event_registration.py index 8462a812313..00f106ab8ae 100644 --- a/addons/event/wizard/partner_event_registration.py +++ b/addons/event/wizard/partner_event_registration.py @@ -24,6 +24,7 @@ import netsvc import tools from osv import fields, osv from tools.translate import _ +from decimal_precision import decimal_precision as dp class partner_event_registration(osv.osv_memory): @@ -36,7 +37,7 @@ class partner_event_registration(osv.osv_memory): _columns = { 'event_id': fields.many2one('event.event', 'Event'), 'event_type': fields.many2one('event.type', 'Type', readonly=True), - 'unit_price': fields.float('Registration Cost'), + 'unit_price': fields.float('Registration Cost', digits_compute=dp.get_precision('Sale Price')), 'start_date': fields.datetime('Start date', required=True, help="Beginning Date of Event", readonly=True), 'end_date': fields.datetime('Closing date', required=True, help="Closing Date of Event", readonly=True), 'nb_register': fields.integer('Number of Registration'), diff --git a/addons/hr_timesheet_invoice/report/report_analytic.py b/addons/hr_timesheet_invoice/report/report_analytic.py index 0b3d1440f23..d2db7fd4027 100644 --- a/addons/hr_timesheet_invoice/report/report_analytic.py +++ b/addons/hr_timesheet_invoice/report/report_analytic.py @@ -21,6 +21,8 @@ from osv import fields,osv import tools +from decimal_precision import decimal_precision as dp + class report_analytic_account_close(osv.osv): _name = "report.analytic.account.close" @@ -70,8 +72,8 @@ 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', 'UoM', readonly=True), 'unit_amount': fields.float('Units', readonly=True), - 'sale_price': fields.float('Sale price', readonly=True), - 'amount': fields.float('Amount', readonly=True), + 'sale_price': fields.float('Sale price', readonly=True, digits_compute=dp.get_precision('Sale 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/report/campaign_analysis_view.xml b/addons/marketing_campaign/report/campaign_analysis_view.xml index aa994fcfc48..fd5a8c0908f 100644 --- a/addons/marketing_campaign/report/campaign_analysis_view.xml +++ b/addons/marketing_campaign/report/campaign_analysis_view.xml @@ -84,8 +84,8 @@ - - + + diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index af88c32f42a..6cec29650f3 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -687,8 +687,9 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): if type == 'add': stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0] to_invoice = False - if guarantee_limit and date.today() > datetime.strptime(guarantee_limit, '%Y-%m-%d'): + if guarantee_limit and datetime.strptime(date.today().strftime('%Y-%m-%d'), '%Y-%m-%d') > datetime.strptime(guarantee_limit, '%Y-%m-%d'): to_invoice=True + return {'value': { 'to_invoice': to_invoice, 'location_id': stock_id, diff --git a/addons/mrp_repair/report/order.py b/addons/mrp_repair/report/order.py index 3d6f9200dd8..d6edc1f01e4 100644 --- a/addons/mrp_repair/report/order.py +++ b/addons/mrp_repair/report/order.py @@ -33,9 +33,9 @@ class order(report_sxw.rml_parse): def total(self, repair): total = 0.0 for operation in repair.operations: - total+=operation.price_subtotal + total += operation.price_subtotal for fee in repair.fees_lines: - total+=fee.price_subtotal + total += fee.price_subtotal total = total + repair.amount_tax return total diff --git a/addons/mrp_repair/report/order.rml b/addons/mrp_repair/report/order.rml index 149a2650bfd..328b5e931ee 100644 --- a/addons/mrp_repair/report/order.rml +++ b/addons/mrp_repair/report/order.rml @@ -343,7 +343,7 @@ Net Total : - [[ formatLang(o.amount_untaxed)]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Sale Price'))]] [[ o.pricelist_id.currency_id. symbol ]] @@ -357,7 +357,7 @@ Taxes: - [[ formatLang(o.amount_tax)]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(o.amount_tax, digits=get_digits(dp='Account'))]] [[ o.pricelist_id.currency_id. symbol ]] @@ -370,7 +370,7 @@ Total : - [[ formatLang(total(o)) ]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(total(o), digits=get_digits(dp='Sale Price')) ]] [[ o.pricelist_id.currency_id. symbol ]] @@ -391,4 +391,4 @@ - \ No newline at end of file + diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 411351f1be1..3c53cfe8630 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -112,6 +112,7 @@ class project_work(osv.osv): timesheet_obj = self.pool.get('hr.analytic.timesheet') project_obj = self.pool.get('project.project') uom_obj = self.pool.get('product.uom') + result = {} if isinstance(ids, (long, int)): ids = [ids,] @@ -139,7 +140,7 @@ class project_work(osv.osv): vals_line['unit_amount'] = vals['hours'] prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set - if result['product_uom_id'] and (not result['product_uom_id'] == default_uom): + if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom): vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id']) # Compute based on pricetype diff --git a/addons/report_intrastat/report_intrastat.py b/addons/report_intrastat/report_intrastat.py index 90c2884cceb..a77c4f5d389 100644 --- a/addons/report_intrastat/report_intrastat.py +++ b/addons/report_intrastat/report_intrastat.py @@ -21,6 +21,7 @@ from osv import osv, fields from tools.sql import drop_view_if_exists +from decimal_precision import decimal_precision as dp class res_country(osv.osv): @@ -69,7 +70,7 @@ class report_intrastat(osv.osv): 'code': fields.char('Country code', size=2, readonly=True), 'intrastat_id': fields.many2one('report.intrastat.code', 'Intrastat code', readonly=True), 'weight': fields.float('Weight', readonly=True), - 'value': fields.float('Value', readonly=True), + 'value': fields.float('Value', readonly=True, digits_compute=dp.get_precision('Account')), 'type': fields.selection([('import', 'Import'), ('export', 'Export')], 'Type'), 'currency_id': fields.many2one('res.currency', "Currency", readonly=True), } diff --git a/addons/sale_journal/report/picking_journal_report.py b/addons/sale_journal/report/picking_journal_report.py index 0b447f45cce..74c00367838 100644 --- a/addons/sale_journal/report/picking_journal_report.py +++ b/addons/sale_journal/report/picking_journal_report.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,12 +15,14 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## from osv import fields, osv import tools +from decimal_precision import decimal_precision as dp + class sale_journal_picking_report(osv.osv): """ @@ -30,32 +32,32 @@ class sale_journal_picking_report(osv.osv): _description = "Picking lists" _auto = False _columns = { - 'name': fields.char('Year', size=64, required=False, readonly=True), - '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), + 'name': fields.char('Year', size=64, required=False, readonly=True), + '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), 'invoice_state':fields.selection([ - ("invoiced", "invoiced"), - ("2binvoiced", "to be invoiced"), + ("invoiced", "invoiced"), + ("2binvoiced", "to be invoiced"), ("none", "None") - ], "Invoice state", readonly=True), + ], "Invoice state", readonly=True), 'state': fields.selection([ - ('draft', 'draft'), - ('auto', 'waiting'), - ('confirmed', 'confirmed'), - ('assigned', 'assigned'), - ('done', 'done'), - ('cancel', 'cancel'), - ], 'State', readonly=True), - 'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True), - 'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True), - 'quantity': fields.float('Quantities', readonly=True), - 'price_total': fields.float('Total Price', readonly=True), - 'price_average': fields.float('Average Price', readonly=True), - 'count': fields.integer('# of Lines', readonly=True), + ('draft', 'draft'), + ('auto', 'waiting'), + ('confirmed', 'confirmed'), + ('assigned', 'assigned'), + ('done', 'done'), + ('cancel', 'cancel'), + ], 'State', readonly=True), + 'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True), + 'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True), + 'quantity': fields.float('Quantities', readonly=True), + 'price_total': fields.float('Total Price', readonly=True, digits_compute=dp.get_precision('Sale Price')), + 'price_average': fields.float('Average Price', readonly=True, digits_compute=dp.get_precision('Sale Price')), + 'count': fields.integer('# of Lines', readonly=True), } _order = 'journal_id, name desc, price_total desc' - + def init(self, cr): tools.drop_view_if_exists(cr, 'sale_journal_picking_report') @@ -80,7 +82,7 @@ class sale_journal_picking_report(osv.osv): order by s.invoice_type_id, s.invoice_state, s.state ) """) - + sale_journal_picking_report() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report/lot_overview.rml b/addons/stock/report/lot_overview.rml index f4332455cf9..cebacedeb01 100644 --- a/addons/stock/report/lot_overview.rml +++ b/addons/stock/report/lot_overview.rml @@ -167,10 +167,10 @@ [[formatLang( p['prod_qty']) ]] [[ p['uom'] ]] - [[ formatLang(p['price']) ]] + [[ formatLang(p['price'], digits=get_digits(dp='Account')) ]] - [[ formatLang(p['price_value']) ]] [[ o.company_id.currency_id.symbol]] + [[ formatLang(p['price_value'], digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol]] @@ -184,7 +184,7 @@ Total: - [[ formatLang(price_total()) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(price_total(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]] @@ -201,7 +201,7 @@ - [[ formatLang(grand_total_price()) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(grand_total_price(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]] @@ -209,4 +209,4 @@ - \ No newline at end of file + diff --git a/addons/stock/report/lot_overview_all.rml b/addons/stock/report/lot_overview_all.rml index a0e58e8ce7d..4c4c71561a2 100644 --- a/addons/stock/report/lot_overview_all.rml +++ b/addons/stock/report/lot_overview_all.rml @@ -167,10 +167,10 @@ [[formatLang( p['prod_qty']) ]] [[ p['uom'] ]] - [[ formatLang(p['price']) ]] + [[ formatLang(p['price'], digits=get_digits(dp='Account')) ]] - [[ formatLang(p['price_value']) ]] [[ o.company_id.currency_id.symbol]] + [[ formatLang(p['price_value'], digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol]] @@ -184,7 +184,7 @@ Total: - [[ formatLang(price_total()) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(price_total(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]] @@ -201,7 +201,7 @@ - [[ formatLang(grand_total_price()) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(grand_total_price(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]] @@ -209,4 +209,4 @@ - \ No newline at end of file + diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py index a96144060ca..6907f4ed3d5 100644 --- a/addons/stock/report/report_stock_move.py +++ b/addons/stock/report/report_stock_move.py @@ -21,6 +21,7 @@ import tools from osv import fields,osv +from decimal_precision import decimal_precision as dp class report_stock_move(osv.osv): @@ -44,7 +45,7 @@ class report_stock_move(osv.osv): 'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True), 'product_qty_in':fields.integer('In Qty',readonly=True), 'product_qty_out':fields.integer('Out Qty',readonly=True), - 'value' : fields.float('Total Value', required=True), + 'value' : fields.float('Total Value', required=True, digits_compute=dp.get_precision('Sale Price')), 'day_diff2':fields.float('Delay (Days)',readonly=True, digits=(16,2), group_operator="avg"), 'day_diff1':fields.float('Planned (Days)',readonly=True, digits=(16,2), group_operator="avg"), 'day_diff':fields.float('Real (Days)',readonly=True, digits=(16,2), group_operator="avg"), @@ -136,7 +137,7 @@ class report_stock_inventory(osv.osv): 'prodlot_id': fields.many2one('stock.production.lot', 'Lot', readonly=True), 'company_id': fields.many2one('res.company', 'Company', readonly=True), 'product_qty':fields.float('Qty', digits=(16,2), readonly=True), - 'value' : fields.float('Total Value', digits=(16,2), required=True), + 'value' : fields.float('Total Value', digits=(16,2), required=True, digits_compute=dp.get_precision('Sale Price')), 'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True, help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\ \nThe state is \'Waiting\' if the move is waiting for another one.'),