[MIG] bemade_hide_decimal_on_unit to 18.0
This commit is contained in:
parent
7f62a24819
commit
289e8f3731
4 changed files with 69 additions and 0 deletions
5
bemade_hide_decimal_on_unit/__init__.py
Normal file
5
bemade_hide_decimal_on_unit/__init__.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# from . import models
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
17
bemade_hide_decimal_on_unit/__manifest__.py
Normal file
17
bemade_hide_decimal_on_unit/__manifest__.py
Normal 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",
|
||||||
|
}
|
||||||
31
bemade_hide_decimal_on_unit/views/purchase.xml
Normal file
31
bemade_hide_decimal_on_unit/views/purchase.xml
Normal 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>
|
||||||
16
bemade_hide_decimal_on_unit/views/sale.xml
Normal file
16
bemade_hide_decimal_on_unit/views/sale.xml
Normal 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>
|
||||||
Loading…
Reference in a new issue