[MIG] bemade_hide_decimal_on_unit to 18.0

This commit is contained in:
Marc Durepos 2025-09-10 09:47:18 -04:00
parent 7f62a24819
commit 289e8f3731
4 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# from . import models

View file

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
{
"name": "Hide Decimal on unit",
"version": "18.0.0.1.1",
"category": "Extra Tools",
"summary": "Hide decimal on Qty when there is no decimal",
"description": """
Hide decimal on Qty when there is no decimal
""",
"author": "Bemade",
"website": "https://www.bemade.org",
"depends": ["sale", "purchase"],
"data": ["views/sale.xml", "views/purchase.xml"],
"auto_install": False,
"installable": True,
"license": "OPL-1",
}

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_purchasequotation_document_strip_decimal" inherit_id="purchase.report_purchasequotation_document">
<xpath expr="//tbody//td[hasclass('text-end')]" position="replace">
<td name="td_quantity" class="text-end">
<t t-if="int(order_line.product_uom_qty) == order_line.product_uom_qty">
<span t-esc="'%.0f' % order_line.product_uom_qty"/>
</t>
<t t-else="">
<span t-esc="order_line.product_uom_qty"/>
</t>
<span t-field="order_line.product_uom" groups="uom.group_uom"/>
</td>
</xpath>
</template>
<template id="report_purchaseorder_document_strip_decimal" inherit_id="purchase.report_purchaseorder_document">
<xpath expr="//tbody//td[hasclass('text-end')][1]" position="replace">
<td name="td_quantity" class="text-end">
<t t-if="int(line.product_uom_qty) == line.product_uom_qty">
<span t-esc="'%.0f' % line.product_uom_qty"/>
</t>
<t t-else="">
<span t-esc="line.product_uom_qty"/>
</t>
<span t-field="line.product_uom" groups="uom.group_uom"/>
</td>
</xpath>
</template>
</odoo>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_saleorder_document_strip_decimal" inherit_id="sale.report_saleorder_document">
<td name="td_quantity" position="replace">
<td name="td_quantity" class="text-right">
<t t-if="int(line.product_uom_qty) == line.product_uom_qty">
<span t-esc="'%.0f' % line.product_uom_qty"/>
</t>
<t t-else="">
<span t-esc="line.product_uom_qty"/>
</t>
<span t-field="line.product_uom"/>
</td>
</td>
</template>
</odoo>