Files
gzth/yuthon_purchase/views/inherit_product_product_views.xml
T
2026-07-27 15:57:43 +08:00

65 lines
3.1 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="inherit_product_product_form_view" model="ir.ui.view">
<field name="name">product.product.form.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='uom_po_id']" position="after">
<field name="brand"/>
<field name="specs"/>
</xpath>
</field>
</record>
<!-- 产品模板树视图:隐藏无用字段 + 可编辑库存位置 -->
<record id="inherit_product_template_tree_view" model="ir.ui.view">
<field name="name">product.template.tree.inherit.yuthon.purchase</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<!-- 启用行内编辑 -->
<xpath expr="//tree" position="attributes">
<attribute name="editable">bottom</attribute>
</xpath>
<!-- 隐藏barcode字段 -->
<xpath expr="//field[@name='barcode']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<!-- 隐藏default_code字段 -->
<xpath expr="//field[@name='default_code']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<!-- 隐藏website_id字段 -->
<xpath expr="//field[@name='website_id']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<!-- 修改detailed_type字段标签 -->
<xpath expr="//field[@name='detailed_type']" position="attributes">
<attribute name="string">详细类别</attribute>
</xpath>
<!-- 在详细类别之后添加库存位置字段(可编辑下拉) -->
<xpath expr="//field[@name='detailed_type']" position="after">
<field name="stock_location_id" string="库存位置"/>
</xpath>
<!-- 在最右列添加详情按钮,点击打开产品模板form视图 -->
<xpath expr="//tree" position="inside">
<button name="get_formview_action" type="object" string="详情" class="btn btn-blue"/>
</xpath>
</field>
</record>
<!-- 添加搜索面板到搜索视图 -->
<record id="inherit_product_template_search_view" model="ir.ui.view">
<field name="name">product.template.search.inherit.yuthon.purchase</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<xpath expr="//search" position="inside">
<searchpanel>
<field name="categ_id" string="产品类别" enable_counters="1"/>
</searchpanel>
</xpath>
</field>
</record>
</odoo>