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

Hey all,

I have the following question:


I have a model called vlabel.products and another model that inherites from res.partner. 

They share a relationship through this line in the vlabel.product model:

related_company = fields.Many2one('res.partner', string='Licencee', required=True)


and this line in the other model:
products = fields.One2many('vlabel.product', 'related_company', string='Products')


Now, for the vlabel.product, I want to display a number that is related to the order from which products were created for related_company, so I guess that would be some kind of index.

Let's say I have a company "Awesome Company" that has four products related to it and I have 4 product records that all belong to the "Awesome Company".

In a show view for the vlabel.product modeI I want to display a number that refers to the order in which these products were created for the specific company.

So, when it was the first product created for this specific company, I want to display a 1. If it was the second product a 2, and so on and so forth. 

This of course means that multiple products can have the same number, which is what I want.

I tried index.method and multiple other ways to get to the number but didn't manage at all. Any help is appreciated.


Greetings

Adrian


アバター
破棄
著作者

push

関連投稿 返信 ビュー 活動
0
3月 15
3983
1
12月 24
30324
2
1月 24
1312
1
1月 22
2474
0
7月 21
4