Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- 会計
- 在庫
- PoS
- プロジェクト
- MRP
この質問にフラグが付けられました
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