2
# -*- coding: utf-8 -*-
3
##############################################################################
5
# OpenERP, Open Source Management Solution
6
# Copyright (C) 2011 TeMPO Consulting, MSF. All Rights Reserved
7
# Developer: Olivier DOSSMANN
9
# This program is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU Affero General Public License as
11
# published by the Free Software Foundation, either version 3 of the
12
# License, or (at your option) any later version.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU Affero General Public License for more details.
19
# You should have received a copy of the GNU Affero General Public License
20
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
##############################################################################
26
class account_move_reconcile(osv.osv):
27
_name = "account.move.reconcile"
28
_inherit = "account.move.reconcile"
30
def reconcile_partial_check(self, cr, uid, ids, type='auto', context=None):
32
WARNING: This method has been taken from account module from OpenERP
34
# @@@override@account.account.py
36
for rec in self.browse(cr, uid, ids, context=context):
37
for line in rec.line_partial_ids:
38
total += (line.debit_currency or 0.0) - (line.credit_currency or 0.0)
40
self.pool.get('account.move.line').write(cr, uid,
41
map(lambda x: x.id, rec.line_partial_ids),
42
{'reconcile_id': rec.id }
47
def name_get(self, cr, uid, ids, context=None):
49
WARNING: This method has been taken from account module from OpenERP
51
# @@@override@account.account.py
55
for r in self.browse(cr, uid, ids, context=context):
56
total = reduce(lambda y,t: (t.debit_currency or 0.0) - (t.credit_currency or 0.0) + y, r.line_partial_ids, 0.0)
58
name = '%s (%.2f)' % (r.name, total)
59
result.append((r.id,name))
61
result.append((r.id,r.name))
65
account_move_reconcile()
66
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: