콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

Hello there :)

I've managed to add some custom code to get some extra fields onto the production order and it's report. Now I thought it would be better if one of the fields would also be on the bill of material, but I have no idea how to get the data from there to the new production order, which is later based on this BoM.

It is a many2one field for which I created a custom model:

class FinishTypes(models.Model):
_name = 'bom.finishtypes'
_description = 'How to finish the edges.'
_rec_name = 'name'

name = fields.Char(string='Finishing Types', help='The way the edges have to be finished, e.g. polished.', required=True)

I then added this field to the mrp.production model: 

class POfinishtypes(models.Model):
_inherit = 'mrp.production'

finish_type_id = fields.Many2one('bom.finishtypes', string='Finishing Types', help='The way the edges have to be finished, e.g. polished.', size=255)

And then I added this field to the PO form and report.

Do I have to make a similar field on the BoM? And if so, how do I get it's data to the production order's draft? I am obviously not a pro developer...

We use Odoo 14 Enterprise, btw.

아바타
취소
관련 게시물 답글 화면 활동
1
10월 24
2051
2
8월 23
43701
2
10월 19
4323
2
10월 19
3788
1
3월 15
10685