add website_decimal_quantity
This commit is contained in:
parent
0323b6672e
commit
9d69e5f095
67 changed files with 1858 additions and 0 deletions
13
website_decimal_quantity/views/uom_category_views.xml
Normal file
13
website_decimal_quantity/views/uom_category_views.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="uom_category_form_view_inherit" model="ir.ui.view">
|
||||
<field name="name">uom.category.form.inherit</field>
|
||||
<field name="model">uom.category</field>
|
||||
<field name="inherit_id" ref="uom.product_uom_categ_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="allow_decimal_quantity"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
32
website_decimal_quantity/views/website_sale_templates.xml
Normal file
32
website_decimal_quantity/views/website_sale_templates.xml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- This template replaces the default quantity selector with a text input field
|
||||
that allows for decimal values. -->
|
||||
<template id="product_quantity" inherit_id="website_sale.product_quantity" name="Product Quantity Decimal Support">
|
||||
<xpath expr="//input[@name='add_qty']" position="attributes">
|
||||
<attribute name="t-att-data-allow-decimal">product.uom_id.category_id.allow_decimal_quantity and 'true' or 'false'</attribute>
|
||||
<attribute name="t-att-data-min">product.uom_id.category_id.allow_decimal_quantity and '0.1' or '1'</attribute>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="cart_lines_decimal" inherit_id="website_sale.cart_lines" name="Cart Lines Decimal Support">
|
||||
<xpath expr="//input[hasclass('js_quantity','form-control','quantity')]" position="attributes">
|
||||
<attribute name="t-att-data-allow-decimal">line.product_uom.category_id.allow_decimal_quantity and 'true' or 'false'</attribute>
|
||||
<attribute name="t-att-data-min">line.product_uom.category_id.allow_decimal_quantity and '0.1' or '1'</attribute>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- This template replaces the default cart popover button with a button that
|
||||
displays the total number of items in the cart with one decimal point precision. -->
|
||||
<template id="cart_popover_decimal" inherit_id="website_sale.cart_popover"
|
||||
name="Cart Popover">
|
||||
<xpath expr="//a[hasclass('btn-primary')]" position="replace">
|
||||
<a role="button" class="btn btn-primary" href="/shop/cart">
|
||||
View Cart (
|
||||
<span class="o_wsale_cart_quantity"
|
||||
t-esc="round(sum(website_sale_order.mapped('website_order_line.product_uom_qty')), 1)"/>
|
||||
item(s))
|
||||
</a>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue