我创建了一个继承模块的模块库存.库存, 我希望“第一次验证”按钮只在“实际数量”与“理论数量”不同时出现。 这是接口: enter image description here
以下是我的xml代码:
<record id="linh_view_inventory_form_ext" model="ir.ui.view">
<field name="name">linh.view.inventory.form.ext</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock_account.view_inventory_form_inherit"/>
<field name="form">form</field>
<field name="arch" type="xml">
<button name="action_cancel_inventory" states="confirm" string="Cancel Inventory" type="object" position="before">
<button name="inventory_1st_validate" states="need_validate" string="1st Validate" class="oe_highlight" type="object" attrs="{'invisible':[('theoretical_qty','=','product_qty')]}/>
</button>
<field name="state" position="replace">
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,acct_validated,done"/>
</field>
</field>
</record>
但我有个错误:
Error: Unknown field theoretical_qty in domain [["theoretical_qty","=","product_qty"],["state","not in",["need_validate"]]]
“理论数量”是我从模型中得到的“理论数量”的字段名库存.拣选". 我不知道为什么景观不认识它。在
非常感谢你的帮助。在
theoretical_qty
是库存.inventory.line您不能直接在内部使用库存.库存。在您可以在的树/窗体视图中使用它库存.inventory.line只有。在
还有一件事,要在attrs中使用字段,它必须在视图中显示。在
(在当前视图或继承的父视图中)。在
相关问题 更多 >
编程相关推荐