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

I need to sum the amount_tax in a report just like it shows in the account_invoice tree view or sales_order view as a total in my invoice report, i don't want lines in my invoice. please help its seriously very urgent!

아바타
취소
작성자

Can we write a function to add amount_total in sale_order report.py? anyone? please guide me in writing simplest way

작성자

Can anyone help !! Damn important.

베스트 답변

[[ reduce(lambda x, obj: x+obj.amount_total , objects , 0 ) ]]

아바타
취소
작성자

Tried this but no result, changed to this too [[ reduce(lambda x, invoice: x+invoice.amount_total , objects , 0 ) ]]

i use it for purchase order it work well

작성자

please try in invioce report for the amount total

more info https://doc.openerp.com/v6.1/developer/05_reports/

베스트 답변

Aeroo has got a funtion called sum_field that sum all the value for a field in yuor class.

This is an example that sum all amount_total in sale order

sum_field(o, 'amount_total')

This is a link to official documentation: http://www.alistek.com/wiki/index.php/Extra_Functions_-_sum

아바타
취소
작성자

But I am using openoffice can it work???

Aeroo is based on OpenOffice!!

작성자

it didn't work with openoffice

what error you get?

작성자

i don't get an error but it doesn't print anything. I want to sum amount total of all the invoices in my report like it does in invoice tree in openerp. Please help

작성자

can you help in writing a function in report.py??

evon_dun: listen to me. The sum_field function work fine in openerp aeroo report. I use it everywhere and i haven't problem. If the function doesn't work you are doing something wrong. Post you code and we can halp you. If you search only help without explain what are you doing is impossible for use help you.

작성자

[[ sum_field(invoice,'amount_total') ]]

But you are using rml not aeroo report!!!

작성자

kindly guide me the complete way to add such a field either through programming or through openoffice. In openoffice either we add field from field builder or we can use rml.

My answer is in relation with aeroo reports. Rml is another report engine. Sorry but my answer is incorrect in your case.

France please show that this solution for Aeroo in the main answer and thx it helped me :)

작성자

No aeroo solution please

베스트 답변

Hi evon,

Above suggested answer is right. It uses report_aeroo functionality if you want to achieve it with base_report_designer using sxw & report.py file then you need to follow below steps.

Define a global variable & do the calculation for sum in it in report.py file. Then at the end of the report in .sxw file call a function and return that global variable. This is how you can have sum amount in your report at the end. For more in detail you can refer Location Content report of Stock.

Here are some examples,

For version 6.0

For version 7.0

Hope this solve your problem.

Thanks.

아바타
취소
작성자

Probably you are right but that example is too complicated, any other example?? However, i have been trying to install aeroo on my system for windows which at last gets stuck on Genshi. I don't understand how to get out of this since i have python 3.2 and it is failed for 3.2 on windows. Any idea!

Oh come on evon! It is very easy,I am sure you can do it. I already gave you simplest example. If you know how to call a method from sxw then it is very simple you don't even need any params while calling the method for total. You just need to write [[ your_method() ]] in rml or sxw at the end.That's it. I prefer you just to try it. If you are stuck in between, we members are here & ready to help :)

작성자

have you checked properly there are more methods related to that report file in stock.py too

I have checked RML file price_total() is called to do total. Same as you need to define method in rml file & in report.py file and return the global variable in which you have done calculation.

베스트 답변

I am using sum_field in aeroo reports but it gives error that  iteration is not allowed on browse_record .

아바타
취소

please clearify your question?

I want to sum up one numeric field from my table for all the employees as a grand total of tabular data . Using aeroo report i am able to fetch the fields from the database but when I use sum_field function to add the elements it gives me error that iteration is not allowed on browse_record . Please help me for how to use extra functions of aeroo reports.

관련 게시물 답글 화면 활동
1
3월 15
7313
1
3월 15
5357
1
3월 15
4640
0
3월 15
3953
2
6월 25
2149