mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Do not allow (or manually correct) the Serial number selected by the user.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
],
|
||||
'data': [
|
||||
'templates/assets.xml',
|
||||
'views/pos_views.xml',
|
||||
],
|
||||
'qweb': [
|
||||
'static/src/xml/pos.xml'
|
||||
|
||||
@@ -128,11 +128,21 @@ odoo.define("pos_product_catch_weight.models", function (require) {
|
||||
},
|
||||
|
||||
set_lot_name: function(name){
|
||||
this.set({
|
||||
/*
|
||||
If you want to allow selling unknown lots:
|
||||
{
|
||||
lot_name : _.str.trim(name) || null,
|
||||
lot_catch_weight_ratio : 1.0,
|
||||
lot_catch_weight : 1.0,
|
||||
lot_catch_weight_uom_id : null,
|
||||
}
|
||||
*/
|
||||
|
||||
this.set({
|
||||
lot_name : _.str.trim(name) || null,
|
||||
lot_catch_weight_ratio : 9999.0,
|
||||
lot_catch_weight : 9999.0,
|
||||
lot_catch_weight_uom_id : [0, 'INVALID'],
|
||||
});
|
||||
},
|
||||
})
|
||||
|
||||
@@ -37,4 +37,19 @@
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<t t-extend="PosTicket">
|
||||
<t t-jquery=".receipt-orderlines tr td:nth-child(1)" t-operation="append">
|
||||
<br/>
|
||||
<t t-set="lots" t-value="orderline.pack_lot_lines.get_valid_lots()"/>
|
||||
<t t-if="lots" t-foreach="lots" t-as="lot">
|
||||
-- <t t-esc="lot.get_lot_name()"/>
|
||||
<t t-if="lot.get('lot_catch_weight_uom_id')">
|
||||
@ <t t-esc="lot.get('lot_catch_weight')"/>
|
||||
<t t-esc="lot.get('lot_catch_weight_uom_id')[1]"/>
|
||||
</t>
|
||||
<br/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
|
||||
38
pos_product_catch_weight/views/pos_views.xml
Normal file
38
pos_product_catch_weight/views/pos_views.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_pos_order_line_form_inherit" model="ir.ui.view">
|
||||
<field name="name">pos.order.line.form.inherit</field>
|
||||
<field name="model">pos.order.line</field>
|
||||
<field name="inherit_id" ref="point_of_sale.view_pos_order_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group" position="after">
|
||||
<group col="4">
|
||||
<field name="pack_lot_ids" colspan="4">
|
||||
<tree>
|
||||
<field name="lot_name"/>
|
||||
<field name="lot_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_pos_pos_form_inherit" model="ir.ui.view">
|
||||
<field name="name">pos.order.form.inherit</field>
|
||||
<field name="model">pos.order</field>
|
||||
<field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='lines']/form/group" position="after">
|
||||
<group col="4">
|
||||
<field name="pack_lot_ids" colspan="4">
|
||||
<tree>
|
||||
<field name="lot_name"/>
|
||||
<field name="lot_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user