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

I have created a new form and  i choose a PO as a source document and that field is as follow.


purchase_order = fields.Many2one('purchase.order', string='PO Number')

AFTER selecting a PO i want that vendor from that Purchase Order automatically 
fill my vendor field in that form.
i have a simple many2one field for vendors. 
Kindly help me with this problem i shall be very thankful.



아바타
취소
베스트 답변

Hi,

For this you can use the related fields.

purchase_order = fields.Many2one('purchase.order, string="PO")
partner_id = fields.Many2one('res.partner', string="Vendor", related='purchase_order.partner_id')


Thanks

아바타
취소
작성자

hey thanks for replying. it is giving error KeyError: 'purchase_field'. can you tell me what it is?

It's purchase_order.partner_id in the related, see updated Answer

작성자

Man you are awesome! Thank You soo much

관련 게시물 답글 화면 활동
1
12월 20
3674
1
8월 22
4250
2
9월 18
4264
1
3월 24
1419
0
1월 24
1663