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

Hi


I would like to know how can I concatenate two o more fields into one with automated actions. I tried to execute python code but didn't work.


Thanks

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

Thank you very much for your help.


I am not an expert in programming but if someone in addition to my first question would like to know how to avoid double space when one of the fields is empty, I did it like this.


sentence = (record.x_studio_id_type or "") +" "+ (record.x_studio_id_number or "") +" "+ (record.x_studio_first_name or "") +" "+ (record.x_studio_last_name or "")

sentence_without_double_space= " ".join(sentence.split())

record.write({'x_name': sentence_without_double_space})


If someone can tell me if there is a better way I would appreciate your comment.




คำตอบที่ดีที่สุด

Hi,

You can add a automated action like this,



used code:  record.write({'default_code': record.name + record.barcode})

Know more about the automated actions: Odoo Automatons - Automated Action


Thanks

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

For some reason the automatic action stops working after a while.

Right now I have three automatic actions, all are associated with different models.

I see that when I disable and re-enable it works fine.

I would appreciate any help.

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

Hello I have not been able to solve the problem yet I would appreciate it if someone can help me

Related Posts ตอบกลับ มุมมอง กิจกรรม
4
พ.ค. 24
12628
1
เม.ย. 24
3269
0
พ.ย. 23
2015
Blank White Page After log in to Odoo13 แก้ไขแล้ว
1
ก.ย. 23
2103
2
ส.ค. 23
4494