Read Group Method In Odoo || Odoo Read Group Method || Odoo ORM Methods

Поділитися
Вставка
  • Опубліковано 5 жов 2024

КОМЕНТАРІ • 10

  • @hectorherrera4193
    @hectorherrera4193 Рік тому

    Excelente explicacion ... Cada vez que veo tus videos aprendo algo nuevo. Gracias por compartir

  • @UtsavKumarMalviya
    @UtsavKumarMalviya Рік тому +2

    nice video, it was a complicated topic you explain very well

  • @danakaplan7738
    @danakaplan7738 9 місяців тому +1

    Clear explanation. Thank you

  • @venkateshajjs5014
    @venkateshajjs5014 Рік тому +1

    thank you so much for this video brother .. it helps a lot to me ........

  • @kenwoychesko2163
    @kenwoychesko2163 Рік тому

    Fantastic explanation -- thank you!

  • @aunnfriends
    @aunnfriends 2 роки тому

    Here is my prefer way to force myself to deal with 'self' as a recordset to avoid singleton error when dealing with it. (on a different note, I have used account_count in _order before and it has store=True and the error is not getting triggered. Only when I remove store=True, the 0 appointment error is triggered but now I lost the _order with the appointment_count)
    @api.depends('appointment_ids')
    def _compute_appointment_count(self):
    recordsets = self
    appointment_group = self.env['hospital.appointment'].read_group(
    domain=[('state', '=', 'done')], fields=['patient_id'], groupby=['patient_id'])
    for appointment in appointment_group:
    print('HospitalPatient _compute_appointment_count : ', appointment)
    patient_id = appointment.get('patient_id')[0]
    patient_rec = recordsets.browse(patient_id)
    patient_rec.appointment_count = appointment['patient_id_count']
    recordsets -= patient_rec
    for rec in recordsets:
    print('HospitalPatient _compute_appointment_count : ', rec.name)
    rec.appointment_count = 0