[IMP]add rma line report

This commit is contained in:
aaron
2018-05-25 15:34:39 +02:00
committed by AaronHForgeFlow
parent 76ec2a2b5a
commit ec0e64c071
3 changed files with 114 additions and 0 deletions

View File

@@ -18,6 +18,8 @@
'data/rma_sequence.xml',
'data/stock_data.xml',
'data/rma_operation.xml',
'report/rma_report.xml',
'report/rma_report_templates.xml',
'views/rma_order_view.xml',
'views/rma_operation_view.xml',
'views/rma_order_line_view.xml',

13
rma/report/rma_report.xml Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<report
id="rma_order_line_report"
string="RMA"
model="rma.order.line"
report_type="qweb-pdf"
file="rma.report_rma_order_line"
name="rma.report_rma_order_line"
/>
</data>
</odoo>

View File

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_rma_order_line_document">
<t t-call="report.external_layout">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})" />
<div class="page">
<div class="oe_structure"/>
<div class="row">
<div class="col-xs-6">
<t t-if="(doc.customer_to_supplier==False and doc.type=='customer') or (doc.supplier_to_customer==False and doc.type=='supplier')">
<strong>Shipping address:</strong>
<div class="mt8">
<div t-field="doc.in_warehouse_id.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True}'/>
<p t-if="doc.in_warehouse_id.partner_id.vat">VAT: <span t-field="doc.in_warehouse_id.partner_id.vat"/></p>
</div>
</t>
<div t-if="doc.customer_to_supplier and doc.type=='customer'" class="mt8">
<strong>Shipping address:</strong>
<div t-field="doc.supplier_address_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True}'/>
<p t-if="doc.supplier_address_id.vat">VAT: <span t-field="doc.supplier_address_id.vat"/></p>
</div>
<div t-if="doc.supplier_to_customer and doc.type=='supplier'" class="mt8">
<strong>Shipping address:</strong>
<div t-field="doc.customer_address_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True}'/>
<p t-if="doc.customer_address_id.vat">VAT: <span t-field="doc.customer_address_id.vat"/></p>
</div>
</div>
<div class="col-xs-3 col-xs-offset-1">
<strong t-if="doc.type=='customer'">Customer:</strong>
<strong t-if="doc.type=='supplier'">Supplier:</strong>
<div t-field="doc.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' />
</div>
</div>
<h2>
<span t-field="doc.name"/>
</h2>
<div class="row mt32 mb32" id="informations">
<div t-if="doc.origin" class="col-xs-3">
<strong>Origin Reference:</strong>
<p t-field="doc.origin"/>
</div>
<div t-if="doc.create_date" class="col-xs-3">
<strong>Date Ordered:</strong>
<p t-field="doc.create_date"/>
</div>
<div t-if="doc.requested_by.name" class="col-xs-3">
<strong>Contact Person:</strong>
<p t-field="doc.requested_by.name"/>
</div>
<div name="operation_id" t-if="doc.operation_id" class="col-xs-3">
<strong>Operation:</strong>
<p t-field="doc.operation_id.name"/>
</div>
</div>
<table class="table table-condensed">
<thead>
<tr>
<th>Product</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
</tr>
</thead>
<tbody>
<tr>
<td><span t-field="doc.product_id"/></td>
<td class="text-right">
<span t-field="doc.product_qty"/>
<span t-field="doc.uom_id" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="doc.price_unit"/>
</td>
</tr>
</tbody>
</table>
<div t-if="doc.type=='supplier' and doc.description">
<strong><p>Description</p></strong>
<span t-field="doc.description"></span>
</div>
</div>
</t>
</template>
<template id="report_rma_order_line">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="rma.report_rma_order_line_document" t-lang="doc.partner_id.lang"/>
</t>
</t>
</template>
</odoo>