Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Hi,
If you are looking to extend the search view from the python code, yes its possible to do it. You can refer this module, which adds a new inherited view in odoo, to add fields to an existing form. By referring this code, you can adjust and make it workable for search view.
Module: https://apps.odoo.com/apps/modules/13.0/dynamic_partner_fields/
Relevant part of code from above module:
inherit_id = self.env.ref('base.view_partner_form')
arch_base = _('<?xml version="1.0"?>'
'<data>'
'<field name="%s" position="%s">'
'<field name="%s"/>'
'</field>'
'</data>') % (self.position_field.name, self.position, self.name)
if self.widget:
arch_base = _('<?xml version="1.0"?>'
'<data>'
'<field name="%s" position="%s">'
'<field name="%s" widget="%s"/>'
'</field>'
'</data>') % (self.position_field.name, self.position, self.name, self.widget.name)
self.env['ir.ui.view'].sudo().create({'name': 'partner.dynamic.fields.%s' % self.name,
'type': 'form',
'model': 'res.partner',
'mode': 'extension',
'inherit_id': inherit_id.id,
'arch_base': arch_base,
'active': True})
return {
'type': 'ir.actions.client',
'tag': 'reload',
}
For inheriting and changing existing search views in Odoo: How To Inherit And Make Changes Inside Existing Search Views In Odoo
Thanks
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up