コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3884 ビュー

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
3671
1
8月 22
4245
2
9月 18
4262
1
3月 24
1416
0
1月 24
1662