I have a new module that depends on crm.lead, and I want to display the fields of the new module in its list view. How can I do this? Currently, it seems to only show the fields from the original module.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
To show your custom fields in the crm.lead list view, you need to inherit the tree view and add your fields.
<record id="crm_lead_tree_view_custom" model="ir.ui.view">
<field name="name">crm.lead.tree.view.custom</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_lead_view_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="inside">
<field name="x_custom_field"/>
</xpath>
</field>
</record>
Make sure your model extension correctly adds the new fields:
from odoo import models, fields
class CrmLead(models.Model):
_inherit = 'crm.lead'
x_custom_field = fields.Integer(string="Another Field")
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
InscribirsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
0
may 25
|
540 | ||
|
0
ago 24
|
922 | ||
|
2
mar 24
|
1112 | ||
CMR - Lead - Oportunidades
Resuelto
|
|
1
jul 22
|
2540 | |
|
0
may 22
|
1552 |