Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3966 Widoki

In ./account_asset/account_asset.py

OdooV7 declares a new one2many field "entry_ids" that is part of the same model where is declared for

the field "entry_ids" in account_move_line that points to one or more other account_move_lines

class account_move_line(osv.osv):       
_inherit = 'account.move.line'
_columns = {
'asset_id': fields.many2one('account.asset.asset', 'Asset', ondelete="restrict"),
'entry_ids': fields.one2many('account.move.line', asset_id', 'Entries',
readonly=True, states={'draft':[('readonly',False)]}),
}

If you now do a copy of this account_move_line or even a read of the field "entry_ids", It wil generate a query that kills your performance.

with following query:


SELECT "account_move_line".id FROM "account_move_line" LEFT JOIN "account_invoice_line" as "account_move_line__invoice_line_id" ON ("account_move_line"."invoice_line_id" = "account_move_line__invoice_line_id"."id") WHERE ("account_move_line"."asset_id" in (2689720)) ORDER BY "account_move_line__invoice_line_id"."id"

FULL TABLE SCAN on the big table account_move_line!

Is this a bug? And is it reported and fixed somewhere??

I simulated it via xml-rpc and this gives the same problem

import oerplib
oerp = oerplib.OERP(server='0.0.0.0', database='natuurpunt', protocol='xmlrpc', port=5000)
user = oerp.login(user='xxx', passwd='xxx')
oerp.execute('account_move_line', 'read', [2689720], ['entry_ids'])
Awatar
Odrzuć
Autor Najlepsza odpowiedź

I see the fields is removed in V8

https://github.com/odoo/odoo/blob/8.0/addons/account_asset/account_asset.py


I guess this can also be removed in V7. But offcourse no offical support anymore. Is there nobody doing backports of fixed issue of V8 to V7?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
gru 23
42076
1
mar 15
6091
1
lip 20
6813
0
lip 25
828
1
lip 25
679