货架货位对象拆分

This commit is contained in:
mgw
2024-02-20 17:35:31 +08:00
parent efdde5aef0
commit 6103bca698
4 changed files with 201 additions and 157 deletions

View File

@@ -11,7 +11,6 @@
</xpath>
<xpath expr="//field[@name='location_dest_id'][2]" position="after">
<field name="destination_location_id" domain="[
('location_type', '=', '货位'),
('location_id', '=', location_dest_id_value),
('location_status', '=', '空闲')
]"/>

View File

@@ -1,14 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- 货架视图 -->
<record id="view_sf_shelf" model="ir.ui.view">
<field name="name">Sf Shelf</field>
<field name="model">sf.shelf</field>
<field name="arch" type="xml">
<form string="Sf Shelf">
<header>
<button string="生成货位" name="create_location" type="object" class="oe_highlight"/>
</header>
<sheet>
<group>
<field name="barcode" string="货架编码"/>
<field name="name" string="货架名称"/>
<field name="check_state" string="审核状态"/>
<field name="channel" string="通道"/>
<field name="shelf_location_id" string="所属库区"/>
<field name="direction" string="方向"/>
<field name="shelf_height" string="货架高度(m)"/>
<field name="shelf_layer" string="货架层数"/>
<field name="layer_capacity" string="层数容量"/>
</group>
<field name="location_ids" widget="one2many_list">
<tree string="Shelf Location">
<field name="barcode" string="编码"/>
<field name="name" string="名称"/>
</tree>
</field>
</sheet>
</form>
</field>
</record>
<record id="view_sf_shelf_tree" model="ir.ui.view">
<field name="name">Sf Shelf tree</field>
<field name="model">sf.shelf</field>
<field name="arch" type="xml">
<tree string="Sf Shelf">
<field name="barcode" string="货架编码"/>
<field name="name" string="名称"/>
<field name="shelf_location_id" string="所属库区"/>
</tree>
</field>
</record>
<!-- 货架action -->
<record id="sf_shelf_action" model="ir.actions.act_window">
<field name="name">货架</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.shelf</field>
<field name="view_mode">tree,form</field>
<!-- <field name="view_id" ref="view_sf_shelf_tree"/> -->
</record>
<!-- 货架菜单 -->
<menuitem
id="sf_shelf_menu"
name="货架"
parent="stock.menu_warehouse_config"
sequence="19"
action="sf_shelf_action"
groups="sf_warehouse.group_sf_stock_user"/>
<record id="view_shelf_location_tree" model="ir.ui.view">
<field name="name">Shelf Location tree</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<tree string="Shelf Location">
<field name="name" string="名称"/>
<field name="barcode" string="编码"/>
<field name="location_type"/>
<field name="barcode"/>
<field name="name"/>
<field name="location_id"/>
<!-- <field name="check_state" widget="label_selection"-->
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
<!-- <button name="action_check" string="审核" type="object"-->
@@ -56,20 +119,10 @@
<header>
<field name="location_status" invisible="1"/>
<button string="生成货位" name="create_location" type="object" class="oe_highlight"
attrs="{'invisible': [('hide_shelf', '=', False)]}"/>
<button string="禁用货位" name="action_location_status_disable" type="object" class="oe_highlight"
attrs="{'invisible': ['|', ('hide_shelf', '=', True), ('location_status', '!=', '空闲')]}"/>
attrs="{'invisible': [('location_status', '!=', '空闲')]}"/>
<button string="启用货位" name="action_location_status_enable" type="object" class="oe_highlight"
attrs="{'invisible': ['|', ('hide_shelf', '=', True), ('location_status', '!=', '禁用')]}"/>
<!-- <button name="%(shelf_location_kanban_action_id)d"-->
<!-- type="action"-->
<!-- class="oe_stat_button"-->
<!-- context="{'search_default_maintenance_equipment_id': [active_id]}"-->
<!-- icon="fa-wrench">-->
<!-- <field string="目标位置调拨" name="destination_move_ids" widget="statinfo"/>-->
<!-- </button>-->
attrs="{'invisible': [('location_status', '!=', '禁用')]}"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
@@ -91,31 +144,13 @@
</button>
</div>
<group>
<field name="hide_shelf" invisible="1"/>
<field name="hide_location" invisible="1"/>
<field name="name" string="名称"/>
<field name="barcode" string="编码"/>
<field name="location_type"/>
<field name="shelf_location_id" attrs="{'invisible': [('location_type', '=', '货位')]}"/>
<field name="location_id"
attrs="{'readonly': [('location_type', '=', '货位')], 'invisible': [('location_type', '=', '货架')]}"/>
<field name="channel"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="direction"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="product_sn_id" attrs="{'invisible': [('hide_location', '=', False)]}"/>
<!-- <field name="product_type" widget="many2many_tags"/> -->
<field name="shelf_height"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="shelf_layer"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<field name="layer_capacity"
attrs="{'invisible': [('hide_shelf', '=', False)], 'required': [('hide_shelf', '!=', False)]}"/>
<!-- <field name="product_id" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '占用')]}"/> -->
<field name="product_id" attrs="{'invisible': [('hide_location', '=', False)]}"/>
<!-- <field name="product_type" attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False), ('location_status', '=', '占用')]}" widget="many2many_tags"/> -->
<field name="location_status"
attrs="{'invisible': [('hide_location', '=', False)], 'required': [('hide_location', '!=', False)]}"/>
<field name="barcode"/>
<field name="name"/>
<field name="shelf_id"/>
<field name="location_id"/>
<field name="product_sn_id"/>
<field name="product_id"/>
<field name="location_status"/>
<field name="storage_time" widget="datetime"/>
</group>
</sheet>
@@ -134,13 +169,13 @@
#{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''}
#{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''}
#{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}">
<!-- 标题 -->
<!-- 标题 -->
<div class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<field name="name"/>
</div>
</div>
<!-- 内容 -->
<!-- 内容 -->
<div class="o_kanban_record_bottom">
<field name="location_status"/>
</div>
@@ -151,31 +186,31 @@
</div>
</div>
</t>
<!-- <t t-name="kanban-box"> -->
<!-- <div t-attf-class="oe_kanban_card oe_kanban_global_click -->
<!-- #{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''} -->
<!-- #{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''} -->
<!-- #{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}"> -->
<!-- --><!-- 看板内容 -->
<!-- </div> -->
<!-- <div t-attf-class="oe_kanban_card"> -->
<!-- --><!-- 标题 -->
<!-- <div class="o_kanban_card_header"> -->
<!-- <div class="o_kanban_card_header_title"> -->
<!-- <field name="name"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- --><!-- 内容 -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="location_status"/> -->
<!-- </div> -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="product_sn_id"/> -->
<!-- <span> | </span> -->
<!-- <field name="product_id"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </t> -->
<!-- <t t-name="kanban-box"> -->
<!-- <div t-attf-class="oe_kanban_card oe_kanban_global_click -->
<!-- #{record.location_status.raw_value == '空闲' ? 'kanban_color_1' : ''} -->
<!-- #{record.location_status.raw_value == '占用' ? 'kanban_color_2' : ''} -->
<!-- #{record.location_status.raw_value == '禁用' ? 'kanban_color_3' : ''}"> -->
<!-- 看板内容 -->
<!-- </div> -->
<!-- <div t-attf-class="oe_kanban_card"> -->
<!-- 标题 -->
<!-- <div class="o_kanban_card_header"> -->
<!-- <div class="o_kanban_card_header_title"> -->
<!-- <field name="name"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- 内容 -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="location_status"/> -->
<!-- </div> -->
<!-- <div class="o_kanban_record_bottom"> -->
<!-- <field name="product_sn_id"/> -->
<!-- <span> | </span> -->
<!-- <field name="product_id"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </t> -->
</templates>
</kanban>
</field>
@@ -186,10 +221,12 @@
<field name="name">shelf.location.search</field>
<field name="model">sf.shelf.location</field>
<field name="arch" type="xml">
<search string="货架货位">
<search string="货位">
<searchpanel class="account_root">
<!-- <field name="location_type" icon="fa-filter"/> -->
<field name="location_id" select="multi" icon="fa-filter"/>
<!-- <field name="location_id" select="multi" icon="fa-filter"/> -->
<field name="location_id" string="所属库区" icon="fa-filter"/>
<field name="shelf_id" string="货架"/>
<!-- <field name="location_status" icon="fa-filter"/> -->
</searchpanel>
</search>
@@ -197,11 +234,11 @@
</record>
<record id="shelf_location_kanban_action_id" model="ir.actions.act_window">
<field name="name">架货</field>
<field name="name">货位看板</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.shelf.location</field>
<field name="view_mode">kanban,form</field>
<field name="domain">[('location_type', '=', '货位'),('check_state','=','enable')]</field>
<!-- <field name="domain">[('check_state','=','enable')]</field> -->
</record>
<!-- <record id="example_action" model="ir.actions.act_window"> -->
@@ -223,7 +260,7 @@
groups="sf_warehouse.group_sf_stock_user"/>
<record id="action_sf_shelf_location" model="ir.actions.act_window">
<field name="name">架货</field>
<field name="name">货位</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.shelf.location</field>
<field name="view_mode">tree,form</field>
@@ -246,8 +283,8 @@
<!-- sequence="50" -->
<!-- action="kanban_action_id"/> -->
<menuitem id="menu_sf_shelf_location" name="货架货位" parent="stock.menu_warehouse_config"
sequence="2"
<menuitem id="menu_sf_shelf_location" name="货位" parent="stock.menu_warehouse_config"
sequence="20"
action="action_sf_shelf_location"
groups="sf_warehouse.group_sf_stock_user"/>