采购入库时,新增打印序列号方法
This commit is contained in:
@@ -13,20 +13,23 @@ class StockMoveLine(models.Model):
|
||||
picking_location_dest_id = fields.Many2one(related='picking_id.location_dest_id')
|
||||
product_stock_quant_ids = fields.One2many('stock.quant', compute='_compute_product_stock_quant_ids')
|
||||
product_packaging_id = fields.Many2one(related='move_id.product_packaging_id')
|
||||
product_packaging_uom_qty = fields.Float('Packaging Quantity', compute='_compute_product_packaging_uom_qty', help="Quantity of the Packaging in the UoM of the Stock Move Line.")
|
||||
product_packaging_uom_qty = fields.Float('Packaging Quantity', compute='_compute_product_packaging_uom_qty',
|
||||
help="Quantity of the Packaging in the UoM of the Stock Move Line.")
|
||||
is_completed = fields.Boolean(compute='_compute_is_completed', help="Check if the quantity done matches the demand")
|
||||
|
||||
@api.depends('product_id', 'product_id.stock_quant_ids')
|
||||
def _compute_product_stock_quant_ids(self):
|
||||
for line in self:
|
||||
line.product_stock_quant_ids = line.product_id.stock_quant_ids.filtered(lambda q: q.company_id in self.env.companies and q.location_id.usage == 'internal')
|
||||
line.product_stock_quant_ids = line.product_id.stock_quant_ids.filtered(
|
||||
lambda q: q.company_id in self.env.companies and q.location_id.usage == 'internal')
|
||||
|
||||
def _compute_dummy_id(self):
|
||||
self.dummy_id = ''
|
||||
|
||||
def _compute_product_packaging_uom_qty(self):
|
||||
for sml in self:
|
||||
sml.product_packaging_uom_qty = sml.product_packaging_id.product_uom_id._compute_quantity(sml.product_packaging_id.qty, sml.product_uom_id)
|
||||
sml.product_packaging_uom_qty = sml.product_packaging_id.product_uom_id._compute_quantity(
|
||||
sml.product_packaging_id.qty, sml.product_uom_id)
|
||||
|
||||
@api.depends('qty_done')
|
||||
def _compute_is_completed(self):
|
||||
|
||||
@@ -1,201 +1,236 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_stock_move_line_detailed_operation_tree_inherit_quality" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.operations.tree.inherit</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_uom_id']" position="after">
|
||||
<field name="check_state" invisible="1"/>
|
||||
<button type="object" class="btn-info" name="action_open_quality_check_wizard" icon="fa-check"
|
||||
attrs="{'invisible': [('check_state', '!=', 'in_progress')]}" title="Quality Check"/>
|
||||
<button type="object" class="btn-danger" name="action_open_quality_check_wizard" icon="fa-check"
|
||||
attrs="{'invisible': [('check_state', '!=', 'fail')]}" title="Quality Check"/>
|
||||
<button type="object" class="btn-success" name="action_open_quality_check_wizard" icon="fa-check"
|
||||
attrs="{'invisible': [('check_state', '!=', 'pass')]}" title="Quality Check"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_move_line_product_selector" model="ir.ui.view">
|
||||
<field name="name">stock.product.selector</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select a Product" class="o_barcode_line_form flex-column">
|
||||
<div class="row mt-4 mb-4">
|
||||
<field name="company_id" force_save="1" invisible="1"/>
|
||||
<field name="reserved_uom_qty" invisible="1" />
|
||||
<field name="move_id" invisible="1" />
|
||||
<field name="state" invisible="1" />
|
||||
<field name="tracking" invisible="1" />
|
||||
<field name="product_uom_category_id" invisible="1" />
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<record id="stock_move_line_product_selector" model="ir.ui.view">
|
||||
<field name="name">stock.product.selector</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select a Product" class="o_barcode_line_form flex-column">
|
||||
<div class="row mt-4 mb-4">
|
||||
<field name="company_id" force_save="1" invisible="1"/>
|
||||
<field name="reserved_uom_qty" invisible="1"/>
|
||||
<field name="move_id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
<field name="location_dest_id" invisible="1"/>
|
||||
<div class="col-12 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-tags me-3" title="Product"/>
|
||||
<field name="product_id" placeholder="Product"
|
||||
context="{'default_detailed_type': 'product'}"
|
||||
attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"
|
||||
domain="[('type', 'in', ['product', 'consu']), '|', ('company_id', '=', False), ('company_id', '=', company_id)]"
|
||||
required="1" nolabel="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-cube me-3" title="Quantity"/>
|
||||
<field name="is_completed" invisible="1"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_completed"
|
||||
attrs="{'invisible': [('is_completed', '=', False)]}" options="{'type': 'number'}"
|
||||
placeholder="Quantity"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_not_completed"
|
||||
attrs="{'invisible':[('is_completed', '!=', False)]}" options="{'type': 'number'}"
|
||||
placeholder="Quantity"/>
|
||||
<field name="reserved_uom_qty" widget="set_reserved_qty_button" field_to_set="qty_done"
|
||||
attrs="{'invisible': [('reserved_uom_qty', '=', 0)]}"/>
|
||||
</div>
|
||||
<div class="col-6 my-2 d-flex align-items-baseline" groups="uom.group_uom"
|
||||
attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<i class="fa me-3" attrs="{'invisible': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
<field name="product_uom_id" placeholder="Unit of Measure"
|
||||
options="{'no_open': True}"
|
||||
attrs="{'readonly': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center justify-content-md-start">
|
||||
<div class="col-12 col-sm-10 col-md-8 my-2 ms-md-5 align-items-baseline"
|
||||
attrs="{'invisible': [('tracking', '=', 'serial')]}">
|
||||
<widget name="digipad" quantity_field="qty_done"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_stock_multi_locations">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline"
|
||||
attrs="{'invisible': [('picking_code', '=', 'incoming')]}">
|
||||
<i class="fa fa-fw fa-lg fa-map-marker text-center me-3" title="Source Location"/>
|
||||
<field name="location_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline"
|
||||
attrs="{'invisible': [('picking_code', '=', 'outgoing')]}">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Location"/>
|
||||
<field name="location_dest_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_dest_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-archive me-3" title="Source Package"/>
|
||||
<field name="package_id" placeholder="Source Package"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Package"/>
|
||||
<field name="result_package_id" placeholder="Destination Package"
|
||||
context="{'picking_id': picking_id}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_owner">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-user-o text-center me-3" title="Owner"/>
|
||||
<field name="owner_id" placeholder="Owner"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
<field name="location_dest_id" invisible="1"/>
|
||||
<div class="col-12 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-tags me-3" title="Product"/>
|
||||
<field name="product_id" placeholder="Product"
|
||||
context="{'default_detailed_type': 'product'}"
|
||||
attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"
|
||||
domain="[('type', 'in', ['product', 'consu']), '|', ('company_id', '=', False), ('company_id', '=', company_id)]"
|
||||
required="1" nolabel="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-cube me-3" title="Quantity"/>
|
||||
<field name="is_completed" invisible="1"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_completed" attrs="{'invisible': [('is_completed', '=', False)]}" options="{'type': 'number'}" placeholder="Quantity"/>
|
||||
<field name="qty_done" class="w-100 w-md-50 text-end o_qty_done_field_not_completed" attrs="{'invisible':[('is_completed', '!=', False)]}" options="{'type': 'number'}" placeholder="Quantity"/>
|
||||
<field name="reserved_uom_qty" widget="set_reserved_qty_button" field_to_set="qty_done" attrs="{'invisible': [('reserved_uom_qty', '=', 0)]}"/>
|
||||
</div>
|
||||
<div class="col-6 my-2 d-flex align-items-baseline" groups="uom.group_uom"
|
||||
attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<i class="fa me-3" attrs="{'invisible': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
<field name="product_uom_id" placeholder="Unit of Measure"
|
||||
options="{'no_open': True}"
|
||||
attrs="{'readonly': [('reserved_uom_qty', '!=', 0.0)]}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center justify-content-md-start">
|
||||
<div class="col-12 col-sm-10 col-md-8 my-2 ms-md-5 align-items-baseline"
|
||||
attrs="{'invisible': [('tracking', '=', 'serial')]}">
|
||||
<widget name="digipad" quantity_field="qty_done"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_stock_multi_locations">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline"
|
||||
attrs="{'invisible': [('picking_code', '=', 'incoming')]}">
|
||||
<i class="fa fa-fw fa-lg fa-map-marker text-center me-3" title="Source Location"/>
|
||||
<field name="location_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline" attrs="{'invisible': [('picking_code', '=', 'outgoing')]}">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Location"/>
|
||||
<field name="location_dest_id" placeholder="Source Location"
|
||||
domain="[('id', 'child_of', picking_location_dest_id)]"
|
||||
options="{'no_create': True}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-archive me-3" title="Source Package"/>
|
||||
<field name="package_id" placeholder="Source Package"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-long-arrow-right me-3" title="Destination Package"/>
|
||||
<field name="result_package_id" placeholder="Destination Package"
|
||||
context="{'picking_id': picking_id}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" groups="stock.group_tracking_owner">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-user-o text-center me-3" title="Owner"/>
|
||||
<field name="owner_id" placeholder="Owner"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<field name="tracking" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="picking_type_use_create_lots" invisible="1"/>
|
||||
<field name="picking_type_use_existing_lots" invisible="1"/>
|
||||
<field name="picking_location_id" invisible="1"/>
|
||||
<field name="picking_location_dest_id" invisible="1"/>
|
||||
<div class="row" groups="stock.group_production_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-barcode me-3" title="Serial/Lot Number" attrs="{'invisible': [('tracking', 'not in', ['serial', 'lot'])]}"/>
|
||||
<field name="lot_name" placeholder="Serial/Lot Number"
|
||||
attrs="{'invisible': ['|', '|', ('tracking', '=', 'none'), ('picking_type_use_create_lots', '=', False), ('picking_type_use_existing_lots', '=', True)]}"
|
||||
<field name="picking_type_use_create_lots" invisible="1"/>
|
||||
<field name="picking_type_use_existing_lots" invisible="1"/>
|
||||
<field name="picking_location_id" invisible="1"/>
|
||||
<field name="picking_location_dest_id" invisible="1"/>
|
||||
<div class="row" groups="stock.group_production_lot">
|
||||
<div class="col-12 col-md-6 my-2 d-flex align-items-baseline">
|
||||
<i class="fa fa-fw fa-lg fa-barcode me-3" title="Serial/Lot Number"
|
||||
attrs="{'invisible': [('tracking', 'not in', ['serial', 'lot'])]}"/>
|
||||
<field name="lot_name" placeholder="Serial/Lot Number"
|
||||
attrs="{'invisible': ['|', '|', ('tracking', '=', 'none'), ('picking_type_use_create_lots', '=', False), ('picking_type_use_existing_lots', '=', True)]}"
|
||||
/>
|
||||
<field name="lot_id" placeholder="Serial/Lot Number" options="{'no_open': True}"
|
||||
context="{'default_product_id': product_id, 'default_company_id': company_id}"
|
||||
attrs="{'invisible': ['|', ('tracking', '=', 'none'), ('picking_type_use_existing_lots', '=', False)]}"
|
||||
<field name="lot_id" placeholder="Serial/Lot Number" options="{'no_open': True}"
|
||||
context="{'default_product_id': product_id, 'default_company_id': company_id}"
|
||||
attrs="{'invisible': ['|', ('tracking', '=', 'none'), ('picking_type_use_existing_lots', '=', False)]}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-long">
|
||||
<div class="col-12 my-2 d-flex">
|
||||
<i class="fa fa-fw fa-lg fa-cubes me-3" title="Locations"/>
|
||||
<field name="product_stock_quant_ids" context="{'kanban_view_ref': 'stock_barcode.stock_quant_barcode_kanban_2', 'tree_view_ref': 'stock_barcode.view_stock_quant_tree'}"/>
|
||||
<div class="row row-long">
|
||||
<div class="col-12 my-2 d-flex">
|
||||
<i class="fa fa-fw fa-lg fa-cubes me-3" title="Locations"/>
|
||||
<field name="product_stock_quant_ids"
|
||||
context="{'kanban_view_ref': 'stock_barcode.stock_quant_barcode_kanban_2', 'tree_view_ref': 'stock_barcode.view_stock_quant_tree'}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fixed-bottom">
|
||||
<div class="o_barcode_control d-flex">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
<div class="fixed-bottom">
|
||||
<div class="o_barcode_control d-flex">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
</div>
|
||||
<div class="o_barcode_control d-flex" attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<button string="Delete" class="btn btn-danger text-uppercase o_delete"
|
||||
name="unlink" type="object">
|
||||
<i class="fa fa-trash-o"/>
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_barcode_control d-flex" attrs="{'invisible': [('reserved_uom_qty', '!=', 0)]}">
|
||||
<button string="Delete" class="btn btn-danger text-uppercase o_delete"
|
||||
name="unlink" type="object">
|
||||
<i class="fa fa-trash-o"/> Delete
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_quant_barcode_kanban" model="ir.ui.view">
|
||||
<field name="name">stock.barcode.quant.kanban</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban draggable="0">
|
||||
<field name="product_id"/>
|
||||
<field name="quantity"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div>
|
||||
<strong><field name="product_id"/></strong>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="lot_id" groups="stock.group_production_lot"/>
|
||||
<field name="quantity" string="Quantity Done"/>
|
||||
<field name="product_uom_id" string="Unit of Measure" groups="uom.group_uom"/>
|
||||
<record id="stock_quant_barcode_kanban" model="ir.ui.view">
|
||||
<field name="name">stock.barcode.quant.kanban</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban draggable="0">
|
||||
<field name="product_id"/>
|
||||
<field name="quantity"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div>
|
||||
<strong>
|
||||
<field name="product_id"/>
|
||||
</strong>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="lot_id" groups="stock.group_production_lot"/>
|
||||
<field name="quantity" string="Quantity Done"/>
|
||||
<field name="product_uom_id" string="Unit of Measure" groups="uom.group_uom"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_quant_barcode_kanban_2" model="ir.ui.view">
|
||||
<field name="name">stock.quant.kanban.barcode</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div class="mb4">
|
||||
<strong><field name="location_id"/></strong>
|
||||
<record id="stock_quant_barcode_kanban_2" model="ir.ui.view">
|
||||
<field name="name">stock.quant.kanban.barcode</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div class="mb4">
|
||||
<strong>
|
||||
<field name="location_id"/>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="mb4">
|
||||
<field name="quantity"/>
|
||||
<field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<span class="ms-4" attrs="{'invisible': [('lot_id', '=', False)]}"
|
||||
groups="stock.group_production_lot">
|
||||
<field name="lot_id"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('package_id', '=', False)]}"
|
||||
groups="stock.group_tracking_lot">
|
||||
<i class="fa fa-lg fa-archive" title="Package"/>
|
||||
<field name="package_id"/>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('owner_id', '=', False)]}"
|
||||
groups="stock.group_tracking_owner">
|
||||
<i class="fa fa-lg fa-user-o" title="Owner"/>
|
||||
<field name="owner_id"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb4">
|
||||
<field name="quantity"/> <field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<span class="ms-4" attrs="{'invisible': [('lot_id', '=', False)]}" groups="stock.group_production_lot">
|
||||
<field name="lot_id"/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('package_id', '=', False)]}" groups="stock.group_tracking_lot">
|
||||
<i class="fa fa-lg fa-archive" title="Package"/><field name="package_id"/>
|
||||
</div>
|
||||
<div class="mb4" attrs="{'invisible': [('owner_id', '=', False)]}" groups="stock.group_tracking_owner">
|
||||
<i class="fa fa-lg fa-user-o" title="Owner"/><field name="owner_id"/>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_quant_tree" model="ir.ui.view">
|
||||
<field name="name">stock_barcode.quant.tree.inherit</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_uom_id']" position="attributes" >
|
||||
<attribute name="string">UoM</attribute>
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='available_quantity']" position="attributes" >
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="attributes" >
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_stock_quant_tree" model="ir.ui.view">
|
||||
<field name="name">stock_barcode.quant.tree.inherit</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_uom_id']" position="attributes">
|
||||
<attribute name="string">UoM</attribute>
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='available_quantity']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -1,181 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo><data>
|
||||
<record id="view_stock_move_line_detailed_operation_tree_inherit_stock_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.operations.tree.inherit</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="inside">
|
||||
<field name="product_barcode" invisible="1"/>
|
||||
<field name="location_processed" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='qty_done']" position="attributes">
|
||||
<attribute name="options">{'barcode_events': True}</attribute>
|
||||
<attribute name="widget">field_float_scannable</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_stock_move_line_kanban_inherited" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.kanban.inherited</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='qty_done']" position="after">
|
||||
<field name="product_barcode" invisible="1"/>
|
||||
<field name="location_processed" invisible="1"/>
|
||||
<field name="result_package_id" invisible="1"/>
|
||||
<field name="lots_visible" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_move_line_kanban_inherited" model="ir.ui.view">
|
||||
<field name="name">stock.move.line.kanban.inherited</field>
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_move_line_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='qty_done']" position="after">
|
||||
<field name="product_barcode" invisible="1"/>
|
||||
<field name="location_processed" invisible="1"/>
|
||||
<field name="result_package_id" invisible="1"/>
|
||||
<field name="lots_visible" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_picking_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.form.view.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking Details">
|
||||
<field name="show_allocation" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<group>
|
||||
<button name="action_view_reception_report" string="Allocation" type="object"
|
||||
context="{'default_picking_ids': [id]}"
|
||||
class="btn btn-primary o_reception_report" icon="fa-list"
|
||||
attrs="{'invisible': [('show_allocation', '=', False)]}"
|
||||
groups="stock.group_reception_report"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="scheduled_date" readonly="1" attrs="{'invisible': [('scheduled_date', '=', False)]}"/>
|
||||
<field name="origin" readonly="1" attrs="{'invisible': [('origin', '=', False)]}"/>
|
||||
<field name="state" readonly="1" attrs="{'invisible': [('state', '=', False)]}"/>
|
||||
<field name="priority" readonly="1" attrs="{'invisible': [('priority', '=', False)]}"/>
|
||||
<field name="owner_id" readonly="1" attrs="{'invisible': [('owner_id', '=', False)]}" groups="stock.group_tracking_owner"/>
|
||||
<field name="company_id" readonly="1" groups="base.group_multi_company"/>
|
||||
<field name="move_ids" readonly="1" attrs="{'invisible': [('move_ids', '=', False)]}">
|
||||
<kanban>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<div class="row">
|
||||
<div class="col-6 o_kanban_record_title">
|
||||
<field name="product_id"/>
|
||||
<record id="stock_picking_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.form.view.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Picking Details">
|
||||
<field name="show_allocation" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<group>
|
||||
<button name="action_view_reception_report" string="Allocation" type="object"
|
||||
context="{'default_picking_ids': [id]}"
|
||||
class="btn btn-primary o_reception_report" icon="fa-list"
|
||||
attrs="{'invisible': [('show_allocation', '=', False)]}"
|
||||
groups="stock.group_reception_report"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="scheduled_date" readonly="1"
|
||||
attrs="{'invisible': [('scheduled_date', '=', False)]}"/>
|
||||
<field name="origin" readonly="1" attrs="{'invisible': [('origin', '=', False)]}"/>
|
||||
<field name="state" readonly="1" attrs="{'invisible': [('state', '=', False)]}"/>
|
||||
<field name="priority" readonly="1" attrs="{'invisible': [('priority', '=', False)]}"/>
|
||||
<field name="owner_id" readonly="1" attrs="{'invisible': [('owner_id', '=', False)]}"
|
||||
groups="stock.group_tracking_owner"/>
|
||||
<field name="company_id" readonly="1" groups="base.group_multi_company"/>
|
||||
<field name="move_ids" readonly="1" attrs="{'invisible': [('move_ids', '=', False)]}">
|
||||
<kanban>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<div class="row">
|
||||
<div class="col-6 o_kanban_record_title">
|
||||
<field name="product_id"/>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="product_uom_qty"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="product_uom_qty"/>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="description_picking"/>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="state"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<field name="description_picking"/>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<field name="state"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
<field name="note" readonly="1" attrs="{'invisible': [('note', '=', False)]}"/>
|
||||
</group>
|
||||
<div class="o_barcode_control d-flex fixed-bottom">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
<field name="note" readonly="1" attrs="{'invisible': [('note', '=', False)]}"/>
|
||||
</group>
|
||||
<div class="o_barcode_control d-flex fixed-bottom">
|
||||
<button string="Discard" class="btn btn-secondary o_discard" special="cancel"/>
|
||||
<button string="Confirm" class="btn btn-primary o_save" special="save"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_picking" model="ir.actions.act_window">
|
||||
<field name="name">Open picking form</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="context">{
|
||||
'res_id': active_id,
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
<record id="open_picking" model="ir.actions.act_window">
|
||||
<field name="name">Open picking form</field>
|
||||
<field name="res_model">stock.picking</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="context">{
|
||||
'res_id': active_id,
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="picking_view_kanban_inherit_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.view.kanban.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.stock_picking_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<record id="picking_view_kanban_inherit_barcode" model="ir.ui.view">
|
||||
<field name="name">stock.picking.view.kanban.barcode</field>
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.stock_picking_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<!-- Use the form view -->
|
||||
<xpath expr="//div[hasclass('o_kanban_record_headings')]" position="after">
|
||||
<button style="padding: 0px 10px;" class="btn btn-link fa fa-desktop" title="Open picking" name="action_open_picking" type="object"/>
|
||||
</xpath>
|
||||
<!-- Use the form view -->
|
||||
<xpath expr="//div[hasclass('o_kanban_record_headings')]" position="after">
|
||||
<button style="padding: 0px 10px;" class="btn btn-link fa fa-desktop" title="Open picking"
|
||||
name="action_open_picking" type="object"/>
|
||||
</xpath>
|
||||
|
||||
<!-- Use mobile view-->
|
||||
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="replace">
|
||||
<button style="padding: 0px 0px;" class="btn btn-link o_kanban_record_title" name="action_open_picking_client_action"
|
||||
type="object">
|
||||
<span><t t-esc="record.name.value"/></span>
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Use mobile view-->
|
||||
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="replace">
|
||||
<button style="padding: 0px 0px;" class="btn btn-link o_kanban_record_title"
|
||||
name="action_open_picking_client_action"
|
||||
type="object">
|
||||
<span>
|
||||
<t t-esc="record.name.value"/>
|
||||
</span>
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_type_form_inherit_stock_barcode" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='warehouse_id']" position="after">
|
||||
<field name="barcode"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_picking_type_form_inherit_stock_barcode" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='warehouse_id']" position="after">
|
||||
<field name="barcode"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="stock_barcode_view_picking_type_form" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet//group[@name='first']" position="before">
|
||||
<notebook>
|
||||
<page name="general" string="General">
|
||||
</page>
|
||||
<page name="barcode_app" string="Barcode App">
|
||||
<group name="restrict_scan_settings" string="Mandatory Scan">
|
||||
<field name="restrict_scan_source_location" string="Source Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'incoming')]}"/>
|
||||
<field name="restrict_scan_product" string="Product"/>
|
||||
<field name="restrict_scan_tracking_number" string="Lot/Serial"
|
||||
groups="stock.group_production_lot"/>
|
||||
<field name="restrict_put_in_pack"
|
||||
groups="stock.group_tracking_lot" string="Put in Pack"/>
|
||||
<field name="restrict_scan_dest_location" string="Destination Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'outgoing')]}"/>
|
||||
</group>
|
||||
<field name="show_barcode_validation" invisible="1"/>
|
||||
<group name="barcode_validation" string="Final Validation" attrs="{'invisible': [('show_barcode_validation', '=', False)]}">
|
||||
<!-- show_barcode_validation handles combined groups/invisible complexity -->
|
||||
<field name="barcode_validation_full"
|
||||
attrs="{'invisible': [('restrict_scan_product', '=', True)]}"/>
|
||||
<field name="barcode_validation_all_product_packed"
|
||||
groups="stock.group_tracking_lot"
|
||||
attrs="{'invisible': [('restrict_put_in_pack', '!=', 'optional')]}"/>
|
||||
<field name="barcode_validation_after_dest_location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': ['|',
|
||||
<record id="stock_barcode_view_picking_type_form" model="ir.ui.view">
|
||||
<field name="name">Operation Types</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet//group[@name='first']" position="before">
|
||||
<notebook>
|
||||
<page name="general" string="General">
|
||||
</page>
|
||||
<page name="barcode_app" string="Barcode App">
|
||||
<group name="restrict_scan_settings" string="Mandatory Scan">
|
||||
<field name="restrict_scan_source_location" string="Source Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'incoming')]}"/>
|
||||
<field name="restrict_scan_product" string="Product"/>
|
||||
<field name="restrict_scan_tracking_number" string="Lot/Serial"
|
||||
groups="stock.group_production_lot"/>
|
||||
<field name="restrict_put_in_pack"
|
||||
groups="stock.group_tracking_lot" string="Put in Pack"/>
|
||||
<field name="restrict_scan_dest_location" string="Destination Location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': [('code', '=', 'outgoing')]}"/>
|
||||
</group>
|
||||
<field name="show_barcode_validation" invisible="1"/>
|
||||
<group name="barcode_validation" string="Final Validation"
|
||||
attrs="{'invisible': [('show_barcode_validation', '=', False)]}">
|
||||
<!-- show_barcode_validation handles combined groups/invisible complexity -->
|
||||
<field name="barcode_validation_full"
|
||||
attrs="{'invisible': [('restrict_scan_product', '=', True)]}"/>
|
||||
<field name="barcode_validation_all_product_packed"
|
||||
groups="stock.group_tracking_lot"
|
||||
attrs="{'invisible': [('restrict_put_in_pack', '!=', 'optional')]}"/>
|
||||
<field name="barcode_validation_after_dest_location"
|
||||
groups="stock.group_stock_multi_locations"
|
||||
attrs="{'invisible': ['|',
|
||||
('code', '=', 'outgoing'),
|
||||
('restrict_scan_dest_location', '!=', 'optional'),
|
||||
]}"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='first']" position="move"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='second']" position="move"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data></odoo>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='first']" position="move"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='general']" position="inside">
|
||||
<xpath expr="//sheet//group[@name='second']" position="move"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user