Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4281 Visualizzazioni

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'])
Avatar
Abbandona
Autore Risposta migliore

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?

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
dic 23
42385
1
mar 15
6410
1
lug 20
7043
4
set 25
1250
0
lug 25
1281