Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1760 Переглядів

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 ?

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
вер. 25
3391
0
серп. 25
897
1
серп. 25
3165
2
лип. 25
8783
2
лип. 25
5140