From 62fb8d8a343f63cb9d863fb6864bf3e392a38f41 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Fri, 4 Mar 2016 17:01:31 +0100 Subject: [PATCH] [IMP] accout_bank_statement_import: add a feature to build the full name of the bank statements by just giving the number --- .../account_bank_statement_import.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/account_bank_statement_import/account_bank_statement_import.py b/addons/account_bank_statement_import/account_bank_statement_import.py index 38d05f478e9..31b23fd35b3 100644 --- a/addons/account_bank_statement_import/account_bank_statement_import.py +++ b/addons/account_bank_statement_import/account_bank_statement_import.py @@ -167,6 +167,10 @@ class AccountBankStatementImport(models.TransientModel): st_vals['journal_id'] = journal.id if not st_vals.get('reference'): st_vals['reference'] = self.filename + if st_vals.get('number'): + #build the full name like BNK/2016/00135 by just giving the number '135' + st_vals['name'] = journal.sequence_id.with_context(ir_sequence_date=st_vals.get('date')).get_next_char(st_vals['number']) + del(st_vals['number']) for line_vals in st_vals['transactions']: unique_import_id = line_vals.get('unique_import_id') if unique_import_id: