Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2434 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

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

Related Posts Odpovědi Zobrazení Aktivita
8
dub 25
28799
1
zář 24
2942
0
srp 20
2221
0
bře 15
7695
3
kvě 25
1583