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

Hallo everybody, please be kind and let me know, how to link a custom field from two tables/models, for example a new field from res.partner in sales.order

my case, I add a new field, family_name, in res.partner and then I want to call that field in sales.order. I did, many2one relationship in model sales.oder. but, it doesn't show the value.

Please show me how it works and wish you have a good Karma. Thanks In advance

アバター
破棄
最善の回答

For that you can use fields.related in sale.order.

Try this:

' partner_family_name': fields.related('partner_id', ' family_name', type='char', string='Partner Family Name', readonly=True, store=True),

fields.related is a field that points to some data inside another field of the current record.

Example:

_columns = { 'partner_id': fields.many2one('res.partner', 'Partner'), 'partner_name': fields.related('partner_id', 'name', type='char', string='Partner Name'), }

Here Related Field you can find more about fields.related.

アバター
破棄
著作者

Hi Sudhir thank you so much for your respond. I'm not programmer. I do customizing in the Web platform. So I add a new field x_family_name which is custom field. How do I do that in the Setting? hope you can help me. Thank you!

関連投稿 返信 ビュー 活動
1
6月 23
2267
1
4月 23
11339
1
6月 22
2578
2
8月 20
9047
1
11月 19
5621