Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
435 Vizualizări


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.

Imagine profil
Abandonează
Cel mai bun răspuns

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.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
nov. 22
2469
0
nov. 15
3926
0
aug. 25
187
0
aug. 25
158
2
aug. 25
690