How to hide/remove an "Add a line" in transfers when the status is done/cancelled?
Version: odoo 18 e+
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How to hide/remove an "Add a line" in transfers when the status is done/cancelled?
Version: odoo 18 e+
Hello,
This will hide the "Add a line" in transfers when the status is done/cancelled.
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_picking_form_inherit_restrict_new" model="ir.ui.view">
<field name="name">stock.picking.restrict.new</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='move_ids_without_package']" position="attributes">
<attribute name="options">{'create':[('state','not in',['done','cancel'])]}</attribute>
</xpath>
</field>
</record>
</odoo>
Hi,
Please refer to the code:
<record id="view_picking_form_inherit" model="ir.ui.view">
<field name="name">stock.picking.form.inherit.disable_add_line</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='move_line_ids']" position="attributes">
<attribute name="readonly">state in ['done','cancel']</attribute>
</xpath>
</field>
</record>
When state is done or cancel, the field becomes readonly, so users cannot add new lines, and the “Add a line” button disappears automatically.
Hope it helps.
관련 게시물 | 답글 | 화면 | 활동 | |
---|---|---|---|---|
|
1
11월 24
|
19550 | ||
|
5
8월 24
|
3455 | ||
|
0
8월 22
|
12862 | ||
|
0
1월 22
|
2870 | ||
|
1
3월 25
|
4869 |