1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
24
from osv import fields
26
class account_invoice(osv.osv):
30
_inherit = 'account.invoice'
32
'bank_statement_line_ids':fields.many2many('bank.statement.imported.lines','bs_invoice_rel','invoice_id','st_id_id','Invoices',
33
help="Invoices to be reconciled with this line",
34
),#TODO: Resolve: We should use date as filter, is a question of POV
37
def button_reconcile_bsl(self, cr, uid, ids, context=None):
41
bsl_obj = self.pool.get('bank.statement.imported.lines')
42
bsl_ids = self.browse(cr,uid,ids,context=context)[0].bank_statement_line_ids
44
res = [bsl_id.id for bsl_id in bsl_ids]
45
bsl_obj.button_setinvoice(cr, uid, res, context=context)
48
def button_unreconcile_bsl(self, cr, uid, ids, context=None):
52
bsl_obj = self.pool.get('bank.statement.imported.lines')
53
bsl_ids = self.browse(cr,uid,ids,context=context)[0].bank_statement_line_ids
55
res = [bsl_id.id for bsl_id in bsl_ids]
56
bsl_obj.button_cancel(cr, uid, res, context=context)