[IMP] mrp, analytic: Add WIP report, optional columns in analytic line tree view

Adds a new WIP report to analytic line items and makes the Gross Margin list view more customisable by making the fields optional=show.

Task: 2479234 (nr 2)
Community PR: https://github.com/odoo/odoo/pull/114315
Enterprise PR: https://github.com/odoo/enterprise/pull/37764

Part-of: odoo/odoo#114315
This commit is contained in:
Pieter Claeys (clpi)
2023-05-25 16:28:54 +02:00
parent acbdb07c98
commit eb6aab7ad0
2 changed files with 78 additions and 0 deletions
+1
View File
@@ -25,6 +25,7 @@ If the automated inventory valuation is active, the necessary accounting entries
"views/mrp_bom_views.xml",
"views/mrp_production_views.xml",
"views/analytic_account_views.xml",
"report/report_mrp_templates.xml"
],
'demo': [
'data/mrp_account_demo.xml',
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="mrp_account.report_wip">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<div class="oe_structure"/>
<div class="row mt8">
<div class="col-lg-12">
<h2>
<span>WIP Report for <t t-out="docs.account_id.name"/></span>
</h2>
</div>
</div>
<div class="row mt8">
<div class="col-12">
<table class="table table-sm">
<thead>
<tr>
<th class="text-start align-middle"><span>Date</span></th>
<th class="text-start align-middle"><span>Ref.</span></th>
<th class="text-start align-middle"><span>Product</span></th>
<th class="text-start align-middle"><span>Quantity</span></th>
<th class="text-start align-middle"><span>Unit of Measure</span></th>
<th class="text-end"><span>Amount</span></th>
</tr>
</thead>
<tbody>
<tr t-foreach="docs" t-as="line" t-att-style="'background-color: #F1F1F1;' if line_index % 2 == 0 else ''">
<td class="align-middle">
<span t-field="line.date"/>
</td>
<td class="align-middle">
<span t-field="line.ref"/>
</td>
<td class="align-middle">
<span t-field="line.product_id"/>
</td>
<td class="align-middle">
<span t-field="line.unit_amount"/>
</td>
<td class="align-middle">
<span t-field="line.product_uom_id"/>
</td>
<td class="text-end align-middle">
<span t-field="line.amount"/>
</td>
</tr>
<tr>
<td class="text-end" t-attf-colspan="6">
<strong>
<span style="margin-right: 15px;">Total</span>
<t t-esc="sum(docs.mapped('amount'))"/>
</strong>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="oe_structure"/>
</div>
</t>
</t>
</template>
<record id="wip_report" model="ir.actions.report">
<field name="name">WIP report</field>
<field name="model">account.analytic.line</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">mrp_account.report_wip</field>
<field name="report_file">report_wip</field>
<field name="binding_model_id" ref="model_account_analytic_line"/>
<field name="binding_type">report</field>
</record>
</odoo>