|
@ -1,28 +1,6 @@ |
|
|
# -*- coding: utf-8 -*- |
|
|
# -*- coding: utf-8 -*- |
|
|
############################################################################## |
|
|
|
|
|
# |
|
|
|
|
|
# This file is part of account_bank_statement_import, |
|
|
|
|
|
# an Odoo module. |
|
|
|
|
|
# |
|
|
|
|
|
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) |
|
|
|
|
|
# |
|
|
|
|
|
# account_bank_statement_importis 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. |
|
|
|
|
|
# |
|
|
|
|
|
# account_bank_statement_import 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 account_bank_statement_import_coda. |
|
|
|
|
|
# If not, see <http://www.gnu.org/licenses/>. |
|
|
|
|
|
# |
|
|
|
|
|
############################################################################## |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Copyright 2015 ACSONE SA/NV <http://acsone.eu> |
|
|
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
|
import re |
|
|
import re |
|
|
from openerp import api, models, fields |
|
|
from openerp import api, models, fields |
|
|
|
|
|
|
|
@ -32,7 +10,7 @@ class ResPartnerBank(models.Model): |
|
|
|
|
|
|
|
|
sanitized_acc_number = fields.Char( |
|
|
sanitized_acc_number = fields.Char( |
|
|
'Sanitized Account Number', size=64, readonly=True, |
|
|
'Sanitized Account Number', size=64, readonly=True, |
|
|
compute='_get_sanitized_account_number', store=True, index=True) |
|
|
|
|
|
|
|
|
compute='_compute_sanitized_acc_number', store=True, index=True) |
|
|
enforce_unique_import_lines = fields.Boolean( |
|
|
enforce_unique_import_lines = fields.Boolean( |
|
|
string='Force unique lines on import', |
|
|
string='Force unique lines on import', |
|
|
help="Some banks do not provide an unique id for transactions in" |
|
|
help="Some banks do not provide an unique id for transactions in" |
|
@ -51,11 +29,12 @@ class ResPartnerBank(models.Model): |
|
|
return re.sub(r'\W+', '', acc_number).upper() |
|
|
return re.sub(r'\W+', '', acc_number).upper() |
|
|
return False |
|
|
return False |
|
|
|
|
|
|
|
|
@api.one |
|
|
|
|
|
|
|
|
@api.multi |
|
|
@api.depends('acc_number') |
|
|
@api.depends('acc_number') |
|
|
def _get_sanitized_account_number(self): |
|
|
|
|
|
self.sanitized_acc_number = self._sanitize_account_number( |
|
|
|
|
|
self.acc_number) |
|
|
|
|
|
|
|
|
def _compute_sanitized_acc_number(self): |
|
|
|
|
|
for this in self: |
|
|
|
|
|
this.sanitized_acc_number = this._sanitize_account_number( |
|
|
|
|
|
this.acc_number) |
|
|
|
|
|
|
|
|
@api.model |
|
|
@api.model |
|
|
def search(self, args, offset=0, limit=None, order=None, count=False): |
|
|
def search(self, args, offset=0, limit=None, order=None, count=False): |
|
|