I am creating a custom module in which i have a many2one field that has the entries from res.partner with supplier= True. My field,
seller = fields.Many2one('res.partner', string="Select Seller")
Read that i can do this in my xml file and tried,
<data>
<record id="test_menu_action" model="ir.actions.act_window">
<field name="name">Tests</field>
<field name="res_model">tests.alltests</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('supplier','=',True)]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create The First Test
</p>
</field>
</record>
<menuitem id="quality_main_menu"
name="Quality"/>
<menuitem id="test_create" parent="quality_main_menu" name="Test" action="test_menu_action"/>
</data>
which gave me the following error,
Odoo Server Error ........
ValueError: Invalid field 'supplier' in leaf "<osv.ExtendedLeaf: ('supplier', '=', True) on tests_alltests (ctx: )
How do i do it correctly?
I am using odoo V12 community edition.
('supplier', '=', True)
, you can try('supplier', '!=', False)
– traviswseller
, but your domain usessupplier
. Is that correct? What class isseller
a part of? – travisw