Browse Source

Merge pull request #343 from acsone/10.0-account_tax_balance-index-sbi

[IMP] account_tax_balance: add index
pull/324/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
31400b9d61
  1. 2
      account_tax_balance/__manifest__.py
  2. 1
      account_tax_balance/models/__init__.py
  3. 24
      account_tax_balance/models/account_move_line.py

2
account_tax_balance/__manifest__.py

@ -5,7 +5,7 @@
{
"name": "Tax Balance",
"summary": "Compute tax balances based on date range",
"version": "10.0.1.1.0",
"version": "10.0.1.1.1",
"category": "Accounting & Finance",
"website": "https://www.agilebg.com/",
"author": "Agile Business Group, Therp BV, Tecnativa, ACSONE SA/NV, "

1
account_tax_balance/models/__init__.py

@ -4,3 +4,4 @@
from . import account_move
from . import account_tax
from . import account_move_line

24
account_tax_balance/models/account_move_line.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
@api.model_cr
def init(self):
res = super(AccountMoveLine, self).init()
self._cr.execute("""
SELECT indexname FROM pg_indexes
WHERE indexname = 'account_move_line_date_tax_line_id_idx'
""")
if not self._cr.fetchone():
self._cr.execute("""
CREATE INDEX account_move_line_date_tax_line_id_idx
ON account_move_line (date, tax_line_id)
""")
return res
Loading…
Cancel
Save