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:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
1
回复
437
查看
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
11月 22
|
2471 | ||
|
0
11月 15
|
3927 | ||
|
0
8月 25
|
192 | ||
|
0
8月 25
|
165 | ||
|
2
8月 25
|
691 |