[ADD] delivery_slip draft

This commit is contained in:
Lorenzo Battistini
2013-09-09 15:37:08 +02:00
parent 1b349ba647
commit 0385a20150
3 changed files with 75 additions and 0 deletions

View File

@@ -20,6 +20,15 @@
report_type="webkit"
header="False"
webkit_header="base_headers_webkit.base_minimum_reports_portrait_header" />
<report id="webkit_delivery_slip"
name="webkit.delivery_slip"
auto="False"
model="stock.picking.out"
file="stock_picking_webkit/report/delivery_slip.mako"
string="Delivery Slip webkit"
report_type="webkit"
header="True"
webkit_header="base_headers_webkit.base_reports_portrait_header" />
</data>
</openerp>

View File

@@ -0,0 +1,53 @@
<html>
<head>
<style type="text/css">
${css}
</style>
</head>
<body>
<%page expression_filter="entity"/>
<%
def carriage_returns(text):
return text.replace('\n', '<br />')
%>
%for picking in objects:
<% setLang(picking.partner_id.lang) %>
<div class="address">
<table class="recipient">
%if picking.partner_id.parent_id:
<tr><td class="name">${picking.partner_id.parent_id.name or ''}</td></tr>
<tr><td>${picking.partner_id.title and picking.partner_id.title.name or ''} ${picking.partner_id.name }</td></tr>
<% address_lines = picking.partner_id.contact_address.split("\n")[1:] %>
%else:
<tr><td class="name">${picking.partner_id.title and picking.partner_id.title.name or ''} ${picking.partner_id.name }</td></tr>
<% address_lines = picking.partner_id.contact_address.split("\n") %>
%endif
%for part in address_lines:
%if part:
<tr><td>${part}</td></tr>
%endif
%endfor
</table>
</div>
<h1 style="clear:both;">${_(u'Delivery Order') } ${picking.name}</h1>
<table class="basic_table" width="100%">
<tr>
<td style="font-weight:bold;">${_("Stock Journal")}</td>
<td style="font-weight:bold;">${_("Origin")}</td>
<td style="font-weight:bold;">${_("Scheduled Date")}</td>
<td style="font-weight:bold;">${_('Weight')}</td>
</tr>
<tr>
<td>${picking.stock_journal_id and picking.stock_journal_id.name or ''}</td>
<td>${picking.origin or ''}</td>
<td>${formatLang(picking.min_date, date=True)}</td>
<td>${picking.weight}</td>
</tr>
</table>
%endfor
</body>
</html>

View File

@@ -21,6 +21,7 @@
import operator
from report import report_sxw
import pooler
import time
class NullMove(object):
"""helper class to generate empty lines in the delivery report"""
@@ -114,6 +115,13 @@ class PrintPick(report_sxw.rml_parse):
objects.append(PickingAgregation(agr[0], agr[1], agreg[agr]))
return super(PrintPick, self).set_context(objects, data, ids, report_type=report_type)
class DeliverySlip(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(DeliverySlip, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
report_sxw.report_sxw('report.webkit.aggregated_picking',
'stock.picking',
'addons/stock_picking_webkit/report/picking.html.mako',
@@ -123,3 +131,8 @@ report_sxw.report_sxw('report.webkit.aggregated_delivery',
'stock.picking',
'addons/stock_picking_webkit/report/delivery.html.mako',
parser=PrintPick)
report_sxw.report_sxw('report.webkit.delivery_slip',
'stock.picking',
'addons/stock_picking_webkit/report/delivery_slip.mako',
parser=DeliverySlip)