Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1699 Vistas

Hello to everybody,

I'm using version 15 online. In CRM application, I'm working with Studio in order to arrange for an email template where the text of the message is built in function of specific tags set in the lead/opportunity. 

I tried object.tags ...but the following error rises:

--------------------------

Failed to render QWeb template : 'crm.lead' object has no attribute 'tags' Traceback (most recent call last): File "/home/odoo/src/odoo/15.0/odoo/addons/base/models/qweb.py", line 219, in render_template yield from compiled_fn(self, values, log) File "", line 6, in template AttributeError: 'crm.lead' object has no attribute 'tags' Error when render the template AttributeError: 'crm.lead' object has no attribute 'tags' Template: Path: /div/t[2] Node: )

--------------------------

Is there any way to do this? Or a workaround?

Thanks! 

Regards, 

Max.

Avatar
Descartar
Autor Mejor respuesta

Dear Niyas Raphy, many thanks for the fast and proper reply. I now realized to have wrongly operated.

Going further, I applied your correction and that error doesn't rise anymore. Good Job.

In any case, I'm not able to fulfill my job and I'm sure to wrongly refer to the fields and values.

If it is possible I would post, looking for additional support, please.

This is my code and I'm bolding the responsible command:

t-if="1960 in object.tag_ids" data-oe-t-group="0" data-oe-t-selectable="true" data-oe-t-group-active="true" data-oe-t-inline="true">

With this I receive the following error

----------------------------

User Error

×

Failed to render QWeb template : unsupported operand type(s) for "in": 'crm.tag()' and '' Traceback (most recent call last): File "/home/odoo/src/odoo/15.0/odoo/addons/base/models/qweb.py", line 219, in render_template yield from compiled_fn(self, values, log) File "", line 6, in template File "/home/odoo/src/odoo/15.0/odoo/models.py", line 5775, in __contains__ raise TypeError(f"unsupported operand type(s) for \"in\": '{self._name}()' and '{type(item)}'") TypeError: unsupported operand type(s) for "in": 'crm.tag()' and '' Error when render the template TypeError: unsupported operand type(s) for "in": 'crm.tag()' and '' Template: Path: /div/t[2] Node: )

----------------------------

Can you please suggest how should I write the command correctly? Thank you for your time, anyway.

Best regards

Max

Avatar
Descartar
Mejor respuesta

Hi,
You have to use technical name of the field, here it is: tag_ids

You can activate the developer mode and hover the mouse on the field, then you will get the technical name of field in the pop up.

Thanks

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
ago 25
2106
0
may 25
980
0
ago 24
1238
0
jul 24
1669
2
mar 24
1528