Skip to Content
Menu
This question has been flagged
600 Views

Voici le code :

class PriceResourcesReport(models.Model):
     _name = 'price.resources.report'
     _description = "Resource Prices Model"
     _auto = False  
     _rec_name = "id"
     
     provider_id = fields.Many2one(comodel_name='res.partner', string='Partner',readonly=True)
     resname = fields.Char(string='Partner Name',readonly=True)
     tarifs = fields.Float(string='Word Rate',readonly=True)
    
def _select(self):
        select_str = """
        SELECT
                partners.id as id,
                partners.name as resname,
                prix.prix_mot as tarifs
                
            FROM
                res_partner as partners
            LEFT JOIN
                res_prixcombination as prix ON prix.id_partner = partners.id where partners.is_supplier=True
            
        """      
        return select_str
        
def _order_by(self):
        order_by_str = """
                ORDER BY
                    partners.id
        """
        return group_by_str
        
def init(self):
        tools.drop_view_if_exists(self._cr, self._table)
        self._cr.execute("""
            CREATE view %s as
              %s
                %s
        """ % (self._table, self._select(),self._group_by()))
 Le serveur est redémarré et le module est mis à jour mais rien ne se passe. Même pas une erreur.

Votre aide me sera salutaire.

Merci d'avance

Avatar
Discard