From ded63ab87a17f5de2c098092147345ae80b4b16b Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 18 Oct 2010 13:03:00 +0530 Subject: [PATCH] [IMP]:lunch:improved lunch order bzr revid: apa@tinyerp.com-20101018073300-z9dy97lvf37501jk --- addons/lunch/report/order.py | 7 +++- addons/lunch/report/order.rml | 76 +++++++++++++++++++++-------------- 2 files changed, 52 insertions(+), 31 deletions(-) diff --git a/addons/lunch/report/order.py b/addons/lunch/report/order.py index 29c9d381745..11ca7f79dbc 100644 --- a/addons/lunch/report/order.py +++ b/addons/lunch/report/order.py @@ -41,8 +41,12 @@ class order(report_sxw.rml_parse): total=0.0 for line in lines: total+=line.price + self.net_total+=total return total + def get_nettotal(self): + return self.net_total + def get_users(self, objects): users=[] for obj in objects: @@ -52,12 +56,13 @@ class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(order, self).__init__(cr, uid, name, context) - + self.net_total=0.0 self.localcontext.update({ 'time': time, 'get_lines': self.get_lines, 'get_users': self.get_users, 'get_total': self.get_total, + 'get_nettotal': self.get_nettotal, }) report_sxw.report_sxw('report.lunch.order', 'lunch.order', diff --git a/addons/lunch/report/order.rml b/addons/lunch/report/order.rml index d47816abd9c..ba66dcddb03 100644 --- a/addons/lunch/report/order.rml +++ b/addons/lunch/report/order.rml @@ -14,25 +14,28 @@ - + - - + + + + + + - - + @@ -63,9 +66,14 @@ + + + + + @@ -84,16 +92,10 @@ Lunch Order - -
- [[repeatIn(get_users(objects),'o')]] - + - Name - - - Date + Name/Date Order @@ -107,28 +109,43 @@
- [[ repeatIn(get_lines(o,objects),'lines') ]] - + [[repeatIn(get_users(objects),'o')]] + - [[ (lines.user_id and lines.user_id.name) or '']] + [[ o.name ]] - [[ formatLang(lines.date,date='True') ]] + + + - [[ (lines.product and lines.product.name) or '' ]] - - - [[ lines.descript]] - - - [[ lines.price ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + [[ formatLang(get_total(o,objects)) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] +
+ [[ repeatIn(get_lines(o,objects),'lines') ]] + + + + [[ formatLang(lines.date,date='True') ]] + + + [[ (lines.product and lines.product.name) or '' ]] + + + [[ lines.descript]] + + + [[ lines.price ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + + + +
- + @@ -136,16 +153,15 @@ - Total: + Total : - [[ formatLang(get_total(o,objects)) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] + [[ formatLang(get_nettotal()) ]] [[ (o.company_id and o.company_id.currency_id and o.company_id.currency_id.symbol) or '' ]] - + -
- + \ No newline at end of file