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
- 회계
- 재고 관리
- PoS
- Project
- MRP
신고된 질문입니다
1
회신
651
화면
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
|
2858 | ||
|
0
11월 15
|
4154 | ||
|
1
9월 25
|
751 | ||
|
2
9월 25
|
355 | ||
|
2
9월 25
|
385 |