Skip to Content
Menu
This question has been flagged
1137 Views

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 ?

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 24
1480
1
Nov 24
1184
2
Sep 24
1046
1
Aug 24
2449
3
Aug 24
2681