From 03079183be98fb1e31ff2159c05547e000ca7306 Mon Sep 17 00:00:00 2001
From: "olt@tinyerp.com" <>
Date: Fri, 1 Oct 2010 13:19:29 +0200
Subject: [PATCH] [IMP] account_budget: 'crossovered_budget_report' uses
decimal_precision
bzr revid: olt@tinyerp.com-20101001111929-e23695jz3erj3mci
---
addons/account_budget/crossovered_budget.py | 10 ++++++----
.../report/crossovered_budget_report.rml | 18 +++++++++---------
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py
index 6c7eb6639ec..335cf7a1d5f 100644
--- a/addons/account_budget/crossovered_budget.py
+++ b/addons/account_budget/crossovered_budget.py
@@ -24,6 +24,8 @@ import datetime
from osv import osv, fields
from tools.translate import _
+import decimal_precision as dp
+
def strToDate(dt):
dt_date=datetime.date(int(dt[0:4]),int(dt[5:7]),int(dt[8:10]))
return dt_date
@@ -240,9 +242,9 @@ class crossovered_budget_lines(osv.osv):
'date_from': fields.date('Start Date', required=True),
'date_to': fields.date('End Date', required=True),
'paid_date': fields.date('Paid Date'),
- 'planned_amount':fields.float('Planned Amount', required=True, digits=(16,2)),
- 'practical_amount':fields.function(_prac, method=True, string='Practical Amount', type='float', digits=(16,2)),
- 'theoritical_amount':fields.function(_theo, method=True, string='Theoritical Amount', type='float', digits=(16,2)),
+ 'planned_amount':fields.float('Planned Amount', required=True, digits_compute=dp.get_precision('Account')),
+ 'practical_amount':fields.function(_prac, method=True, string='Practical Amount', type='float', digits_compute=dp.get_precision('Account')),
+ 'theoritical_amount':fields.function(_theo, method=True, string='Theoritical Amount', type='float', digits_compute=dp.get_precision('Account')),
'percentage':fields.function(_perc, method=True, string='Percentage', type='float'),
'company_id': fields.related('crossovered_budget_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
}
@@ -258,4 +260,4 @@ class account_analytic_account(osv.osv):
account_analytic_account()
-# 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/account_budget/report/crossovered_budget_report.rml b/addons/account_budget/report/crossovered_budget_report.rml
index 9ef3dc716af..e297c8b3ca2 100644
--- a/addons/account_budget/report/crossovered_budget_report.rml
+++ b/addons/account_budget/report/crossovered_budget_report.rml
@@ -148,16 +148,16 @@