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
返信
509
ビュー
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
|
2570 | ||
|
0
11月 15
|
3984 | ||
|
3
9月 25
|
267 | ||
|
1
9月 25
|
307 | ||
|
0
8月 25
|
379 |