mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
add account number and bank bic to statement line
Be carefull, values returned by the parser are now formatted to work arround a bug in the bulk insert... see comment in the coda_file_parser.py
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Joel Grand-Guillaume
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
# Authors: Laurent Mignon
|
||||
# Copyright (c) 2013 Acsone SA/NV (http://www.acsone.eu)
|
||||
# All Rights Reserved
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import parser
|
||||
import statement
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
'complexity': 'normal',
|
||||
'depends': [
|
||||
'account_statement_base_import',
|
||||
'account_statement_transactionid_completion'
|
||||
'account_statement_bankaccount_completion'
|
||||
],
|
||||
'description': """
|
||||
This module brings generic methods and fields on bank statement to deal with
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Nicolas Bessi
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
# Authors: Laurent Mignon
|
||||
# Copyright (c) 2013 Acsone SA/NV (http://www.acsone.eu)
|
||||
# All Rights Reserved
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import coda_file_parser
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#
|
||||
|
||||
import datetime
|
||||
|
||||
import simplejson
|
||||
from coda.parser import Parser
|
||||
from coda.statement import AmountSign, MovementRecordType
|
||||
|
||||
@@ -103,4 +103,10 @@ class CodaFileParser(BankStatementImportParser):
|
||||
return {'name': "\n".join(filter(None, [line.counterparty_name, line.communication])),
|
||||
'date': line.entry_date or datetime.datetime.now().date(),
|
||||
'amount': amount,
|
||||
'ref': line.ref}
|
||||
'ref': line.ref,
|
||||
# TODO, since dictionary is directly used by the AccountStatementLine in a bulk insert
|
||||
# method that bypass the ORM, we need to write by hand, the logic behind field.sparse
|
||||
# to properly serialize our additional fields ('parner_acc_number', ....) in the right
|
||||
# container field (additionnal_bank_fields)
|
||||
'additionnal_bank_fields': simplejson.dumps({'partner_acc_number': line.counterparty_number or None,
|
||||
'partner_bank_bic': line.counterparty_bic or None})}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# Authors: Laurent Mignon
|
||||
# Copyright (c) 2013 Acsone SA/NV (http://www.acsone.eu)
|
||||
@@ -18,7 +18,7 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
#
|
||||
|
||||
from openerp.osv.orm import Model
|
||||
from openerp.osv import fields
|
||||
@@ -32,7 +32,7 @@ class AccountStatementProfil(Model):
|
||||
Has to be inherited to add parser
|
||||
"""
|
||||
res = super(AccountStatementProfil, self).get_import_type_selection(
|
||||
cr, uid, context=context)
|
||||
cr, uid, context=context)
|
||||
res.append(('coda_transaction',
|
||||
'CODA based transaction'))
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user