[FIX] account: Use the correct journal on accounting dashboard

- When selecting "Unpaid invoices" or "Invoices to validate" on the
  accounting dashboard, the list view opened doesn't filter with the
  journal selected.

closes odoo/odoo#31397
This commit is contained in:
Toufik Ben Jaa
2019-02-25 09:46:42 +00:00
parent 74bd66e1b5
commit 397f2e6c50
2 changed files with 3 additions and 3 deletions
@@ -367,12 +367,11 @@ class account_journal(models.Model):
'journal_type': self.type,
'default_journal_id': self.id,
'default_type': invoice_type,
'type': invoice_type
'type': invoice_type,
'search_default_journal_id': self.id,
})
[action] = self.env.ref('account.%s' % action_name).read()
if not self.env.context.get('use_domain'):
ctx['search_default_journal_id'] = self.id
action['context'] = ctx
action['domain'] = self._context.get('use_domain', [])
account_invoice_filter = self.env.ref('account.view_account_invoice_filter', False)
@@ -643,6 +643,7 @@
<search string="Search Invoice">
<field name="number" string="Invoice" filter_domain="['|','|','|', ('number','ilike',self), ('origin','ilike',self), ('reference', 'ilike', self), ('partner_id', 'child_of', self)]"/>
<filter domain="[('user_id','=',uid)]" name="myinvoices" help="My Invoices"/>
<field name="journal_id"/>
<separator/>
<filter name="draft" string="Draft" domain="[('state','=','draft')]"/>
<filter name="unpaid" string="Open" domain="[('state', '=', 'open')]"/>