Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2431 Vues

I have two tags:

Size (Tag1)

Type (Tag2)


I want to concatenate two two tags in one field but I am having an error. Here's my code:


for record in self:
record['x_studio_container_type_and_size'] = str(record.x_studio_tag_ids) + ' ' + str(record.x_studio_container_type)

Avatar
Ignorer
Meilleure réponse

Hello Neil Matan
I hope this code is helpful for you

size = fields.Integer(string="Size(Tag1)")
type = fields.Char(string="Type")
concate_data = fields.Char(string="Contact Data", compute="_compute_value")

@api.depends('size', 'type')
def _compute_value(self):
for rec in self:
rec.concate_data = str(rec.name) + " " + str(rec.type)

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Ignorer
Auteur

Hello Jainesh,

I am receiving this error:

File "/home/odoo/src/odoo/odoo/http.py", line 302, in _handle_exception
raise exception.with_traceback(None) from new_cause
ValueError: forbidden opcode(s) in 'lambda': STORE_ATTR

Publications associées Réponses Vues Activité
8
avr. 25
28786
1
sept. 24
2935
0
août 20
2219
0
mars 15
7692
3
mai 25
1576