[IMP] account: add index used to open the dashboard

closes odoo/odoo#82807

X-original-commit: 18f03ef60153f593346738cfc09aaf755ba8d761
Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
wan
2022-01-17 09:31:52 +00:00
committed by Aurélien (avd)
parent 172269ee75
commit 4f3f28ada3
+8
View File
@@ -49,6 +49,14 @@ class AccountMove(models.Model):
_check_company_auto = True
_sequence_index = "journal_id"
def init(self):
self.env.cr.execute("""
CREATE INDEX IF NOT EXISTS account_move_to_check_idx
ON account_move(journal_id) WHERE to_check = true;
CREATE INDEX IF NOT EXISTS account_move_payment_idx
ON account_move(journal_id, state, payment_state, move_type, date);
""")
@property
def _sequence_monthly_regex(self):
return self.journal_id.sequence_override_regex or super()._sequence_monthly_regex