Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1880 Zobrazení

help me detect error here:


def calculTemps(self):

        total = 0

        for rec in self:

            self.env.cr.execute("""select sum(b.hours) as hours from fly_ligne_pilote a, fly_vol b where a.vol_id = b.id and a.pilote_id = '%s' GROUP BY a.pilote_id """, str(self.id))

            results = self.env.cr.fetchall()

            total = results[0]

            rec.update({'hours': total})

    hours = fields.Char('Temps de vol', compute='calculTemps') 

Avatar
Zrušit