Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Search More..." in my many2one field

I want an advanced search when picking an item from many2one listbox. This feature is implemented for 'res.groups' object, for example. I cannot find this feature in /addons.

To be more exact, I define my object

class my_child(osv.osv):
    _name = 'my.child'
    _columns = {
    'name': fields.char('Child name'),
    }
my_children()

I define a parent which has many2one relation to child object and existing resource object

class my_parent(osv.osv):
    _name = 'my.parent'
    _columns = {
    'name': fields.char('Parent name'),
    'child': fields.many2one('my.child', 'Child'),
    'res_group_id': fields.many2one('res.groups', 'Group'),
    }

Then I add child and res_group_id to my_parent's xml form view

...
<field name="child"/>
<field name="res_group_id"/>
...

The res_group_id has "Search More..." option which opens search view but "child" does not. Please, how do I add "Search More..." option to the child?

like image 600
stylehopper Avatar asked Dec 29 '25 11:12

stylehopper


1 Answers

please add 5 or more records to your child model. then you will be able to see the 'search more.. '

like image 153
OmaL Avatar answered Dec 31 '25 10:12

OmaL



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!