Merge lp:~agilebg/openobject-italia/adding_l10n_it_DDT_webkit_7 into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by Lorenzo Battistini
Status: Merged
Merged at revision: 233
Proposed branch: lp:~agilebg/openobject-italia/adding_l10n_it_DDT_webkit_7
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 406 lines (+369/-0)
7 files modified
l10n_it_DDT_webkit/__init__.py (+25/-0)
l10n_it_DDT_webkit/__openerp__.py (+38/-0)
l10n_it_DDT_webkit/i18n/it.po (+93/-0)
l10n_it_DDT_webkit/report.xml (+16/-0)
l10n_it_DDT_webkit/report/__init__.py (+24/-0)
l10n_it_DDT_webkit/report/ddt.mako (+121/-0)
l10n_it_DDT_webkit/report/stock_report.py (+52/-0)
To merge this branch: bzr merge lp:~agilebg/openobject-italia/adding_l10n_it_DDT_webkit_7
Reviewer Review Type Date Requested Status
Nicola Malcontenti - Agile BG (community) Approve
Alex Comba - Agile BG (community) code review, no test Approve
Davide Corio (community) Abstain
Review via email: mp+194900@code.launchpad.net
To post a comment you must log in.
231. By Lorenzo Battistini

[FIX] print header DDT

232. By Lorenzo Battistini

[IMP] layout

233. By Nicola Malcontenti - Agile BG

[FIX] Translation

Revision history for this message
Davide Corio (enlightx-deactivatedaccount) wrote :

Ho testato il report.
A parte un errore di traduzione (quantià invece di quantità), mi pare tutto in ordine.

Non sto a sindacare sul layout (impostazioni grafiche, disposizione dei campi, etc) o sulla presenza di tutti i dati richiesti dalla normativa, ma mi chiedevo se non conveniva avere un DDT "più classico" ovvero diverso dallo standard dei report di OpenERP.

E' verissimo che quasi tutti usano stampe personalizzate, ma penso che nessuno userebbe questo in particolare.

Ovviamente il sunto del discorso è che possiamo partire da questo è migliorarlo!

review: Abstain
Revision history for this message
Lorenzo Battistini (elbati) wrote :

On 12/11/2013 06:56 PM, Davide Corio wrote:
> Review: Abstain
>
> Ho testato il report.
> A parte un errore di traduzione (quantià invece di quantità), mi pare tutto in ordine.
>
> Non sto a sindacare sul layout (impostazioni grafiche, disposizione dei campi, etc) o sulla presenza di tutti i dati richiesti dalla normativa, ma mi chiedevo se non conveniva avere un DDT "più classico" ovvero diverso dallo standard dei report di OpenERP.

Preciso solo che quella proposta è le versione 'DDT' del report webkit
generico per il picking:
http://bazaar.launchpad.net/~stock-logistic-core-editors/stock-logistic-report/7.0/view/head:/stock_picking_webkit/report/delivery_slip.mako
<http://bazaar.launchpad.net/%7Estock-logistic-core-editors/stock-logistic-report/7.0/view/head:/stock_picking_webkit/report/delivery_slip.mako>

Revision history for this message
Davide Corio (enlightx-deactivatedaccount) wrote :

Certamente.
Alla fine stiamo comunque parlando più che altro di aggiustamente grafici, per far si che un eventuale DDT ufficiale nella localizzazione italiana venga accettato dagli utenti.

Siamo tutti d'accordo sul fatto che i template ufficiali sono inguardabili :)

Revision history for this message
Alex Comba - Agile BG (tafaru) :
review: Approve (code review, no test)
Revision history for this message
Nicola Malcontenti - Agile BG (hurrin1c0) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'l10n_it_DDT_webkit'
2=== added file 'l10n_it_DDT_webkit/__init__.py'
3--- l10n_it_DDT_webkit/__init__.py 1970-01-01 00:00:00 +0000
4+++ l10n_it_DDT_webkit/__init__.py 2013-12-11 16:16:01 +0000
5@@ -0,0 +1,25 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# Copyright (C) 2013
10+# Associazione OpenERP Italia (<http://www.openerp-italia.org>)
11+#
12+# Copyright (c) 2013 Agile Business Group (http://www.agilebg.com)
13+# @author Lorenzo Battistini
14+#
15+# This program is free software: you can redistribute it and/or modify
16+# it under the terms of the GNU General Public License as published by
17+# the Free Software Foundation, either version 3 of the License, or
18+# (at your option) any later version.
19+#
20+# This program is distributed in the hope that it will be useful,
21+# but WITHOUT ANY WARRANTY; without even the implied warranty of
22+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+# GNU General Public License for more details.
24+#
25+# You should have received a copy of the GNU General Public License
26+# along with this program. If not, see <http://www.gnu.org/licenses/>.
27+#
28+##############################################################################
29+
30+import report
31
32=== added file 'l10n_it_DDT_webkit/__openerp__.py'
33--- l10n_it_DDT_webkit/__openerp__.py 1970-01-01 00:00:00 +0000
34+++ l10n_it_DDT_webkit/__openerp__.py 2013-12-11 16:16:01 +0000
35@@ -0,0 +1,38 @@
36+# -*- coding: utf-8 -*-
37+##############################################################################
38+#
39+# Copyright (C) 2013
40+# Associazione OpenERP Italia (<http://www.openerp-italia.org>)
41+#
42+# Copyright (c) 2013 Agile Business Group (http://www.agilebg.com)
43+# @author Lorenzo Battistini
44+#
45+# This program is free software: you can redistribute it and/or modify
46+# it under the terms of the GNU General Public License as published by
47+# the Free Software Foundation, either version 3 of the License, or
48+# (at your option) any later version.
49+#
50+# This program is distributed in the hope that it will be useful,
51+# but WITHOUT ANY WARRANTY; without even the implied warranty of
52+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53+# GNU General Public License for more details.
54+#
55+# You should have received a copy of the GNU General Public License
56+# along with this program. If not, see <http://www.gnu.org/licenses/>.
57+#
58+##############################################################################
59+
60+{
61+ 'name': 'DDT report using Webkit Library',
62+ 'version': '1.0',
63+ 'category': 'Reports/Webkit',
64+ 'description': """
65+This module adds the webkit DDT report
66+ """,
67+ 'author': 'Agile Business Group',
68+ 'website': 'http://www.agilebg.com',
69+ 'depends': ['report_webkit', 'l10n_it_sale', 'base_headers_webkit'],
70+ 'data': ['report.xml'],
71+ 'installable': True,
72+ 'active': False,
73+}
74
75=== added directory 'l10n_it_DDT_webkit/i18n'
76=== added file 'l10n_it_DDT_webkit/i18n/it.po'
77--- l10n_it_DDT_webkit/i18n/it.po 1970-01-01 00:00:00 +0000
78+++ l10n_it_DDT_webkit/i18n/it.po 2013-12-11 16:16:01 +0000
79@@ -0,0 +1,93 @@
80+# Translation of OpenERP Server.
81+# This file contains the translation of the following modules:
82+# * l10n_it_DDT_webkit
83+#
84+msgid ""
85+msgstr ""
86+"Project-Id-Version: OpenERP Server 7.0\n"
87+"Report-Msgid-Bugs-To: \n"
88+"POT-Creation-Date: 2013-12-11 15:23+0000\n"
89+"PO-Revision-Date: 2013-12-11 16:34+0100\n"
90+"Last-Translator: <>\n"
91+"Language-Team: \n"
92+"MIME-Version: 1.0\n"
93+"Content-Type: text/plain; charset=UTF-8\n"
94+"Content-Transfer-Encoding: 8bit\n"
95+"Plural-Forms: \n"
96+"Language: it\n"
97+"X-Generator: Poedit 1.6.2\n"
98+
99+#. module: l10n_it_DDT_webkit
100+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:54
101+msgid "Origin"
102+msgstr "Origine"
103+
104+#. module: l10n_it_DDT_webkit
105+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:74
106+msgid "Scheduled Date"
107+msgstr "Data Schedulazione"
108+
109+#. module: l10n_it_DDT_webkit
110+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:72
111+msgid "Reason For Transportation"
112+msgstr "Causale del trasporto"
113+
114+#. module: l10n_it_DDT_webkit
115+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:88
116+msgid "Description"
117+msgstr "Descrizione"
118+
119+#. module: l10n_it_DDT_webkit
120+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:56
121+msgid "Weight"
122+msgstr "Peso"
123+
124+#. module: l10n_it_DDT_webkit
125+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:71
126+msgid "Description of goods"
127+msgstr "Aspetto dei Beni"
128+
129+#. module: l10n_it_DDT_webkit
130+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:57
131+msgid "Nr. package"
132+msgstr "Nr. Pacchi"
133+
134+#. module: l10n_it_DDT_webkit
135+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:36
136+msgid "Invoice address:"
137+msgstr "Indirizzo Fatturazione:"
138+
139+#. module: l10n_it_DDT_webkit
140+#: model:ir.actions.report.xml,name:l10n_it_DDT_webkit.ddt_webkit
141+msgid "DDT"
142+msgstr "DDT"
143+
144+#. module: l10n_it_DDT_webkit
145+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:55
146+msgid "DDT date"
147+msgstr "Data DDT"
148+
149+#. module: l10n_it_DDT_webkit
150+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:89
151+msgid "Serial Number"
152+msgstr "Numero Seriale"
153+
154+#. module: l10n_it_DDT_webkit
155+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:53
156+msgid "Contact"
157+msgstr "Contatto"
158+
159+#. module: l10n_it_DDT_webkit
160+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:73
161+msgid "Carriage condition"
162+msgstr "Resa merce"
163+
164+#. module: l10n_it_DDT_webkit
165+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:75
166+msgid "Delivery Method"
167+msgstr "Metodo Spedizione"
168+
169+#. module: l10n_it_DDT_webkit
170+#: report:addons/l10n_it_DDT_webkit/report/ddt.mako:90
171+msgid "Quantity"
172+msgstr "Quantià"
173
174=== added directory 'l10n_it_DDT_webkit/report'
175=== added file 'l10n_it_DDT_webkit/report.xml'
176--- l10n_it_DDT_webkit/report.xml 1970-01-01 00:00:00 +0000
177+++ l10n_it_DDT_webkit/report.xml 2013-12-11 16:16:01 +0000
178@@ -0,0 +1,16 @@
179+<?xml version="1.0" encoding="utf-8"?>
180+<openerp>
181+ <data>
182+
183+ <report id="ddt_webkit"
184+ name="ddt_webkit"
185+ auto="False"
186+ model="stock.picking.out"
187+ file="l10n_it_DDT_webkit/report/ddt.mako"
188+ string="DDT"
189+ report_type="webkit"
190+ header="True"
191+ webkit_header="base_headers_webkit.base_reports_portrait_header" />
192+
193+ </data>
194+</openerp>
195
196=== added file 'l10n_it_DDT_webkit/report/__init__.py'
197--- l10n_it_DDT_webkit/report/__init__.py 1970-01-01 00:00:00 +0000
198+++ l10n_it_DDT_webkit/report/__init__.py 2013-12-11 16:16:01 +0000
199@@ -0,0 +1,24 @@
200+# -*- coding: utf-8 -*-
201+##############################################################################
202+#
203+# Copyright (C) 2013
204+# Associazione OpenERP Italia (<http://www.openerp-italia.org>)
205+#
206+# Copyright (c) 2013 Agile Business Group (http://www.agilebg.com)
207+# @author Lorenzo Battistini
208+#
209+# This program is free software: you can redistribute it and/or modify
210+# it under the terms of the GNU General Public License as published by
211+# the Free Software Foundation, either version 3 of the License, or
212+# (at your option) any later version.
213+#
214+# This program is distributed in the hope that it will be useful,
215+# but WITHOUT ANY WARRANTY; without even the implied warranty of
216+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
217+# GNU General Public License for more details.
218+#
219+# You should have received a copy of the GNU General Public License
220+# along with this program. If not, see <http://www.gnu.org/licenses/>.
221+#
222+##############################################################################
223+import stock_report
224
225=== added file 'l10n_it_DDT_webkit/report/ddt.mako'
226--- l10n_it_DDT_webkit/report/ddt.mako 1970-01-01 00:00:00 +0000
227+++ l10n_it_DDT_webkit/report/ddt.mako 2013-12-11 16:16:01 +0000
228@@ -0,0 +1,121 @@
229+<html>
230+<head>
231+ <style type="text/css">
232+ ${css}
233+ </style>
234+</head>
235+
236+<body>
237+ <%page expression_filter="entity"/>
238+ <%
239+ def carriage_returns(text):
240+ return text.replace('\n', '<br />')
241+ %>
242+ %for picking in objects:
243+ <% setLang(picking.partner_id.lang) %>
244+ <div class="address">
245+ <table class="recipient">
246+ %if picking.partner_id.parent_id:
247+ <tr><td class="name">${picking.partner_id.parent_id.name or ''}</td></tr>
248+ <tr><td>${picking.partner_id.title and picking.partner_id.title.name or ''} ${picking.partner_id.name }</td></tr>
249+ <% address_lines = picking.partner_id.contact_address.split("\n")[1:] %>
250+ %else:
251+ <tr><td class="name">${picking.partner_id.title and picking.partner_id.title.name or ''} ${picking.partner_id.name }</td></tr>
252+ <% address_lines = picking.partner_id.contact_address.split("\n") %>
253+ %endif
254+ %for part in address_lines:
255+ %if part:
256+ <tr><td>${part}</td></tr>
257+ %endif
258+ %endfor
259+ </table>
260+ <%
261+ invoice_addr = invoice_address(picking)
262+ %>
263+ <table class="invoice">
264+ <tr><td class="address_title">${_("Invoice address:")}</td></tr>
265+ <tr><td>${invoice_addr.title and invoice_addr.title.name or ''} ${invoice_addr.name }</td></tr>
266+ %if invoice_addr.contact_address:
267+ <% address_lines = invoice_addr.contact_address.split("\n") %>
268+ %for part in address_lines:
269+ %if part:
270+ <tr><td>${part}</td></tr>
271+ %endif
272+ %endfor
273+ %endif
274+ </table>
275+ </div>
276+
277+ <h1 style="clear:both;">DDT n.: ${picking.ddt_number or ''}</h1>
278+
279+ <table class="basic_table" width="100%">
280+ <tr>
281+ <td style="font-weight:bold;">${_('Contact')}</td>
282+ <td style="font-weight:bold;">${_('Origin')}</td>
283+ <td style="font-weight:bold;">${_('DDT date')}</td>
284+ <td style="font-weight:bold;">${_('Weight')}</td>
285+ <td style="font-weight:bold;">${_('Nr. package')}</td>
286+ </tr>
287+ <tr>
288+ <td>${user.name}</td>
289+ <td>${picking.origin or ''}</td>
290+ <td>${formatLang(picking.ddt_date, date=True)}</td>
291+ <td>${picking.weight}</td>
292+ <td>${picking.number_of_packages}</td>
293+ </tr>
294+ </table>
295+ <br />
296+ <br />
297+ <table class="basic_table" width="100%">
298+ <tr>
299+ <td style="font-weight:bold;">${_('Description of goods')}</td>
300+ <td style="font-weight:bold;">${_("Reason For Transportation")}</td>
301+ <td style="font-weight:bold;">${_("Carriage condition")}</td>
302+ <td style="font-weight:bold;">${_('Scheduled Date')}</td>
303+ <td style="font-weight:bold;">${_('Delivery Method')}</td>
304+ </tr>
305+ <tr>
306+ <td>${picking.goods_description_id and picking.goods_description_id.name or '' }</td>
307+ <td>${picking.transportation_reason_id and picking.transportation_reason_id.name or ''}</td>
308+ <td>${picking.carriage_condition_id and picking.carriage_condition_id.name or ''}</td>
309+ <td>${formatLang(picking.min_date, date=True)}</td>
310+ <td>${picking.carrier_id and picking.carrier_id.name or ''}</td>
311+ </tr>
312+ </table>
313+ <table class="list_table td " width="100%" style="margin-top: 20px;">
314+ <thead>
315+ <tr>
316+ <th style="text-align:left; ">${_("Description")}</th>
317+ <th style="text-align:left; ">${_("Serial Number")}</th>
318+ <th class="amount">${_("Quantity")}</th>
319+ </tr>
320+ </thead>
321+ <tbody>
322+ %for line in picking.move_lines:
323+ <tr class="line" >
324+ <td style="text-align:left; " >${ line.name }</td>
325+ <td style="text-align:left; " >${ line.prodlot_id and line.prodlot_id.name or ''}</td>
326+ <td class="amount" >${ formatLang(line.product_qty) } ${line.product_uom.name}</td>
327+ </tr>
328+ %endfor
329+ </table>
330+
331+ <br/>
332+ %if picking.note :
333+ <p class="std_text">${picking.note | carriage_returns}</p>
334+ %endif
335+ <br/><br/><br/><br/>
336+ <table class="basic_table" width="100%">
337+ <tr>
338+ <td style="font-weight:bold;">Data Ritiro</td>
339+ <td style="font-weight:bold;">Firma</td>
340+ </tr>
341+ <tr>
342+ <td><br /></td>
343+ <td><br /><br /></td>
344+ </tr>
345+ </table>
346+ <p style="page-break-after: always"/>
347+ %endfor
348+</body>
349+</html>
350
351=== added file 'l10n_it_DDT_webkit/report/stock_report.py'
352--- l10n_it_DDT_webkit/report/stock_report.py 1970-01-01 00:00:00 +0000
353+++ l10n_it_DDT_webkit/report/stock_report.py 2013-12-11 16:16:01 +0000
354@@ -0,0 +1,52 @@
355+# -*- coding: utf-8 -*-
356+##############################################################################
357+#
358+# Copyright (C) 2013
359+# Associazione OpenERP Italia (<http://www.openerp-italia.org>)
360+#
361+# Copyright (c) 2013 Agile Business Group (http://www.agilebg.com)
362+# @author Lorenzo Battistini
363+#
364+# This program is free software: you can redistribute it and/or modify
365+# it under the terms of the GNU General Public License as published by
366+# the Free Software Foundation, either version 3 of the License, or
367+# (at your option) any later version.
368+#
369+# This program is distributed in the hope that it will be useful,
370+# but WITHOUT ANY WARRANTY; without even the implied warranty of
371+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
372+# GNU General Public License for more details.
373+#
374+# You should have received a copy of the GNU General Public License
375+# along with this program. If not, see <http://www.gnu.org/licenses/>.
376+#
377+
378+import operator
379+from report import report_sxw
380+import pooler
381+import time
382+
383+
384+class DeliverySlip(report_sxw.rml_parse):
385+
386+ def _get_invoice_address(self, picking):
387+ if picking.sale_id:
388+ return picking.sale_id.partner_invoice_id
389+ partner_obj = self.pool.get('res.partner')
390+ invoice_address_id = picking.partner_id.address_get(
391+ adr_pref=['invoice']
392+ )['invoice']
393+ return partner_obj.browse(
394+ self.cr, self.uid, invoice_address_id)
395+
396+ def __init__(self, cr, uid, name, context):
397+ super(DeliverySlip, self).__init__(cr, uid, name, context=context)
398+ self.localcontext.update({
399+ 'time': time,
400+ 'invoice_address': self._get_invoice_address,
401+ })
402+
403+report_sxw.report_sxw('report.ddt_webkit',
404+ 'stock.picking',
405+ 'addons/l10n_it_DDT_webkit/report/ddt.mako',
406+ parser=DeliverySlip)

Subscribers

People subscribed via source and target branches