跳至内容
菜单
此问题已终结
2 回复
9066 查看

Say for example I want to show information from res.partner on another model?

形象
丢弃
编写者 最佳答案

Yes – this became possible with version 9.


As long as Model A has a link to Model B via a many2one field, you can add a “related” field to Model A that will hold the data from Model B and allow you to display it in a view based on Model A.

Since a Delivery Order (stock.picking) has a partner_id field relating it back to res.partner, you can add show anything from res.partner via related fields on stock.picking.


·         on the stock.picking model, add a new field x_partner_email:

·         Field Type: char (matches the field type of email on res.partner)

·         Related Field: partner_id.email

 

Now you can add x_partner_email to a stock.picking view and see the email address of the associated partner.

 

形象
丢弃

This was posible in formers versions of odoo too. As far as I now 6.1, 7, 8 have this feature too. It's not new in v9

V9 is the first version I've seen possible through the UI. It has always been possible with code.

最佳答案

you need to use many2one field

Activate the developer mode

Go To Settings ---> Technical ---> database Structure ---> Models  

形象
丢弃

hi mohamed can you please tell me how to make a custom field a being existed in two modules for eg in my case : i create a custom field named " objet " with type many2one on sale order and i want to find the value of this field on the invoice. but i dont know what i should put in the case of related objet see pic here : http://s33.postimg.org/7epcz61dr/obe.png please help me i'm using odoo 9 and i want to do this with developer mode. many thanks

相关帖文 回复 查看 活动
2
4月 24
1216
1
9月 16
9432
0
3月 15
3219
5
4月 20
11427
0
6月 19
4526