diff --git a/account_bank_statement_import_paypal/__manifest__.py b/account_bank_statement_import_paypal/__manifest__.py index e4e56a67..7826f603 100644 --- a/account_bank_statement_import_paypal/__manifest__.py +++ b/account_bank_statement_import_paypal/__manifest__.py @@ -6,7 +6,7 @@ { 'name': 'PayPal CSV Format Bank Statements Import', 'summary': 'Import PayPal CSV files as Bank Statements in Odoo', - 'version': '12.0.2.1.0', + 'version': '12.0.2.2.0', 'category': 'Accounting', 'website': 'https://github.com/OCA/bank-statement-import', 'author': diff --git a/account_bank_statement_import_paypal/data/maps.xml b/account_bank_statement_import_paypal/data/maps.xml index 1f727547..d583b9ee 100644 --- a/account_bank_statement_import_paypal/data/maps.xml +++ b/account_bank_statement_import_paypal/data/maps.xml @@ -96,4 +96,49 @@ Nota + + PayPal Statement (DE) + dot + comma + %d.%m.%Y + %H:%M:%S + Datum + Uhrzeit + Zeitzone + Name + Währung + Brutto + Gebühr + Guthaben + Transaktionscode + Beschreibung + Absender E-Mail-Adresse + Rechnungsnummer + Name der Bank + Bankkonto + + + + PayPal Activity (DE) + dot + comma + %d.%m.%Y + %H:%M:%S + Datum + Uhrzeit + Zeitzone + Name + Währung + Brutto + Gebühr + Guthaben + Transaktionscode + Typ + Absender E-Mail-Adresse + Empfänger E-Mail-Adresse + Rechnungsnummer + Betreff + Hinweis + + diff --git a/account_bank_statement_import_paypal/i18n/account_bank_statement_import_paypal.pot b/account_bank_statement_import_paypal/i18n/account_bank_statement_import_paypal.pot index 1c5587d6..bd45f6a6 100644 --- a/account_bank_statement_import_paypal/i18n/account_bank_statement_import_paypal.pot +++ b/account_bank_statement_import_paypal/i18n/account_bank_statement_import_paypal.pot @@ -189,7 +189,7 @@ msgid "Display Name" msgstr "" #. module: account_bank_statement_import_paypal -#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:245 +#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:253 #, python-format msgid "Fee for %s" msgstr "" @@ -233,7 +233,7 @@ msgid "Imported Mapping" msgstr "" #. module: account_bank_statement_import_paypal -#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:215 +#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:219 #, python-format msgid "Invoice %s" msgstr "" @@ -317,7 +317,7 @@ msgid "Time Format" msgstr "" #. module: account_bank_statement_import_paypal -#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:250 +#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:258 #, python-format msgid "Transaction fee for %s" msgstr "" diff --git a/account_bank_statement_import_paypal/i18n/es.po b/account_bank_statement_import_paypal/i18n/es.po index 0baf4747..34548125 100644 --- a/account_bank_statement_import_paypal/i18n/es.po +++ b/account_bank_statement_import_paypal/i18n/es.po @@ -219,7 +219,7 @@ msgid "Display Name" msgstr "Nombre mostrado" #. module: account_bank_statement_import_paypal -#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:245 +#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:253 #, python-format msgid "Fee for %s" msgstr "" @@ -268,7 +268,7 @@ msgid "Imported Mapping" msgstr "Importar las lineas de la plantilla de Paypal" #. module: account_bank_statement_import_paypal -#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:215 +#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:219 #, fuzzy, python-format #| msgid "Invoice ID" msgid "Invoice %s" @@ -366,7 +366,7 @@ msgid "Time Format" msgstr "Formato de fecha" #. module: account_bank_statement_import_paypal -#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:250 +#: code:addons/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py:258 #, fuzzy, python-format #| msgid "Transaction ID" msgid "Transaction fee for %s" diff --git a/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py b/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py index cdc9bcc7..7f9edbff 100644 --- a/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py +++ b/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py @@ -195,6 +195,8 @@ class AccountBankStatementImportPayPalParser(models.TransientModel): 'balance_amount': balance_amount, 'payer_name': name_value, 'payer_email': payer_email, + 'partner_bank_name': bank_name_value, + 'partner_bank_account': bank_account_value, }) return lines @@ -211,6 +213,8 @@ class AccountBankStatementImportPayPalParser(models.TransientModel): fee_amount = line['fee_amount'] payer_name = line['payer_name'] payer_email = line['payer_email'] + partner_bank_account = line['partner_bank_account'] + if invoice: invoice = _('Invoice %s') % invoice note = '%s %s' % ( @@ -238,6 +242,10 @@ class AccountBankStatementImportPayPalParser(models.TransientModel): line.update({ 'partner_name': payer_name, }) + if partner_bank_account: + line.update({ + 'account_number': partner_bank_account, + }) transactions.append(transaction) if fee_amount: diff --git a/account_bank_statement_import_paypal/tests/test_account_bank_statement_import_paypal.py b/account_bank_statement_import_paypal/tests/test_account_bank_statement_import_paypal.py index afb78b9c..983396d9 100644 --- a/account_bank_statement_import_paypal/tests/test_account_bank_statement_import_paypal.py +++ b/account_bank_statement_import_paypal/tests/test_account_bank_statement_import_paypal.py @@ -42,7 +42,7 @@ class TestAccountBankStatementImportPayPal(common.TransactionCase): with open(path.join(path.dirname(__file__), filename)) as file: return b64encode(file.read().encode('utf-8')) - def test_import_statement_en(self): + def test_import_statement_en_usd(self): journal = self.AccountJournal.create({ 'name': 'PayPal', 'type': 'bank', @@ -66,6 +66,30 @@ class TestAccountBankStatementImportPayPal(common.TransactionCase): self.assertEqual(len(statement), 1) self.assertEqual(len(statement.line_ids), 18) + def test_import_statement_en_eur(self): + journal = self.AccountJournal.create({ + 'name': 'PayPal', + 'type': 'bank', + 'code': 'PP', + 'currency_id': self.currency_eur.id, + }) + wizard = self.AccountBankStatementImport.with_context({ + 'journal_id': journal.id, + }).create({ + 'filename': 'fixtures/statement_en.csv', + 'data_file': self._data_file('fixtures/statement_en.csv'), + 'paypal_mapping_id': self.paypal_statement_map_en.id, + }) + wizard.with_context({ + 'journal_id': journal.id, + 'account_bank_statement_import_paypal_test': True, + }).import_file() + statement = self.AccountBankStatement.search([ + ('journal_id', '=', journal.id), + ]) + self.assertEqual(len(statement), 1) + self.assertEqual(len(statement.line_ids), 8) + def test_import_statement_es(self): journal = self.AccountJournal.create({ 'name': 'PayPal',