Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
440 Prikazi


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.

Avatar
Opusti
Best Answer

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.

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
nov. 22
2475
0
nov. 15
3927
0
avg. 25
196
0
avg. 25
171
2
avg. 25
700