1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# Author: Romain Deheele
5
# Copyright 2013 Camptocamp SA
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU Affero General Public License as
9
# published by the Free Software Foundation, either version 3 of the
10
# License, or (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU Affero General Public License for more details.
17
# You should have received a copy of the GNU Affero General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
##############################################################################
22
from openerp.osv.orm import Model, fields
24
class AccountMoveLine(Model):
26
Inherit account.move.line class in order to add transaction_ref field
28
_inherit = "account.move.line"
30
'transaction_ref': fields.char('Transaction Ref.', size=128),
33
class AccountBankStatement(Model):
35
Inherit account.bank.statement class in order to set transaction_ref info on account.move.line
37
_inherit = "account.bank.statement"
39
def _prepare_move_line_vals(
40
self, cr, uid, st_line, move_id, debit, credit, currency_id=False,
41
amount_currency=False, account_id=False, analytic_id=False,
42
partner_id=False, context=None):
46
res = super(AccountBankStatement, self)._prepare_move_line_vals(
47
cr, uid, st_line, move_id, debit, credit,
48
currency_id=currency_id,
49
amount_currency=amount_currency,
50
account_id=account_id,
51
analytic_id=analytic_id,
52
partner_id=partner_id, context=context)
53
res.update({'transaction_ref': st_line.ref})