diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 1f966c2df75..f957c058673 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -37,7 +37,7 @@ class AccountJournal(models.Model): _name = "account.journal" _description = "Journal" _order = 'sequence, type, code' - _inherit = ['mail.thread', 'mail.activity.mixin'] + _inherit = ['mail.thread', 'mail.activity.mixin', 'portal.mixin'] _check_company_auto = True _rec_names_search = ['name', 'code'] @@ -709,6 +709,11 @@ class AccountJournal(models.Model): # We simply call the setup bar function. return self.env['res.company'].setting_init_bank_account_action() + def action_new_transaction(self): + action = self.env['ir.actions.act_window']._for_xml_id('account.action_bank_statement_tree') + action['context'] = {'default_journal_id': self.id} + return action + def _create_document_from_attachment(self, attachment_ids): """ Create the invoices from files.""" move_type = self._context.get("default_move_type", "entry") diff --git a/addons/account/views/account_journal_dashboard_view.xml b/addons/account/views/account_journal_dashboard_view.xml index b7469550a98..c6014deea8a 100644 --- a/addons/account/views/account_journal_dashboard_view.xml +++ b/addons/account/views/account_journal_dashboard_view.xml @@ -242,13 +242,18 @@ -
+
- Connect - + -
+
+
+
+ Create +
+
+
New Transaction @@ -256,7 +261,7 @@
-
+
Balance in GL diff --git a/addons/account/wizard/setup_wizards.py b/addons/account/wizard/setup_wizards.py index 90c870782ca..6278203b35a 100644 --- a/addons/account/wizard/setup_wizards.py +++ b/addons/account/wizard/setup_wizards.py @@ -133,12 +133,13 @@ class SetupBarBankConfigWizard(models.TransientModel): if not selected_journal: new_journal_code = self.env['account.journal'].get_next_bank_cash_default_code('bank', self.env.company) company = self.env.company - selected_journal = self.env['account.journal'].create({ + record.linked_journal_id = self.env['account.journal'].create({ 'name': record.new_journal_name, 'code': new_journal_code, 'type': 'bank', 'company_id': company.id, 'bank_account_id': record.res_partner_bank_id.id, + 'bank_statements_source': 'file_import', }) else: selected_journal.bank_account_id = record.res_partner_bank_id.id