跳至內容
選單
此問題已被標幟
1751 瀏覽次數

I have a model DrawingRequest


class DrawingRequest(models.Model):

[...]

drawings = fields.One2many('drawing.document', 'drawing_request_id', string='Drawings', tracking=True)

and a model drawing document


class DrawingDocument(models.Model):

_name = 'drawing.document'

_order = 'sequence,id'



sequence = fields.Integer('Sequence')

document = fields.Binary(string='Document', attachment=True)

filename = fields.Char('Filename')

drawing_request_id = fields.Many2one(

'drawing.request', "Drawing request", tracking=True)



I  would  like  to  refer  to  the  'first'  (they  are  sequenced)  DrawingDocument  from  my  DrawingRequest  


What is the easiest way to refer to this first DrawingDocument from a tree list of DrawingRequests ?

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
9月 25
3361
0
8月 25
874
1
8月 25
3128
2
7月 25
8763
2
7月 25
5115