From e89137252be783f799895aceb8dd7ca761e2c2ba Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 14 Jul 2010 12:29:21 +0530 Subject: [PATCH] [ADD] sale_layout: Fix the rml if no note then remove the node and correct the subtotal bzr revid: sbh@tinyerp.com-20100714065921-zq6yh2uonhlfcsz6 --- addons/sale_layout/report/report_sale_layout.py | 6 +++--- addons/sale_layout/report/report_sale_layout.rml | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/sale_layout/report/report_sale_layout.py b/addons/sale_layout/report/report_sale_layout.py index 1715994a7cd..20ad66313a2 100755 --- a/addons/sale_layout/report/report_sale_layout.py +++ b/addons/sale_layout/report/report_sale_layout.py @@ -68,9 +68,9 @@ class sale_order_1(report_sxw.rml_parse): res['price_unit']="%.2f"%(entry.price_unit or 0.00) res['discount']="%.2f"%(entry.discount and entry.discount or 0.00) res['price_subtotal']="%.2f"%(entry.price_subtotal and entry.price_subtotal or 0.00) - sub_total[i]= entry.price_subtotal and entry.price_subtotal or 0.00 + sub_total[i]= entry.price_subtotal and entry.price_subtotal i=i+1 - res['note']=entry.notes + res['note']=entry.notes or '' res['currency']=sale_order.pricelist_id.currency_id.name res['layout_type']=entry.layout_type @@ -81,7 +81,7 @@ class sale_order_1(report_sxw.rml_parse): res['discount']='' res['tax_id']='' res['layout_type']=entry.layout_type - res['note']=entry.notes + res['note']=entry.notes or '' res['product_uom']='' if entry.layout_type=='subtotal': diff --git a/addons/sale_layout/report/report_sale_layout.rml b/addons/sale_layout/report/report_sale_layout.rml index dd119be930c..28e007ecfdc 100755 --- a/addons/sale_layout/report/report_sale_layout.rml +++ b/addons/sale_layout/report/report_sale_layout.rml @@ -315,10 +315,11 @@ - [[ a['note'] and a['note']=='' and removeParentNode('blockTable') ]][[ repeatIn(( a['note'] and a['note'].splitlines()) or [], 'note') ]] + + [[ a['note']=='' and removeParentNode('blockTable') ]][[ repeatIn(( a['note'] and a['note'].splitlines()) or [], 'note') ]] - [[ note or removeParentNode('blockTable') ]] + [[ a['note'] and note or removeParentNode('blockTable') ]]