Skip to content

Commit

Permalink
[MIG] mrp_bom_location: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mymage committed Jan 17, 2023
1 parent 62d3f63 commit 97b2b21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 40 deletions.
2 changes: 1 addition & 1 deletion mrp_bom_location/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
48 changes: 9 additions & 39 deletions mrp_bom_location/views/report_mrpbomstructure.xml
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 97b2b21

Please sign in to comment.