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

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
3982
1
12월 24
30313
2
1월 24
1308
1
1월 22
2462
0
7월 21
4