Browse Source

[IMP] domain widget performance fix

pull/724/head
Joan Sisquella 4 years ago
parent
commit
7706e153c6
  1. 10
      account_financial_report/models/account_move_line.py
  2. 3
      account_financial_report/wizard/general_ledger_wizard_view.xml

10
account_financial_report/models/account_move_line.py

@ -1,6 +1,6 @@
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-
from odoo import models
from odoo import api, models
class AccountMoveLine(models.Model):
@ -30,3 +30,11 @@ class AccountMoveLine(models.Model):
CREATE INDEX account_move_line_account_id_partner_id_index
ON account_move_line (account_id, partner_id)"""
)
@api.model
def search_count(self, args):
# In Big DataBase every time you change the domain widget this method
# takes a lot of time. This improves performance
if self.env.context.get("skip_search_count"):
return 0
return super(AccountMoveLine, self).search_count(args)

3
account_financial_report/wizard/general_ledger_wizard_view.xml

@ -94,10 +94,13 @@
/>
</page>
<page string="Additional Filtering">
<style
>.o_domain_show_selection_button {display: none}</style>
<field
name="domain"
widget="domain"
options="{'model': 'account.move.line', 'in_dialog': True}"
context="{'skip_search_count': 1}"
/>
</page>
</notebook>

Loading…
Cancel
Save