[MERGE] branch merged with lp:~openerp-dev/openobject-addons/trunk-dev-addons3
bzr revid: mtr@mtr-20101029124132-wiut9v38py0zpte8
This commit is contained in:
@@ -164,6 +164,10 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||
move_state = ['draft','posted']
|
||||
if self.target_move == 'posted':
|
||||
move_state = ['posted']
|
||||
if self.reconcil:
|
||||
RECONCILE_TAG = " "
|
||||
else:
|
||||
RECONCILE_TAG = "AND l.reconcile_id IS NULL"
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT COALESCE(SUM(l.debit),0.0), COALESCE(SUM(l.credit),0.0), COALESCE(sum(debit-credit), 0.0) " \
|
||||
@@ -173,7 +177,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||
"AND m.id = l.move_id " \
|
||||
"AND m.state IN %s "
|
||||
"AND account_id IN %s" \
|
||||
"AND reconcile_id IS NULL " \
|
||||
" " + RECONCILE_TAG + " "\
|
||||
"AND " + self.init_query + " ",
|
||||
(partner.id, tuple(move_state), tuple(self.account_ids)))
|
||||
return self.cr.fetchall()
|
||||
|
||||
@@ -23,7 +23,6 @@ from osv import osv, fields
|
||||
from tools import cache
|
||||
import pooler
|
||||
|
||||
|
||||
class decimal_precision(osv.osv):
|
||||
_name = 'decimal.precision'
|
||||
_columns = {
|
||||
@@ -31,7 +30,7 @@ class decimal_precision(osv.osv):
|
||||
'digits': fields.integer('Digits', required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'digits': lambda *a : 2,
|
||||
'digits': 2,
|
||||
}
|
||||
|
||||
_sql_constraints = [
|
||||
@@ -55,10 +54,10 @@ class decimal_precision(osv.osv):
|
||||
|
||||
decimal_precision()
|
||||
|
||||
|
||||
def get_precision(application):
|
||||
def change_digit(cr):
|
||||
res = pooler.get_pool(cr.dbname).get('decimal.precision').precision_get(cr, 1, application)
|
||||
return (16, res)
|
||||
return change_digit
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
Reference in New Issue
Block a user