Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2432 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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

Post correlati Risposte Visualizzazioni Attività
8
apr 25
28796
1
set 24
2938
0
ago 20
2220
0
mar 15
7694
3
mag 25
1581