Merge lp:~camptocamp/sale-reports/7.0-fix-1188177 into lp:~sale-core-editors/sale-reports/7.0

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Merged at revision: 20
Proposed branch: lp:~camptocamp/sale-reports/7.0-fix-1188177
Merge into: lp:~sale-core-editors/sale-reports/7.0
Diff against target: 49 lines (+10/-4)
1 file modified
sale_order_webkit/report/sale_order.mako (+10/-4)
To merge this branch: bzr merge lp:~camptocamp/sale-reports/7.0-fix-1188177
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp code review, test Approve
Guewen Baconnier @ Camptocamp Approve
Review via email: mp+167777@code.launchpad.net

Description of the change

Ensure we remove only the name and not the street from the formatted address.

To post a comment you must log in.
20. By Yannick Vaucher @ Camptocamp

[FIX] sale_order_webkit - missing street in address

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

Works fine

review: Approve (code review, test)
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

Just to have as record, why you are removing the name?

Regards.!

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Name is removed to be able to set a different font style on it.

Plus, it permits to have reorder company name and contact name.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale_order_webkit/report/sale_order.mako'
2--- sale_order_webkit/report/sale_order.mako 2013-05-22 14:26:07 +0000
3+++ sale_order_webkit/report/sale_order.mako 2013-06-06 15:18:25 +0000
4@@ -130,10 +130,12 @@
5 %if order.partner_id.parent_id:
6 <tr><td class="name">${order.partner_id.parent_id.name or ''}</td></tr>
7 <tr><td>${order.partner_id.title and order.partner_id.title.name or ''} ${order.partner_id.name }</td></tr>
8+ <% address_lines = order.partner_id.contact_address.split("\n")[1:] %>
9 %else:
10 <tr><td class="name">${order.partner_id.title and order.partner_id.title.name or ''} ${order.partner_id.name }</td></tr>
11+ <% address_lines = order.partner_id.contact_address.split("\n") %>
12 %endif
13- %for part in order.partner_id.contact_address.split("\n")[1:]:
14+ %for part in address_lines:
15 %if part:
16 <tr><td>${part}</td></tr>
17 %endif
18@@ -142,13 +144,15 @@
19
20 <table class="shipping">
21 <tr><td class="address_title">${_("Shipping address:")}</td></tr>
22- %if order.partner_id.parent_id:
23+ %if order.partner_shipping_id.parent_id:
24 <tr><td>${order.partner_shipping_id.parent_id.name or ''}</td></tr>
25 <tr><td>${order.partner_shipping_id.title and order.partner_shipping_id.title.name or ''} ${order.partner_shipping_id.name }</td></tr>
26+ <% address_lines = order.partner_shipping_id.contact_address.split("\n")[1:] %>
27 %else:
28 <tr><td>${order.partner_shipping_id.title and order.partner_shipping_id.title.name or ''} ${order.partner_shipping_id.name }</td></tr>
29+ <% address_lines = order.partner_shipping_id.contact_address.split("\n") %>
30 %endif
31- %for part in order.partner_shipping_id.contact_address.split("\n")[1:]:
32+ %for part in address_lines:
33 %if part:
34 <tr><td>${part}</td></tr>
35 %endif
36@@ -160,10 +164,12 @@
37 %if order.partner_invoice_id.parent_id:
38 <tr><td>${order.partner_invoice_id.parent_id.name or ''}</td></tr>
39 <tr><td>${order.partner_invoice_id.title and order.partner_invoice_id.title.name or ''} ${order.partner_invoice_id.name }</td></tr>
40+ <% address_lines = order.partner_invoice_id.contact_address.split("\n")[1:] %>
41 %else:
42 <tr><td>${order.partner_invoice_id.title and order.partner_invoice_id.title.name or ''} ${order.partner_invoice_id.name }</td></tr>
43+ <% address_lines = order.partner_invoice_id.contact_address.split("\n") %>
44 %endif
45- %for part in order.partner_invoice_id.contact_address.split("\n")[1:]:
46+ %for part in address_lines:
47 %if part:
48 <tr><td>${part}</td></tr>
49 %endif

Subscribers

People subscribed via source and target branches