コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
3985 ビュー

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

関連投稿 返信 ビュー 活動
4
5月 24
12631
1
4月 24
3271
0
11月 23
2019
1
9月 23
2104
2
8月 23
4497