Files
gzth/yuthon_stock/views/inherit_stock_picking.xml
T
2026-04-22 19:30:49 +08:00

309 lines
16 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="inherit_stock_picking_form" model="ir.ui.view">
<field name="name">inherit.stock.picking.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='picking_type_id']" position="after">
<field name="department_id" options="{'no_create': True}" invisible="1"/>
</xpath>
<xpath expr="//field[@name='location_id'][@groups='stock.group_stock_multi_locations']" position="attributes">
<attribute name="domain">[('id', 'in', available_location_ids)]</attribute>
</xpath>
<xpath expr="//field[@name='picking_type_id']" position="attributes">
<attribute name="readonly">state != 'draft' and (receipt_status in ['acceptance', 'certification'] or receipt_status == 'receipt')</attribute>
</xpath>
<xpath expr="//field[@name='origin']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='origin']" position="after">
<field name="purchase_id" string="源单据" readonly="1" options="{'no_create': True, 'no_open': False}"/>
<field name="user_id" string="采购人员"/>
<field name="available_product_ids" invisible="1"/>
<field name="available_location_ids" invisible="1"/>
<field name="state" invisible="1"/>
<field name="can_certify" invisible="1"/>
<field name="trigger_auto_fill" invisible="1"/>
<field name="acceptance_user_id" invisible="1"/>
<field name="certifier_user_id" invisible="1"/>
<field name="is_admin" invisible="1"/>
</xpath>
<xpath expr="//page[@name='operations']//field[@name='move_ids_without_package']//field[@name='product_id']" position="attributes">
<attribute name="options">{'no_create': True}</attribute>
<attribute name="domain">[('id', 'in', parent.available_product_ids)]</attribute>
</xpath>
<xpath expr="//button[@name='%(stock.act_stock_return_picking)d']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='action_confirm']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='action_cancel']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//header" position="inside">
<!-- 转交验收:管理员且尚未转交时可见 -->
<button name="action_transfer_acceptance" string="转交验收" type="object" class="btn-secondary"
invisible="receipt_status != 'acceptance' or acceptance_user_id != False or not is_admin"/>
<!-- 验收按钮:只有指定验收人可见,且当前用户是指定人 -->
<button name="action_acceptance" string="验收" type="object" class="btn-primary"
invisible="receipt_status != 'acceptance' or acceptance_user_id == False or acceptance_user_id != uid"/>
<!-- 转交证明:验收人才能转交,且尚未转交证明时可见 -->
<button name="action_transfer_certifier" string="转交证明" type="object" class="btn-secondary"
invisible="receipt_status != 'certification' or certifier_user_id != False or acceptance_user_id != uid"/>
<!-- 撤回入库:管理员且入库状态时可见 -->
<button name="action_revoke_receipt" string="撤回入库" type="object" class="btn-secondary"
invisible="receipt_status != 'receipt' or not is_admin"/>
</xpath>
<xpath expr="//page[@name='operations']/field[@name='move_ids_without_package']" position="after">
<group>
<group>
<field name="employee_id" string="验收人" required="1" options="{'no_create': True}" readonly="receipt_status in ['certification', 'receipt']"/>
<field name="document_ids" widget="preview_many2many" readonly="receipt_status in ['certification', 'receipt']"/>
<field name="acceptance_date" readonly="receipt_status in ['certification', 'receipt']"/>
</group>
<group>
<field name="certifier_id" options="{'no_create': True}" readonly="receipt_status in ['acceptance', 'receipt']"/>
<field name="certifier_document_ids" widget="preview_many2many" readonly="receipt_status in ['acceptance', 'receipt']"/>
<field name="certification_date" readonly="receipt_status in ['acceptance', 'receipt']"/>
</group>
</group>
</xpath>
<xpath expr="//button[@name='action_open_label_type']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//button[@name='button_validate' and @class='oe_highlight']" position="attributes">
<attribute name="string">证明</attribute>
<attribute name="invisible">receipt_status != 'certification' or certifier_user_id == False or certifier_user_id != uid</attribute>
</xpath>
<xpath expr="//field[@name='location_dest_id'][@groups='stock.group_stock_multi_locations']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='picking_properties']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//page[@name='extra']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//page[@name='note']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="string">采购人员</attribute>
</xpath>
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="string">供应商</attribute>
<attribute name="readonly">state != 'draft' and (receipt_status in ['acceptance', 'certification'] or receipt_status == 'receipt')</attribute>
</xpath>
<xpath expr="//field[@name='scheduled_date']" position="attributes">
<attribute name="readonly">state != 'draft' and (receipt_status in ['acceptance', 'certification'] or receipt_status == 'receipt')</attribute>
</xpath>
<xpath expr="(//field[@name='state'][@widget='statusbar'])[1]" position="replace">
<field name="receipt_status" widget="statusbar" statusbar_visible="acceptance,certification,receipt" invisible="picking_type_code != 'incoming'"/>
</xpath>
<xpath expr="(//field[@name='state'][@widget='statusbar'])[1]" position="replace">
<field name="receipt_status" widget="statusbar" statusbar_visible="acceptance,certification,receipt" invisible="picking_type_code == 'incoming'"/>
</xpath>
</field>
</record>
<record id="inherit_stock_picking_tree" model="ir.ui.view">
<field name="name">inherit.stock.picking.tree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.vpicktree"/>
<field name="arch" type="xml">
<xpath expr="//tree/header" position="inside">
<button name="action_update_name_by_products" type="object" string="重新生成编号"
class="btn-secondary"
help="将选中的入库单重新生成 SH+年月+序号 格式的编号"/>
</xpath>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="string">编号</attribute>
</xpath>
<xpath expr="//field[@name='location_dest_id']" position="attributes">
<attribute name="string">目的位置</attribute>
<attribute name="invisible">1</attribute>
</xpath>
<!-- <xpath expr="//field[@name='partner_id']" position="attributes">-->
<!-- <attribute name="string">供应商</attribute>-->
<!-- </xpath>-->
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="string">采购人员</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="after">
<field name="employee_id" string="验收人"/>
</xpath>
<xpath expr="//field[@name='picking_type_id']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='location_id']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='location_dest_id']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='scheduled_date']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='products_availability']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='date_deadline']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='backorder_id']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
</field>
</record>
<!--出库-->
<record id="stock_picking_views_tree_ikuku" model="ir.ui.view">
<field name="name">stock.picking.tree</field>
<field name="model">stock.picking</field>
<field name="arch" type="xml">
<tree string="出库">
<field name="name"/>
<field name="partner_id" string="供应商"/>
<field name="user_id" string="采购人员"/>
<field name="employee_id" string="验收人"/>
<field name="date_done"/>
<field name="origin"/>
<!-- <field name="json_display" widget="json_template"/>-->
<field name="company_id"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="stock_picking_views_tree_adopted" model="ir.ui.view">
<field name="name">stock.picking.tree.adopted</field>
<field name="model">stock.picking</field>
<field name="arch" type="xml">
<tree string="领用">
<field name="name"/>
<field name="partner_id" string="供应商"/>
<field name="user_id" string="采购人员"/>
<field name="employee_id" string="验收人"/>
<field name="date_done"/>
<field name="origin"/>
<!-- <field name="json_display" widget="json_template"/>-->
<field name="company_id"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- 借用出库Tree视图 -->
<record id="stock_picking_views_tree_borrow" model="ir.ui.view">
<field name="name">stock.picking.tree.borrow</field>
<field name="model">stock.picking</field>
<field name="arch" type="xml">
<tree string="借用">
<field name="name"/>
<field name="partner_id" string="供应商"/>
<field name="user_id" string="采购人员"/>
<field name="employee_id" string="验收人"/>
<field name="date_done"/>
<field name="origin"/>
<!-- <field name="json_display" widget="json_template"/>-->
<field name="company_id"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- 报废出库Tree视图 -->
<record id="stock_picking_views_tree_scrap" model="ir.ui.view">
<field name="name">stock.picking.tree.scrap</field>
<field name="model">stock.picking</field>
<field name="arch" type="xml">
<tree string="报废">
<field name="name"/>
<field name="partner_id" string="供应商"/>
<field name="user_id" string="采购人员"/>
<field name="employee_id" string="验收人"/>
<field name="date_done"/>
<field name="origin"/>
<field name="json_display" widget="json_template"/>
<field name="company_id"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="action_stock_picking_ikuku" model="ir.actions.act_window">
<field name="name">出库</field>
<field name="res_model">stock.picking</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="stock_picking_views_tree_ikuku"/>
</record>
<record id="action_stock_picking_adopted" model="ir.actions.act_window">
<field name="name">领用</field>
<field name="res_model">stock.picking</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="stock_picking_views_tree_adopted"/>
</record>
<record id="action_stock_picking_borrow" model="ir.actions.act_window">
<field name="name">借用</field>
<field name="res_model">stock.picking</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="stock_picking_views_tree_borrow"/>
</record>
<record id="action_stock_picking_scrap" model="ir.actions.act_window">
<field name="name">报废</field>
<field name="res_model">stock.picking</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="stock_picking_views_tree_scrap"/>
</record>
<menuitem id="stock_picking_incoming"
name="入库"
parent="stock.menu_stock_warehouse_mgmt"
action="stock.action_picking_tree_incoming"
sequence="1"/>
<menuitem id="stock_picking_ikuku"
name="出库"
parent="stock.menu_stock_warehouse_mgmt"
action="action_stock_picking_ikuku"
sequence="3"/>
<menuitem id="stock_picking_adopted"
parent="stock.menu_stock_warehouse_mgmt"
name="领用"
action="action_stock_picking_adopted"
sequence="5"/>
<menuitem id="stock_picking_borrow"
parent="stock.menu_stock_warehouse_mgmt"
name="借用"
action="action_stock_picking_borrow"
sequence="10"/>
<menuitem id="stock_picking_scrap"
parent="stock.menu_stock_warehouse_mgmt"
name="报废"
action="action_stock_picking_scrap"
sequence="15"/>
<record id="stock.action_picking_tree_incoming" model="ir.actions.act_window">
<field name="name">收货</field>
<field name="context">{'contact_display': 'partner_address', 'default_company_id': allowed_company_ids[0], 'restricted_picking_type_code': 'incoming', 'search_default_reception': 1, 'search_default_my_pickings': 1}</field>
</record>
<record id="inherit_view_picking_internal_search_my" model="ir.ui.view">
<field name="name">inherit.view.picking.internal.search.my</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_internal_search"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='reception']" position="after">
<filter name="my_pickings" string="我的收货"
domain="['|', '|', ('user_id', '=', uid), ('employee_id.user_id', '=', uid), ('certifier_id', '=', uid)]"/>
</xpath>
</field>
</record>
</odoo>