Dns Odoo 10限制嵌入表单视图的树状视图中的记录
阿莱特,这是我的密码Dns Odoo 10限制嵌入表单视图的树状视图中的记录,dns,treeview,odoo-10,formview,Dns,Treeview,Odoo 10,Formview,阿莱特,这是我的密码 <page name="employment_locations" string="Locations"> <field name="location_ids"> <tree editable="bottom"> <field name="location_id" string="Location" domain="[('parent_id', '!=', False
<page name="employment_locations" string="Locations">
<field name="location_ids">
<tree editable="bottom">
<field name="location_id" string="Location" domain="[('parent_id', '!=', False)]"/>
<field name="location_address_id" string="Address"/>
<field name="location_phone_number" string="Phone #"/>
<field name="location_parent_id" string='Zone'/>
</tree>
</field>
</page>
我在location_id上有一个工作域,以限制某人选择父位置的能力,但由于我为不同的视图(在employment.locations中)添加了父位置,我希望将此树视图仅限于子位置。这是employee表单视图的扩展
我尝试将域添加到初始树标记和field-Location\u-ids标记中。我甚至尝试使用t-if=“record.parent\u id!=false”来封闭树中的字段
任何帮助或想法都会很有帮助我也在Odoo论坛上问过这个问题,我得到的回答是用python而不是xml将域放到字段中,这很有效