[MIG] mrp_bom_location: Migration to 16.0

This commit is contained in:
Stefano Consolaro
2023-01-04 22:06:51 +01:00
parent 62d3f63f4f
commit 97b2b2177c
2 changed files with 10 additions and 40 deletions

View File

@@ -3,7 +3,7 @@
{
"name": "MRP BOM Location",
"summary": "Adds location field to Bill of Materials and its components.",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Manufacture",
"website": "https://github.com/OCA/manufacture",
"author": "ForgeFlow, Odoo Community Association (OCA)",

View File

@@ -1,58 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="report_mrpbomstructure_location" inherit_id="mrp.report_mrp_bom">
<xpath expr="//thead/tr/th[last()]" position="before">
<xpath expr="//thead/tr/th[1]" position="after">
<th
t-if="data['bom'].location_id"
class="o_mrp_bom_cost text-right"
title="Location of the product"
>Location</th>
</xpath>
<xpath expr="//tbody/tr/td[last()]" position="before">
<td t-if="data['bom'].location_id" class="text-right">
<span>
<a
href="#"
t-if="data['report_type'] == 'html'"
t-att-data-res-id="data['bom'].location_id.id"
t-att-data-model="'stock.location'"
class="o_mrp_bom_action"
>
<t t-esc="data['bom'].location_id.complete_name" />
</a>
<t t-else="" t-esc="data['bom'].location_id.complete_name" />
</span>
</td>
<xpath expr="//tbody/tr/td[1]" position="after">
<td class="text-end" t-esc="data['bom'].location_id.complete_name" />
</xpath>
</template>
<template id="report_mrp_bom_line" inherit_id="mrp.report_mrp_bom_line">
<xpath expr="//tr/td[last()]" position="before">
<td t-if="l.get('location_id', False)">
<span>
<a
href="#"
t-att-data-res-id="l['location_id'].id"
t-att-data-model="'stock.location'"
class="o_mrp_bom_action"
>
<t t-esc="l['location_id'].complete_name" />
</a>
</span>
</td>
<xpath expr="//td[@name='td_mrp_bom_f']" position="after">
<td t-if="data['bom'].location_id" />
</xpath>
<xpath
expr="//tr[hasclass('o_mrp_bom_report_line', 'o_mrp_bom_cost')]"
position="inside"
>
<td />
<xpath expr="//td[@name='td_mrp_bom_byproducts_f']" position="after">
<td t-if="data['bom'].location_id" />
</xpath>
</template>
<template id="report_mrp_bom_pdf_line" inherit_id="mrp.report_mrp_bom_pdf_line">
<xpath expr="//tr" position="inside">
<td t-if="l.get('location_name', False)" class="text-right">
<xpath expr="//td[1]" position="after">
<td t-if="data['bom'].location_id" class="text-right">
<span t-esc="l['location_name']" />
</td>
<td t-else="" />
</xpath>
</template>
</odoo>