Skip to content
Extraits de code Groupes Projets
Valider ba1caa91 rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

Support for IBAN

parent d78c04fa
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -19,21 +19,12 @@ class AccountBankStatementImport(models.TransientModel): ...@@ -19,21 +19,12 @@ class AccountBankStatementImport(models.TransientModel):
open(file_to_import, 'r').read()) open(file_to_import, 'r').read())
# Check raw data # Check raw data
super(AccountBankStatementImport, self)._check_parsed_data(stmts_vals) super(AccountBankStatementImport, self)._check_parsed_data(stmts_vals)
# Try to find the currency and journal in odoo # Try to find the journal in odoo based on account number
currency, journal = super( journal = self.env['account.journal'].search(
AccountBankStatementImport, [('bank_acc_number', '=like', account_number)], limit=1)
self)._find_additional_data(currency_code, account_number)
# If no journal found, ask the user about creating one
if not journal: if not journal:
# The active_id is passed in context so the wizard can call raise UserError(
# import_file again once the journal is created _("No journal found matching '%s'.") % account_number)
return super(
AccountBankStatementImport,
self)._journal_creation_wizard(currency, account_number)
if (not journal.default_debit_account_id
or not journal.default_credit_account_id):
raise UserError(_('You have to set a Default Debit Account and a \
Default Credit Account for the journal: %s') % (journal.name,))
# Prepare statement data to be used for bank statements creation # Prepare statement data to be used for bank statements creation
stmts_vals = super( stmts_vals = super(
AccountBankStatementImport, AccountBankStatementImport,
...@@ -48,7 +39,8 @@ class AccountBankStatementImport(models.TransientModel): ...@@ -48,7 +39,8 @@ class AccountBankStatementImport(models.TransientModel):
def _parse_file(self, data_file): def _parse_file(self, data_file):
ofx = super(AccountBankStatementImport, self)._check_ofx(data_file) ofx = super(AccountBankStatementImport, self)._check_ofx(data_file)
if not ofx: if not ofx:
return super(AccountBankStatementImport, self)._parse_file(data_file) return super(AccountBankStatementImport, self)._parse_file(
data_file)
currency_code, account_number, stmts_vals = super( currency_code, account_number, stmts_vals = super(
AccountBankStatementImport, self)._parse_file(data_file) AccountBankStatementImport, self)._parse_file(data_file)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter