
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.
لقد تم الإبلاغ عن هذا السؤال
1
الرد
1720
أدوات العرض
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
نوفمبر 22
|
4285 | ||
|
|
0
نوفمبر 15
|
5462 | ||
|
|
1
يونيو 26
|
1324 | ||
|
|
1
مايو 26
|
2822 | ||
|
|
0
مايو 26
|
3 |