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


On Manufacturing Orders I added a new Char field (New Field) whose value I want to pass on all the child MO it is associated with.

アバター
破棄
最善の回答

Hi,

Please refer to the code below:


from odoo import fields, models

class MrpProduction(models.Model):
_inherit = 'mrp.production'

new_field = fields.Char(string="New Field")

@api.constrains("new_field")
def _constraint_new_field(self):
child_mo = self.self._get_children()
for child in child_mo:
child.new_field = self.new_field


Hope it helps.

アバター
破棄
関連投稿 返信 ビュー 活動
2
11月 22
2570
0
11月 15
3984
3
9月 25
267
1
9月 25
307
0
8月 25
379