feat: Add Warehouse Management group for purchase_custom_stock fields

- Add empty 'Warehouse Management' group in purchase_request form
- Update purchase_custom_stock inheritance to use the new group
- Move warehouse_id and location_id fields to the dedicated group
- Simplify field layout by removing div wrappers and labels
This commit is contained in:
maltayyar2 2025-11-20 22:54:04 +03:00
parent 72397f5b61
commit ba2ee033e1
2 changed files with 16 additions and 26 deletions

View File

@ -54,31 +54,21 @@
<xpath expr="//field[@name='use_analytic']" position="attributes">
<attribute name="attrs">{'readonly':[('state','!=','draft')]}</attribute>
</xpath>
<xpath expr="//group[1]" position="after">
<group col="2" colspan="2">
<field name="view_location_id" invisible="1"/>
<field name="edit_locations" invisible="1"/>
<field name="show_emp_button" invisible="1"/>
<field name="show_approve_warehouse" invisible="0"/>
<field name="has_asset_product_line" invisible="1"/>
<field name="show_asset_release_button" invisible="1"/>
<field name="all_assets_released" invisible="1"/>
<field name="asset_custody_complete" invisible="1"/>
<div>
<label for="warehouse_id"/>
<field name="warehouse_id"
attrs="{'readonly':['|',('edit_locations' , '=' , False),('state' , '!=' , 'warehouse')]}"
groups="stock.group_stock_user,stock.group_stock_manager"/>
</div>
<div>
<label for="location_id"/>
<field name="location_id"
attrs="{'readonly':['|',('edit_locations' , '=' , False),('state' , '!=' , 'warehouse')]}"
groups="stock.group_stock_user,stock.group_stock_manager"/>
</div>
</group>
<xpath expr="//group[@string='Warehouse Management']" position="inside">
<field name="view_location_id" invisible="1"/>
<field name="edit_locations" invisible="1"/>
<field name="show_emp_button" invisible="1"/>
<field name="show_approve_warehouse" invisible="0"/>
<field name="has_asset_product_line" invisible="1"/>
<field name="show_asset_release_button" invisible="1"/>
<field name="all_assets_released" invisible="1"/>
<field name="asset_custody_complete" invisible="1"/>
<field name="warehouse_id"
attrs="{'readonly':['|',('edit_locations' , '=' , False),('state' , '!=' , 'warehouse')]}"
groups="stock.group_stock_user,stock.group_stock_manager"/>
<field name="location_id"
attrs="{'readonly':['|',('edit_locations' , '=' , False),('state' , '!=' , 'warehouse')]}"
groups="stock.group_stock_user,stock.group_stock_manager"/>
</xpath>
<xpath expr="//button[@name='open_requisition']" position="after">
<field name="picking_id" invisible="1"/>

View File

@ -97,8 +97,8 @@
help="Analytic account for budget tracking"/>
</group>
<group string="Warehouse Management">
<field name="picking_type_id"/>
</group>
<field name="picking_type_id" invisible="1"/>
<field name="purchase_create" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="edit_partner_id" invisible="1"/>