mirror of
https://github.com/OCA/stock-logistics-reporting.git
synced 2025-02-16 17:13:21 +02:00
[ADD] invoice address
This commit is contained in:
@@ -29,6 +29,21 @@
|
||||
%endif
|
||||
%endfor
|
||||
</table>
|
||||
<%
|
||||
invoice_addr = invoice_address(picking.partner_id.id)
|
||||
%>
|
||||
<table class="invoice">
|
||||
<tr><td class="address_title">${_("Invoice address:")}</td></tr>
|
||||
<tr><td>${invoice_addr.title and invoice_addr.title.name or ''} ${invoice_addr.name }</td></tr>
|
||||
%if invoice_addr.contact_address:
|
||||
<% address_lines = invoice_addr.contact_address.split("\n") %>
|
||||
%for part in address_lines:
|
||||
%if part:
|
||||
<tr><td>${part}</td></tr>
|
||||
%endif
|
||||
%endfor
|
||||
%endif
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h1 style="clear:both;">${_(u'Delivery Order') } ${picking.name}</h1>
|
||||
|
||||
@@ -116,10 +116,19 @@ class PrintPick(report_sxw.rml_parse):
|
||||
return super(PrintPick, self).set_context(objects, data, ids, report_type=report_type)
|
||||
|
||||
class DeliverySlip(report_sxw.rml_parse):
|
||||
|
||||
def _get_invoice_address(self, partner_id):
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
partner = partner_obj.browse(self.cr, self.uid, partner_id)
|
||||
invoice_address_id = partner.address_get(adr_pref=['invoice'])['invoice']
|
||||
return partner_obj.browse(
|
||||
self.cr, self.uid, invoice_address_id)
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(DeliverySlip, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'invoice_address': self._get_invoice_address,
|
||||
})
|
||||
|
||||
report_sxw.report_sxw('report.webkit.aggregated_picking',
|
||||
|
||||
Reference in New Issue
Block a user