192 lines
13 KiB
XML
192 lines
13 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- stock.picking.batch form view -->
|
|
<record model="ir.ui.view" id="stock_batch_picking_form">
|
|
<field name="name">stock.picking.batch.form</field>
|
|
<field name="model">stock.picking.batch</field>
|
|
<field name="priority" eval="10"/>
|
|
<field name="arch" type="xml">
|
|
<form string="Batch picking">
|
|
<header>
|
|
<field name="state" widget="statusbar"/>
|
|
<button name="action_assign" string="Reserve All" class="oe_highlight" type="object"
|
|
attrs="{'invisible': ['|',('use_oca_batch_validation', '!=', True),('state', '!=', 'draft')]}"/>
|
|
<button name="action_transfer" string="Validate" type="object"
|
|
attrs="{'invisible': ['|',('use_oca_batch_validation', '!=', True),('state', '!=', 'draft')]}"/>
|
|
<button name="action_transfer" string="Validate" class="oe_highlight" type="object"
|
|
attrs="{'invisible': ['|',('use_oca_batch_validation', '!=', True), ('state', 'not in', ['in_progress','assigned'])]}"/>
|
|
<button name="remove_undone_pickings" string="Remove Undone" type="object"
|
|
attrs="{'invisible': ['|',('active_picking_ids', '=', []),('use_oca_batch_validation', '!=', True)]}"
|
|
confirm="All undone pickings from this batch will be removed, are you sure?"/>
|
|
<button name="action_cancel" string="Cancel" type="object"
|
|
attrs="{'invisible': ['|',('use_oca_batch_validation', '!=', True),('state', 'not in', ['in_progress','draft','assigned'])]}"
|
|
confirm="All pickings from this batch will be cancelled, are you sure?"
|
|
/>
|
|
<button name="action_print_picking" string="Print" type="object" class="oe_highlight"
|
|
attrs="{'invisible': [('use_oca_batch_validation', '!=', True)]}"/>
|
|
<!-- Buutons to call Odoo default functional -->
|
|
<button name="confirm_picking" string="Confirm" type="object" class="oe_highlight"
|
|
attrs="{'invisible': ['|',('use_oca_batch_validation', '=', True),('state', '!=', 'draft')]}"/>
|
|
<button name="print_picking" string="Print" type="object" class="oe_highlight"
|
|
attrs="{'invisible': [('use_oca_batch_validation', '=', True)]}"/>
|
|
<button name="done" string="Done" type="object" class="oe_highlight"
|
|
attrs="{'invisible': ['|',('use_oca_batch_validation', '=', True), ('state', 'not in', ['in_progress','assigned'])]}"/>
|
|
<button name="cancel_picking" string="Cancel" type="object"
|
|
attrs="{'invisible': ['|',('use_oca_batch_validation', '=', True), ('state', 'in', ['draft','in_progress','assigned'])]}"
|
|
confirm="All pickings from this batch will be cancelled, are you sure?"
|
|
/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_button_box" name="button_box">
|
|
<button name="action_view_stock_picking"
|
|
class="oe_stat_button"
|
|
icon="fa-truck"
|
|
type="object">
|
|
<field string="Pickings" name="picking_count" widget="statinfo"/>
|
|
</button>
|
|
</div>
|
|
<div class="oe_title">
|
|
<div class="oe_edit_only">
|
|
<label for="name" string="Batch Name"/>
|
|
</div>
|
|
<h1>
|
|
<field name="name"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<field name="use_oca_batch_validation" invisible="1"/>
|
|
<field name="user_id"/>
|
|
<field name="date"/>
|
|
</group>
|
|
<notebook colspan="4">
|
|
<page string="Pickings">
|
|
<field name="active_picking_ids" invisible="True"/>
|
|
<button name="remove_undone_pickings" string="Remove Undone" type="object"
|
|
class="oe_link" attrs="{'invisible': [('active_picking_ids', '=', [])]}" confirm="All undone pickings from this batch will be removed, are you sure?"/>
|
|
<field name="picking_ids" widget="many2many" colspan="4" nolabel="1"
|
|
domain="[('state', 'not in', ('done', 'cancel'))]"/>
|
|
</page>
|
|
<page string="Operations">
|
|
<field name="id" invisible="1"/>
|
|
<field name="move_lines" readonly="1" options="{'reload_on_button': true}">
|
|
<tree decoration-danger="state != 'done' and quantity_done > reserved_availability and show_reserved_availability" decoration-muted="scrapped == True or state == 'cancel' or (state == 'done' and is_locked == True)" string="Stock Moves" editable="bottom">
|
|
<field name="name" invisible="1"/>
|
|
<field name="date_expected" invisible="1"/>
|
|
<field name="state" invisible="1" readonly="0"/>
|
|
<field name="picking_type_id" invisible="1"/>
|
|
<field name="location_id" invisible="1"/>
|
|
<field name="location_dest_id" invisible="1"/>
|
|
<field name="scrapped" invisible="1"/>
|
|
<field name="picking_code" invisible="1"/>
|
|
<field name="product_type" invisible="1"/>
|
|
<field name="show_details_visible" invisible="1"/>
|
|
<field name="show_reserved_availability" invisible="1"/>
|
|
<field name="additional" invisible="1"/>
|
|
<field name="has_move_lines" invisible="1"/>
|
|
<field name="is_locked" invisible="1"/>
|
|
<field name="product_id" required="1" attrs="{'readonly': ['|', '&', ('state', '!=', 'draft'), ('additional', '=', False), ('has_move_lines', '=', True)]}"/>
|
|
<field name="is_initial_demand_editable" invisible="1"/>
|
|
<field name="is_quantity_done_editable" invisible="1"/>
|
|
<field name="product_uom_qty" string="Initial Demand" attrs="{'readonly': [('is_initial_demand_editable', '=', False)]}"/>
|
|
<field name="reserved_availability" string="Reserved"/>
|
|
<field name="quantity_done" string="Done" attrs="{'readonly': [('is_quantity_done_editable', '=', False)]}"/>
|
|
<field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"/>
|
|
<button name="action_show_details" string="Register lots, packs, location" type="object" icon="fa-list" attrs="{'invisible': [('show_details_visible', '=', False)]}" options='{"warn": true}'/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
<page string="Detailed Operations">
|
|
<field name="move_line_ids" attrs="{'readonly': [('state', '=', 'done')]}">
|
|
<tree editable="bottom" create="false" delete="false" decoration-muted="(state == 'done' and is_locked == True)" decoration-danger="qty_done>product_uom_qty and state!='done'" decoration-success="qty_done==product_uom_qty and state!='done' and not result_package_id">
|
|
<field name="product_id" required="1" attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"/>
|
|
<field name="move_id" invisible="1"/>
|
|
<field name="product_uom_id" force_save="1" attrs="{'readonly': [('state', '!=', 'draft')]}" groups="uom.group_uom"/>
|
|
<field name="location_id" groups="stock.group_stock_multi_locations"/>
|
|
<field name="location_dest_id" groups="stock.group_stock_multi_locations"/>
|
|
<field name="package_id" groups="stock.group_tracking_lot" domain="[('location_id', '=', location_id)]"/>
|
|
<field name="result_package_id" groups="stock.group_tracking_lot" domain="['|', '|', ('location_id', '=', False), ('location_id', '=', location_dest_id), ('id', '=', package_id)]"/>
|
|
<field name="lots_visible" invisible="1"/>
|
|
<field name="owner_id" groups="stock.group_tracking_owner"/>
|
|
<field name="state" invisible="1"/>
|
|
<field name="lot_id" groups="stock.group_production_lot" attrs="{'invisible': [('lots_visible', '=', False)]}" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}"/>
|
|
<!-- <field name="lot_name" groups="stock.group_production_lot" attrs="{'column_invisible': [('parent.show_lots_text', '=', False)], 'invisible': [('lots_visible', '=', False)]}" context="{'default_product_id': product_id}"/>-->
|
|
<field name="is_initial_demand_editable" invisible="1"/>
|
|
<field name="product_uom_qty" readonly="1"/>
|
|
<field name="is_locked" invisible="1"/>
|
|
<field name="qty_done" attrs="{'readonly': [('state', 'in', ('done', 'cancel')), ('is_locked', '=', True)]}" force_save="1"/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
<page string='Notes'>
|
|
<field name='notes' colspan='4' nolabel='1'/>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids" widget="mail_followers"/>
|
|
<field name="activity_ids" widget="mail_activity"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- stock.picking.batch tree view -->
|
|
<record model="ir.ui.view" id="stock_batch_picking_tree">
|
|
<field name="name">stock.picking.batch.tree</field>
|
|
<field name="model">stock.picking.batch</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Batch Picking">
|
|
<field name="name"/>
|
|
<field name="user_id"/>
|
|
<field name="date"/>
|
|
<field name="state"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<record model="ir.actions.server" id="action_stock_batch_picking_assign_all">
|
|
<field name="name">Reserve All</field>
|
|
<field name="model_id" ref="stock_picking_batch.model_stock_picking_batch"/>
|
|
<field name="binding_model_id" ref="stock_picking_batch.model_stock_picking_batch"/>
|
|
<field name="state">code</field>
|
|
<field name="code">
|
|
batches = records.action_assign()
|
|
</field>
|
|
</record>
|
|
|
|
<!-- stock.picking.batch search view -->
|
|
<record id="stock_batch_picking_search" model="ir.ui.view">
|
|
<field name="name">batch.picking.search</field>
|
|
<field name="model">stock.picking.batch</field>
|
|
<field name="arch" type="xml">
|
|
<search>
|
|
<field name="name"/>
|
|
<field name="user_id"/>
|
|
<field name="state"/>
|
|
<field name="date"/>
|
|
<group expand="0" string="Group By...">
|
|
<filter name="user_id" string="Picker" context="{'group_by':'user_id'}"/>
|
|
<filter name="state" string="State" context="{'group_by':'state'}"/>
|
|
<filter name="date" string="Order Date" context="{'group_by':'date'}"/>
|
|
</group>
|
|
<filter name="no_user_id" string="Unassigned" domain="[('user_id','=', False)]"/>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_stock_batch_picking_tree"
|
|
model="ir.actions.act_window">
|
|
<field name="name">Batch Picking</field>
|
|
<field name="res_model">stock.picking.batch</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="view_id" ref="stock_batch_picking_tree"/>
|
|
<field name="search_view_id" ref="stock_batch_picking_search"/>
|
|
</record>
|
|
|
|
<!-- stock.picking.batch menuitem in Inventory main menu -->
|
|
<menuitem action='action_stock_batch_picking_tree'
|
|
parent='stock.menu_stock_root'
|
|
id='stock_picking_batch.stock_picking_batch_menu'
|
|
sequence='3'/>
|
|
</odoo>
|