如果many2many字段值是“rice”,如何使odoo字段不可见

时间:2017-09-15 13:25:33

标签: openerp odoo-8 odoo-9 odoo-10 odoo-view

我正在尝试将持续时间字符字段显示为'仅当'父字段名为category_ids时选择了Many2Many字段值“非永久”。我尝试了很多东西,但似乎没有用。以下是我的代码段

型号:

class hr_employee(models.Model):
    _inherit = 'hr.employee'

    identification_id = fields.Char(string="Employee No")
    duration = fields.Char(string="Duration")

查看:

<!-- Employee Form View -->
<record model="ir.ui.view" id="hr_custom_form_view">
    <field name="name">hr.custom</field>
    <field name="model">hr.employee</field>
    <field name="inherit_id" ref="hr.view_employee_form"/>
    <field name="groups_id" eval="[(4, ref('base.group_hr_user'))]"/>
    <field name="arch" type="xml">

        <xpath expr="//field[@name='user_id']" position="after">
            <field name="duration"/>
        </xpath>

    </field>
</record>

0 个答案:

没有答案