跳至内容
菜单
此问题已终结
1 回复
2466 查看

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

相关帖文 回复 查看 活动
8
4月 25
28834
1
9月 24
2995
0
8月 20
2241
0
3月 15
7720
3
5月 25
1617