콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4086 화면

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'])
아바타
취소
작성자 베스트 답변

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?

아바타
취소
관련 게시물 답글 화면 활동
2
12월 23
42179
1
3월 15
6193
1
7월 20
6888
0
7월 25
988
1
7월 25
822