Merge lp:~camptocamp/account-invoice-report/semantic-fix into lp:~account-core-editors/account-invoice-report/7.0

Proposed by Nicolas Bessi - Camptocamp
Status: Merged
Merged at revision: 31
Proposed branch: lp:~camptocamp/account-invoice-report/semantic-fix
Merge into: lp:~account-core-editors/account-invoice-report/7.0
Diff against target: 41 lines (+17/-0)
1 file modified
invoice_webkit/report/account_invoice.mako (+17/-0)
To merge this branch: bzr merge lp:~camptocamp/account-invoice-report/semantic-fix
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp code review, no test Approve
Guewen Baconnier @ Camptocamp Needs Information
Review via email: mp+160679@code.launchpad.net

Description of the change

Add new partner semantic support

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Why do you need to display the commercial_partner_id?

I thought that the normal behavior was to display the contact, which should have the correct name and address related to its company.

In the normal report of the 'account' module, the displayed address is only:

          <para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
          <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>

So what is the rationale for this?

Thanks

review: Needs Information
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Hello,

After a discussion with Frederic we agreed on the fact that if it's a contact of a company we want to have the name of the company above the address in bold. This is done in order to keep coherence of display with the previous block which does exactly the same thing but using parent_id relation field instead of using commercial_partner_id.

Regards

Nicolas

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

LGTM

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'invoice_webkit/report/account_invoice.mako'
2--- invoice_webkit/report/account_invoice.mako 2013-04-15 14:28:40 +0000
3+++ invoice_webkit/report/account_invoice.mako 2013-04-24 15:22:43 +0000
4@@ -170,6 +170,21 @@
5 %for inv in objects:
6 <% setLang(inv.partner_id.lang) %>
7 <div class="address">
8+ %if hasattr(inv, 'commercial_partner_id'):
9+ <table class="recipient">
10+ %if inv.partner_id.id != inv.commercial_partner_id.id:
11+ <tr><td class="name">${inv.commercial_partner_id.name or ''}</td></tr>
12+ <tr><td>${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr>
13+ %else:
14+ <tr><td class="name">${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr>
15+ %endif
16+ %for part in inv.partner_id.contact_address.split("\n")[1:]:
17+ %if part:
18+ <tr><td>${part}</td></tr>
19+ %endif
20+ %endfor
21+ </table>
22+ %else:
23 <table class="recipient">
24 %if inv.partner_id.parent_id:
25 <tr><td class="name">${inv.partner_id.parent_id.name or ''}</td></tr>
26@@ -183,6 +198,7 @@
27 %endif
28 %endfor
29 </table>
30+ %endif
31 </div>
32 <div>
33
34@@ -314,6 +330,7 @@
35 inv_bank = inv.partner_bank_id
36 %>
37 <table class="list_bank_table" width="100%" >
38+ <!-- vat value are taken back from commercial id -->
39 <tr>
40 <th style="width:20%;">${_("Bank")}</th>
41 <td style="width:30%;text-align:left;">${inv_bank and inv_bank.bank_name or '-' } </td>

Subscribers

People subscribed via source and target branches