
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.
Pertanyaan ini telah diberikan tanda
1
Balas
1717
Tampilan
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.
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|
|
2
Nov 22
|
4277 | ||
|
|
0
Nov 15
|
5450 | ||
|
|
1
Jun 26
|
1113 | ||
|
|
1
Mei 26
|
2768 | ||
|
|
0
Mei 26
|
3 |