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

Hi,

In a new module create by Studio, I have 2 models Tenders & Fundings.

In model Tenders, I defined a Many2many field related to Fundings and in model Fundings, I defined a Many2many field related to Tenders.

I have create a Fundings record with its name and an empty Many2many field and in 2 Tenders records, I have assigned to the Many2many field this Fundings record.

I have then create a Scheduled Action with Studio on Fundings model with the python code:

records = env['x_fundings']
for record in records:
records_batches = env['x_tenders'].search([('x_studio_tenders_type', '=', 'Batch'), ('x_studio_tenders_batch_fundings.x_name', '=', record.x_name)])
record.write({'x_studio_fundings_batches': [(6, 0, records_batches)]})

Unfortunately, if I run manually this action, it does not do anything (the Many2many field is not filled) nor throw any error.

Is there a problem with the logic and/or the syntax used ?

Thanks.



アバター
破棄
関連投稿 返信 ビュー 活動
0
3月 21
7
2
11月 23
1906
1
12月 22
3515
1
3月 22
3107
1
2月 22
5903