Merge lp:~camptocamp/purchase-report/purchase_print_button into lp:~purchase-core-editors/purchase-report/7.0

Proposed by Vincent Renaville@camptocamp
Status: Merged
Merged at revision: 19
Proposed branch: lp:~camptocamp/purchase-report/purchase_print_button
Merge into: lp:~purchase-core-editors/purchase-report/7.0
Diff against target: 370 lines (+183/-16)
14 files modified
purchase_order_webkit/__init__.py (+2/-1)
purchase_order_webkit/__openerp__.py (+2/-1)
purchase_order_webkit/i18n/de.po (+22/-0)
purchase_order_webkit/i18n/fr.po (+21/-0)
purchase_order_webkit/i18n/purchase_order_webkit.pot (+20/-0)
purchase_order_webkit/report/purchase_order.mako (+9/-2)
purchase_order_webkit/report/request_quotation.mako (+13/-6)
purchase_order_webkit/view/purchase_view.xml (+17/-0)
purchase_order_webkit_with_notes/i18n/fr.po (+20/-0)
purchase_order_webkit_with_notes/i18n/purchase_order_webkit.pot (+19/-0)
purchase_order_webkit_with_notes/purchase_order.py (+14/-0)
purchase_order_webkit_with_notes/report/purchase_order.mako (+10/-3)
purchase_order_webkit_with_notes/report/request_quotation.mako (+11/-3)
purchase_order_webkit_with_notes/view/purchase_view.xml (+3/-0)
To merge this branch: bzr merge lp:~camptocamp/purchase-report/purchase_print_button
Reviewer Review Type Date Requested Status
Romain Deheele - Camptocamp (community) code review Approve
Alexandre Fayolle - camptocamp code review, test Approve
Review via email: mp+216024@code.launchpad.net

Description of the change

This branches add the following fixes:
- remove unused <tr> in repport
- fix button to print quotation to print the correct webkit report
And add the feature
- Print the purchase order when the quotation is confirmed

To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve (code review, test)
Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

Hi Vincent,

Could you actualize the comment under the new created function "def print_purchase"? (it doesn't mark the purchase as sent)

Thanks,

Romain

review: Needs Fixing (code review)
20. By Romain Deheele - Camptocamp

[IMP] update comment under print_purchase function

Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

I update the comment ;)

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'purchase_order_webkit/__init__.py'
2--- purchase_order_webkit/__init__.py 2014-01-10 11:04:45 +0000
3+++ purchase_order_webkit/__init__.py 2014-04-24 11:20:51 +0000
4@@ -27,4 +27,5 @@
5 #
6 ##############################################################################
7
8-from . import report
9\ No newline at end of file
10+from . import report
11+from . import purchase_order
12\ No newline at end of file
13
14=== modified file 'purchase_order_webkit/__openerp__.py'
15--- purchase_order_webkit/__openerp__.py 2014-02-21 13:18:22 +0000
16+++ purchase_order_webkit/__openerp__.py 2014-04-24 11:20:51 +0000
17@@ -39,7 +39,8 @@
18 'author': 'Camptocamp',
19 'website': 'http://www.camptocamp.com',
20 'depends': ['base', 'report_webkit', 'base_headers_webkit', 'purchase'],
21- 'data': ['purchase_report.xml'],
22+ 'data': ['purchase_report.xml',
23+ 'view/purchase_view.xml'],
24 'test': [],
25 'installable': True,
26 'active': False,
27
28=== modified file 'purchase_order_webkit/i18n/de.po'
29--- purchase_order_webkit/i18n/de.po 2014-04-17 06:56:13 +0000
30+++ purchase_order_webkit/i18n/de.po 2014-04-24 11:20:51 +0000
31@@ -134,3 +134,25 @@
32 #: report:addons/purchase_order_webkit/report/purchase_order.mako:319
33 msgid "Net :"
34 msgstr "Netto:"
35+
36+#. module: purchase_order_webkit
37+#: report:addons/purchase_order_webkit/report/purchase_order.mako:266
38+msgid "Shipping address:"
39+msgstr "Lieferadresse:"
40+
41+#. module: purchase_order_webkit
42+#: report:addons/purchase_order_webkit/report/request_quotation.mako:268
43+msgid "Shipping address:"
44+msgstr "Lieferadresse:"
45+
46+#. module: purchase_order_webkit
47+#: report:addons/purchase_order_webkit/report/purchase_order.mako:259
48+msgid "Invoice address:"
49+msgstr "Rechnungsadresse:"
50+
51+#. module: purchase_order_webkit
52+#: report:addons/purchase_order_webkit/report/request_quotation.mako:261
53+msgid "Invoice address:"
54+msgstr "Rechnungsadresse:"
55+
56+
57
58=== modified file 'purchase_order_webkit/i18n/fr.po'
59--- purchase_order_webkit/i18n/fr.po 2014-04-17 06:56:13 +0000
60+++ purchase_order_webkit/i18n/fr.po 2014-04-24 11:20:51 +0000
61@@ -134,3 +134,24 @@
62 #: report:addons/purchase_order_webkit/report/purchase_order.mako:319
63 msgid "Net :"
64 msgstr "Net :"
65+
66+#. module: purchase_order_webkit
67+#: report:addons/purchase_order_webkit/report/purchase_order.mako:266
68+msgid "Shipping address:"
69+msgstr "Adresse de livraison:"
70+
71+#. module: purchase_order_webkit
72+#: report:addons/purchase_order_webkit/report/request_quotation.mako:268
73+msgid "Shipping address:"
74+msgstr "Adresse de livraison:"
75+
76+#. module: purchase_order_webkit
77+#: report:addons/purchase_order_webkit/report/purchase_order.mako:259
78+msgid "Invoice address:"
79+msgstr "Adresse de facturation:"
80+
81+#. module: purchase_order_webkit
82+#: report:addons/purchase_order_webkit/report/request_quotation.mako:261
83+msgid "Invoice address:"
84+msgstr "Adresse de facturation:"
85+
86
87=== modified file 'purchase_order_webkit/i18n/purchase_order_webkit.pot'
88--- purchase_order_webkit/i18n/purchase_order_webkit.pot 2014-01-13 13:08:43 +0000
89+++ purchase_order_webkit/i18n/purchase_order_webkit.pot 2014-04-24 11:20:51 +0000
90@@ -135,3 +135,23 @@
91 msgid "Net :"
92 msgstr ""
93
94+#. module: purchase_order_webkit
95+#: report:addons/purchase_order_webkit/report/purchase_order.mako:266
96+msgid "Shipping address:"
97+msgstr ""
98+
99+#. module: purchase_order_webkit
100+#: report:addons/purchase_order_webkit/report/request_quotation.mako:268
101+msgid "Shipping address:"
102+msgstr ""
103+
104+#. module: purchase_order_webkit
105+#: report:addons/purchase_order_webkit/report/purchase_order.mako:259
106+msgid "Invoice address:"
107+msgstr ""
108+
109+#. module: purchase_order_webkit
110+#: report:addons/purchase_order_webkit/report/request_quotation.mako:261
111+msgid "Invoice address:"
112+msgstr ""
113+
114
115=== modified file 'purchase_order_webkit/report/purchase_order.mako'
116--- purchase_order_webkit/report/purchase_order.mako 2014-04-07 16:11:22 +0000
117+++ purchase_order_webkit/report/purchase_order.mako 2014-04-24 11:20:51 +0000
118@@ -254,10 +254,17 @@
119 <table class="recipient">
120 ${address(partner=purch.partner_id)}
121 </table>
122-
123+ %if purch.company_id.partner_id:
124+ <table class="invoice">
125+ <tr><td class="address_title">${_("Invoice address:")}</td></tr>
126+ ${address(partner=purch.company_id.partner_id)}
127+ </table>
128+ %endif
129+ <br/>
130 %if purch.dest_address_id:
131 <table class="shipping">
132- ${address(partner=purch.dest_address_id)}
133+ <tr><td class="address_title">${_("Shipping address:")}</td></tr>
134+ ${address(partner=purch.dest_address_id)}
135 </table>
136 %endif
137 </div>
138
139=== modified file 'purchase_order_webkit/report/request_quotation.mako'
140--- purchase_order_webkit/report/request_quotation.mako 2014-04-07 16:11:22 +0000
141+++ purchase_order_webkit/report/request_quotation.mako 2014-04-24 11:20:51 +0000
142@@ -254,12 +254,19 @@
143 <% setLang(purch.partner_id.lang) %>
144 <div class="address">
145 <table class="recipient">
146- ${address(partner=purch.partner_id)}
147+ ${address(partner=purch.partner_id)}
148 </table>
149-
150+ %if purch.company_id.partner_id:
151+ <table class="invoice">
152+ <tr><td class="address_title">${_("Invoice address:")}</td></tr>
153+ ${address(partner=purch.company_id.partner_id)}
154+ </table>
155+ %endif
156+ <br/>
157 %if purch.dest_address_id:
158 <table class="shipping">
159- ${address(partner=purch.dest_address_id)}
160+ <tr><td class="address_title">${_("Shipping address:")}</td></tr>
161+ ${address(partner=purch.dest_address_id)}
162 </table>
163 %endif
164 </div>
165@@ -267,23 +274,23 @@
166 <h3 style="clear:both; padding-top: 20px;">${_("Request for Quotation:")} ${purch.name}</h3>
167 <table class="list_main_table" width="100%" >
168 <thead>
169- <tr>
170+ <tr>
171 <th class="list_main_headers" style="width: 100%">
172 <table style="width:100%">
173+ <tr>
174 <th class="main_col1">${_("Description")}</th>
175 <th class="main_col3">${_("Expected Date")}</th>
176 <th style="text-align:center" class="amount main_col4">${_("Qty")}</th>
177 </tr>
178 </table>
179 </th>
180- </tr>
181+ </tr>
182 </thead>
183 <tbody>
184 <tr>
185 <td class="list_main_lines" style="width: 100%">
186 <div class="nobreak">
187 <table style="width:100%">
188- <tr>
189 %for line in purch.order_line :
190 <tr class="line">
191 <td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
192
193=== added directory 'purchase_order_webkit/view'
194=== added file 'purchase_order_webkit/view/purchase_view.xml'
195--- purchase_order_webkit/view/purchase_view.xml 1970-01-01 00:00:00 +0000
196+++ purchase_order_webkit/view/purchase_view.xml 2014-04-24 11:20:51 +0000
197@@ -0,0 +1,17 @@
198+<?xml version="1.0"?>
199+<openerp>
200+ <data>
201+
202+ <record model="ir.ui.view" id="purchase_order_form_over">
203+ <field name="name">purchase.order.form.add.notes</field>
204+ <field name="model">purchase.order</field>
205+ <field name="inherit_id" ref="purchase.purchase_order_form"/>
206+ <field name="arch" type="xml">
207+ <xpath expr="//button[@name='print_quotation'][last()]" position="after">
208+ <button name="print_purchase" string="Print" type="object" states="approved,except_picking,except_invoice" groups="base.group_user"/>
209+ </xpath>
210+ </field>
211+ </record>
212+
213+ </data>
214+</openerp>
215
216=== modified file 'purchase_order_webkit_with_notes/i18n/fr.po'
217--- purchase_order_webkit_with_notes/i18n/fr.po 2014-04-17 06:56:13 +0000
218+++ purchase_order_webkit_with_notes/i18n/fr.po 2014-04-24 11:20:51 +0000
219@@ -186,3 +186,23 @@
220 #: report:addons/purchase_order_webkit_with_notes/report/purchase_order.mako:319
221 msgid "Net :"
222 msgstr "Net :"
223+
224+#. module: purchase_order_webkit
225+#: report:addons/purchase_order_webkit_with_notes/report/purchase_order.mako:266
226+msgid "Shipping address:"
227+msgstr "Adresse de livraison:"
228+
229+#. module: purchase_order_webkit
230+#: report:addons/purchase_order_webkit_with_notes/report/request_quotation.mako:268
231+msgid "Shipping address:"
232+msgstr "Adresse de livraison:"
233+
234+#. module: purchase_order_webkit
235+#: report:addons/purchase_order_webkit_with_notes/report/purchase_order.mako:259
236+msgid "Invoice address:"
237+msgstr "Adresse de facturation:"
238+
239+#. module: purchase_order_webkit
240+#: report:addons/purchase_order_webkit_with_notes/report/request_quotation.mako:261
241+msgid "Invoice address:"
242+msgstr "Adresse de facturation:"
243
244=== modified file 'purchase_order_webkit_with_notes/i18n/purchase_order_webkit.pot'
245--- purchase_order_webkit_with_notes/i18n/purchase_order_webkit.pot 2014-01-13 13:08:43 +0000
246+++ purchase_order_webkit_with_notes/i18n/purchase_order_webkit.pot 2014-04-24 11:20:51 +0000
247@@ -185,3 +185,22 @@
248 msgid "Net :"
249 msgstr ""
250
251+#. module: purchase_order_webkit
252+#: report:addons/purchase_order_webkit_with_notes/report/purchase_order.mako:266
253+msgid "Shipping address:"
254+msgstr ""
255+
256+#. module: purchase_order_webkit
257+#: report:addons/purchase_order_webkit_with_notes/report/request_quotation.mako:268
258+msgid "Shipping address:"
259+msgstr ""
260+
261+#. module: purchase_order_webkit
262+#: report:addons/purchase_order_webkit_with_notes/report/purchase_order.mako:259
263+msgid "Invoice address:"
264+msgstr ""
265+
266+#. module: purchase_order_webkit
267+#: report:addons/purchase_order_webkit_with_notes/report/request_quotation.mako:261
268+msgid "Invoice address:"
269+msgstr ""
270
271=== modified file 'purchase_order_webkit_with_notes/purchase_order.py'
272--- purchase_order_webkit_with_notes/purchase_order.py 2013-12-19 10:16:53 +0000
273+++ purchase_order_webkit_with_notes/purchase_order.py 2014-04-24 11:20:51 +0000
274@@ -87,6 +87,20 @@
275 'form': self.read(cr, uid, ids[0], context=context),
276 }
277 return {'type': 'ir.actions.report.xml',
278+ 'report_name': 'purchase.quotation.webkit',
279+ 'datas': datas,
280+ 'nodestroy': True}
281+
282+ def print_purchase(self, cr, uid, ids, context=None):
283+ """
284+ This function prints the purchase order (already sent)
285+ """
286+ datas = {'model': 'purchase.order',
287+ 'ids': ids,
288+ 'form': self.read(cr, uid, ids[0], context=context),
289+ }
290+ return {'type': 'ir.actions.report.xml',
291 'report_name': 'purchase.order.webkit',
292 'datas': datas,
293 'nodestroy': True}
294+
295
296=== modified file 'purchase_order_webkit_with_notes/report/purchase_order.mako'
297--- purchase_order_webkit_with_notes/report/purchase_order.mako 2014-04-07 16:14:25 +0000
298+++ purchase_order_webkit_with_notes/report/purchase_order.mako 2014-04-24 11:20:51 +0000
299@@ -252,12 +252,19 @@
300 <% setLang(purch.partner_id.lang) %>
301 <div class="address">
302 <table class="recipient">
303- ${address(partner=purch.partner_id)}
304+ ${address(partner=purch.partner_id)}
305 </table>
306-
307+ %if purch.company_id.partner_id:
308+ <table class="invoice">
309+ <tr><td class="address_title">${_("Invoice address:")}</td></tr>
310+ ${address(partner=purch.company_id.partner_id)}
311+ </table>
312+ %endif
313+ <br/>
314 %if purch.dest_address_id:
315 <table class="shipping">
316- ${address(partner=purch.dest_address_id)}
317+ <tr><td class="address_title">${_("Shipping address:")}</td></tr>
318+ ${address(partner=purch.dest_address_id)}
319 </table>
320 %endif
321 </div>
322
323=== modified file 'purchase_order_webkit_with_notes/report/request_quotation.mako'
324--- purchase_order_webkit_with_notes/report/request_quotation.mako 2014-04-07 16:14:25 +0000
325+++ purchase_order_webkit_with_notes/report/request_quotation.mako 2014-04-24 11:20:51 +0000
326@@ -254,12 +254,19 @@
327 <% setLang(purch.partner_id.lang) %>
328 <div class="address">
329 <table class="recipient">
330- ${address(partner=purch.partner_id)}
331+ ${address(partner=purch.partner_id)}
332 </table>
333-
334+ %if purch.company_id.partner_id:
335+ <table class="invoice">
336+ <tr><td class="address_title">${_("Invoice address:")}</td></tr>
337+ ${address(partner=purch.company_id.partner_id)}
338+ </table>
339+ %endif
340+ <br/>
341 %if purch.dest_address_id:
342 <table class="shipping">
343- ${address(partner=purch.dest_address_id)}
344+ <tr><td class="address_title">${_("Shipping address:")}</td></tr>
345+ ${address(partner=purch.dest_address_id)}
346 </table>
347 %endif
348 </div>
349@@ -273,6 +280,7 @@
350 <tr>
351 <th class="list_main_headers" style="width: 100%">
352 <table style="width:100%">
353+ <tr>
354 <th class="main_col1">${_("Description")}</th>
355 <th class="main_col3">${_("Expected Date")}</th>
356 <th style="text-align:center" class="amount main_col4">${_("Qty")}</th>
357
358=== modified file 'purchase_order_webkit_with_notes/view/purchase_view.xml'
359--- purchase_order_webkit_with_notes/view/purchase_view.xml 2014-01-13 08:54:55 +0000
360+++ purchase_order_webkit_with_notes/view/purchase_view.xml 2014-04-24 11:20:51 +0000
361@@ -50,6 +50,9 @@
362 <field name="model">purchase.order</field>
363 <field name="inherit_id" ref="purchase.purchase_order_form"/>
364 <field name="arch" type="xml">
365+ <xpath expr="//button[@name='print_quotation'][last()]" position="after">
366+ <button name="print_purchase" string="Print" type="object" states="approved,except_picking,except_invoice" groups="base.group_user"/>
367+ </xpath>
368 <xpath expr="//page[last()]" position="after">
369 <page string="Conditions">
370 <group>

Subscribers

People subscribed via source and target branches