summaryrefslogtreecommitdiff
path: root/addons/stock/views/stock_production_lot_views.xml
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/stock/views/stock_production_lot_views.xml
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/stock/views/stock_production_lot_views.xml')
-rw-r--r--addons/stock/views/stock_production_lot_views.xml99
1 files changed, 99 insertions, 0 deletions
diff --git a/addons/stock/views/stock_production_lot_views.xml b/addons/stock/views/stock_production_lot_views.xml
new file mode 100644
index 00000000..135132d2
--- /dev/null
+++ b/addons/stock/views/stock_production_lot_views.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="view_production_lot_form" model="ir.ui.view">
+ <field name="name">stock.production.lot.form</field>
+ <field name="model">stock.production.lot</field>
+ <field name="priority">10</field>
+ <field name="arch" type="xml">
+ <form string="Lots/Serial Numbers">
+ <sheet>
+ <field name="display_complete" invisible="1"/>
+ <div class="oe_button_box" name="button_box"
+ attrs="{'invisible': [('display_complete', '=', False)]}">
+ <button name="action_lot_open_quants" icon="fa-arrows" class="oe_stat_button" string="Location" type="object"/>
+ <button name="%(action_stock_report)d" icon="fa-arrow-up" class="oe_stat_button" string="Traceability" type="action"/>
+ </div>
+ <div class="oe_title">
+ <label for="name" class="oe_edit_only"/>
+ <h1>
+ <field name="name" placeholder="e.g. LOT/0001/20121"/>
+ </h1>
+ </div>
+ <group name="main_group">
+ <group>
+ <field name="product_id" context="{'default_type': 'product'}" readonly="context.get('set_product_readonly', False)" force_save="1" help="Product this lot/serial number contains. You cannot change it anymore if it has already been moved."/>
+ <label for="product_qty" attrs="{'invisible': [('display_complete', '=', False)]}"/>
+ <div class="o_row" attrs="{'invisible': [('display_complete', '=', False)]}">
+ <field name="product_qty"/>
+ <field name="product_uom_id" readonly="1" groups="uom.group_uom"/>
+ </div>
+ <field name="ref"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ </group>
+ <group></group>
+ </group>
+ <notebook attrs="{'invisible': [('display_complete', '=', False)]}">
+ <page string="Description" name="description">
+ <field name="note"/>
+ </page>
+ </notebook>
+ </sheet>
+ <div class="oe_chatter">
+ <field name="message_follower_ids"/>
+ <field name="activity_ids"/>
+ <field name="message_ids"/>
+ </div>
+ </form>
+ </field>
+ </record>
+
+ <record id="view_production_lot_tree" model="ir.ui.view">
+ <field name="name">stock.production.lot.tree</field>
+ <field name="model">stock.production.lot</field>
+ <field name="arch" type="xml">
+ <tree string="Lots/Serial Numbers" multi_edit="1">
+ <field name="name" decoration-bf="1"/>
+ <field name="ref" optional="show"/>
+ <field name="product_id" readonly="1"/>
+ <field name="create_date" optional="show"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ </tree>
+ </field>
+ </record>
+ <record model="ir.ui.view" id="search_product_lot_filter">
+ <field name="name">Production Lots Filter</field>
+ <field name="model">stock.production.lot</field>
+ <field name="arch" type="xml">
+ <search string="Product Lots Filter">
+ <field name="name" string="Lot/Serial Number" filter_domain="['|', ('name', 'ilike', self),('ref', 'ilike', self)]"/>
+ <field name="product_id"/>
+ <group expand="0" string="Group By">
+ <filter name="group_by_product" string="Product" domain="[]" context="{'group_by': 'product_id'}"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="action_production_lot_form" model="ir.actions.act_window">
+ <field name="name">Lots/Serial Numbers</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">stock.production.lot</field>
+ <field name="view_ids"
+ eval="[(5, 0, 0),
+ (0, 0, {'view_mode': 'tree', 'view_id': ref('view_production_lot_tree')}),
+ (0, 0, {'view_mode': 'form', 'view_id': ref('view_production_lot_form')})]"/>
+ <field name="search_view_id" ref="search_product_lot_filter"/>
+ <field name="context">{'search_default_group_by_product': 1, 'display_complete': True, 'default_company_id': allowed_company_ids[0]}</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Add a lot/serial number
+ </p><p>
+ Lots/Serial numbers help you tracking the path followed by your products.
+ From their traceability report you will see the full history of their use, as well as their composition.
+ </p>
+ </field>
+ </record>
+ <menuitem action="action_production_lot_form" id="menu_action_production_lot_form"
+ parent="menu_stock_inventory_control" groups="stock.group_production_lot"
+ sequence="101"/>
+</odoo>