mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[IMP] account_statement_import: add consistency
If you are importing from a journal, data should be consistent
This commit is contained in:
@@ -230,6 +230,15 @@ class AccountStatementImport(models.TransientModel):
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
journal_id = self.env.context.get("journal_id")
|
||||
if journal_id and journal.id != journal_id:
|
||||
raise UserError(
|
||||
_(
|
||||
"The journal found for the file is not consistent with the "
|
||||
"selected journal. You should use the proper journal or "
|
||||
"use the generic button on the top of the Accounting Dashboard"
|
||||
)
|
||||
)
|
||||
|
||||
if not journal:
|
||||
bank_accounts = self.env["res.partner.bank"].search(
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="account_statement_import_menu" model="ir.ui.menu">
|
||||
<field name="name">Import Statement</field>
|
||||
<field name="parent_id" ref="account.menu_finance_entries_actions" />
|
||||
|
||||
Reference in New Issue
Block a user