Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2607 มุมมอง

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)

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน

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 ตอบกลับ มุมมอง กิจกรรม
How to concatenate fields in a view? แก้ไขแล้ว
8
เม.ย. 25
29172
1
ก.ย. 24
3342
0
ส.ค. 20
2388
0
มี.ค. 15
7932
3
พ.ค. 25
2245