Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5260 Lượt xem

Hello. I want to modify existing rml template from addons/hr_timesheet_invoice/report/account_analytic_profit.rml

But I have some troubles with following piece of code

[[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]]

I can't understand what line function do. Can someone explain it to me?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

To find every function that you see in an RML report file you need to seek to the correspondig RML Parser .py. In this case there is at:

addons/hr_timesheet_invoice/report/account_analytic_profit.py

This parser have the function _line made it usable by the RML engine because it's in the report localcontext as 'line'. Just open the source code of this file and read what that function do

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Andrew,

are you using Odoo V8? If the answer is yes then you are out of luck, because RML reports are deprecated and on the latest updates of Odoo V8 were not suported anymore. This means RML could suffer from various errors, even if the architecture of your code is right. Better bet on Qweb report for now on. 

(the -1 was not mine :P)

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 12 23
11835
1
thg 3 18
4510
0
thg 10 16
3483
4
thg 10 15
3838
0
thg 9 15
4520