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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Účetnictví
- Sklad
- PoS
- Project
- MRP
This question has been flagged
1
Odpovědět
364
Zobrazení
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.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Přihlásit seRelated Posts | Odpovědi | Zobrazení | Aktivita | |
---|---|---|---|---|
|
2
lis 22
|
2407 | ||
|
0
lis 15
|
3888 | ||
|
2
srp 25
|
327 | ||
|
0
čvc 25
|
469 | ||
|
1
čvc 25
|
888 |