Merge lp:~account-core-editors/account-invoice-report/7.0-add-html-note into lp:~account-core-editors/account-invoice-report/7.0

Proposed by Nicolas Bessi - Camptocamp
Status: Superseded
Proposed branch: lp:~account-core-editors/account-invoice-report/7.0-add-html-note
Merge into: lp:~account-core-editors/account-invoice-report/7.0
Diff against target: 148 lines (+55/-16)
3 files modified
invoice_webkit/invoice.py (+14/-6)
invoice_webkit/report/account_invoice.mako (+17/-10)
invoice_webkit/view/invoice_view.xml (+24/-0)
To merge this branch: bzr merge lp:~account-core-editors/account-invoice-report/7.0-add-html-note
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Needs Fixing
Review via email: mp+143108@code.launchpad.net

This proposal has been superseded by a proposal from 2013-01-15.

Description of the change

Add HTML note in invoice line + support of fromatted not in mako. Fixes some bank formatting in mako

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

Should be in english:
47 + _columns = {'formatted_note': fields.html('Note formatée')}

Dubious CSS:
59 + font-size:smaller:border

Typo in the class name:
75 + <td class="formated_note">
s/formated/formatted/

review: Needs Fixing
8. By Nicolas Bessi - Camptocamp

[FIX] typo, css + merge trouble

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'invoice_webkit/invoice.py'
2--- invoice_webkit/invoice.py 2012-12-18 16:24:39 +0000
3+++ invoice_webkit/invoice.py 2013-01-15 08:19:22 +0000
4@@ -28,15 +28,16 @@
5 ##############################################################################
6 from openerp.osv.orm import Model, fields
7
8+
9 class InvoiceConditionText(Model):
10 """add info condition in the invoice"""
11 _name = "account.condition_text"
12 _description = "Invoices conditions"
13
14 _columns = {
15- 'name' : fields.char('Condition summary', required=True, size=128),
16- 'type' : fields.selection([('header','Top condition'),
17- ('footer','Bottom condition')],
18+ 'name': fields.char('Condition summary', required=True, size=128),
19+ 'type': fields.selection([('header','Top condition'),
20+ ('footer', 'Bottom condition')],
21 'type', required=True),
22
23 'text': fields.text('Condition', translate=True, required=True)}
24@@ -48,7 +49,7 @@
25
26 def _set_condition(self, cr, uid, inv_id, commentid, key):
27 """Set the text of the notes in invoices"""
28- if not commentid :
29+ if not commentid:
30 return {}
31 try :
32 lang = self.browse(cr, uid, inv_id)[0].partner_id.lang
33@@ -65,5 +66,12 @@
34
35 _columns = {'text_condition1': fields.many2one('account.condition_text', 'Header condition'),
36 'text_condition2': fields.many2one('account.condition_text', 'Footer condition'),
37- 'note1' : fields.text('Header'),
38- 'note2' : fields.text('Footer'),}
39+ 'note1': fields.text('Header'),
40+ 'note2': fields.text('Footer'),}
41+
42+
43+class AccountInvoiceLine(Model):
44+
45+ _inherit = 'account.invoice.line'
46+
47+ _columns = {'formatted_note': fields.html('Formatted Note')}
48
49=== modified file 'invoice_webkit/report/account_invoice.mako'
50--- invoice_webkit/report/account_invoice.mako 2012-12-18 16:24:39 +0000
51+++ invoice_webkit/report/account_invoice.mako 2013-01-15 08:19:22 +0000
52@@ -30,6 +30,12 @@
53 display:table-header-group;
54 }
55
56+.formatted_note {
57+ border-right:thin solid #EEEEEE;
58+ left:10px;
59+ font-size:smaller;
60+}
61+
62
63 .list_bank_table {
64 text-align:center;
65@@ -232,10 +238,12 @@
66 <td class="amount" width="10%">${line.discount and formatLang(line.discount, digits=get_digits(dp='Account')) or ''} ${line.discount and '%' or ''}</td>
67 <td class="amount" width="13%">${formatLang(line.price_subtotal, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</td>
68 </tr>
69- %if line.name :
70- <tr>
71- <td colspan="7" class="note" style="font-style:italic; font-size: 10; border-top: thin solid #ffffff ; border-right: thin solid #E3E4EA; padding:20;">${line.name | carriage_returns}</td>
72- </tr>
73+ %if line.formatted_note:
74+ <tr>
75+ <td class="formatted_note">
76+ ${line.formatted_note| n}
77+ </td>
78+ <tr>
79 %endif
80 %endfor
81 </tbody>
82@@ -291,12 +299,11 @@
83 <br/>
84 <%
85 inv_bank = inv.partner_bank_id
86- bank_institution = inv_bank and inv_bank.bank
87 %>
88 <table class="list_bank_table" width="100%" >
89 <tr>
90 <th style="width:20%;">${_("Bank")}</th>
91- <td style="width:30%;text-align:left;">${ bank_institution and bank_institution.name or '-' } </td>
92+ <td style="width:30%;text-align:left;">${inv_bank and inv_bank.bank_name or '-' } </td>
93 %if inv.partner_id and inv.partner_id.vat :
94 <th style="width:20%;">${_("Customer VAT No")}</th>
95 <td style="width:30%;">${inv.partner_id.vat or '-'}</td>
96@@ -307,14 +314,14 @@
97 %endif
98 </tr>
99 <tr>
100- <th style="width:20%;">${_("IBAN")}</th>
101- <td style="width:30%;text-align:left;">${ inv_bank and inv_bank.iban or '-' }</td>
102+ <th style="width:20%;">${_("Bank account")}</th>
103+ <td style="width:30%;text-align:left;">${ inv_bank and inv_bank.acc_number or '-' }</td>
104 <th style="width:20%;">${_("Our VAT No")}</th>
105- <td style="width:30%;" class="vat">''</td>
106+ <td style="width:30%;" class="vat">${inv.company_id.partner_id.vat or '-'}</td>
107 </tr>
108 <tr>
109 <th width="20%">${_("BIC")}</th>
110- <td style="width:30%;">${ inv.partner_bank_id and inv.partner_bank_id.bank and inv.partner_bank_id.bank.bic or '-' }</td>
111+ <td style="width:30%;">${inv_bank and inv_bank.bank_bic or '-' }</td>
112 </tr>
113 </table>
114 <br/>
115
116=== modified file 'invoice_webkit/view/invoice_view.xml'
117--- invoice_webkit/view/invoice_view.xml 2012-12-18 16:24:39 +0000
118+++ invoice_webkit/view/invoice_view.xml 2013-01-15 08:19:22 +0000
119@@ -64,5 +64,29 @@
120 </field>
121 </record>
122
123+ <record model="ir.ui.view" id="invoice_form_add_notes_in_invoice_line_1">
124+ <field name="name">account.invoice.form.add.notes</field>
125+ <field name="model">account.invoice</field>
126+ <field name="inherit_id" ref="account.invoice_form"/>
127+ <field name="arch" type="xml">
128+ <xpath expr="//tree[@string='Invoice Lines']" position="attributes" >
129+ <attribute name="editable" eval="False"/>
130+ </xpath>
131+ </field>
132+ </record>
133+
134+ <record model="ir.ui.view" id="invoice_form_add_notes_in_invoice_line_2">
135+ <field name="name">account.invoice.form.add.notes</field>
136+ <field name="model">account.invoice.line</field>
137+ <field name="inherit_id" ref="account.view_invoice_line_form"/>
138+ <field name="arch" type="xml">
139+ <field name="name" position="after">
140+ <group>
141+ <field name="formatted_note" colspan="4"/>
142+ </group>
143+ </field>
144+ </field>
145+ </record>
146+
147 </data>
148 </openerp>

Subscribers

People subscribed via source and target branches