不显示odoo图表视图度量

时间:2016-02-07 18:44:12

标签: view graph openerp measure

型号:

class AdherantsAnimals(models.Model):    

    _name = "adherants.animal"    
    IDENT_id = fields.Many2one(comodel_name='adherants.ident',inverse_name='ANIMAL_ids')    
    IDENT_NAME = fields.Char(related='IDENT_id.NOM',string="Adherant")   
    ANIMAL_TYPE_id = fields.Many2one('adherants.animal.categ',inverse_name='ANIMAL_ids',string="Categorie")    
    TYPE_id = fields.Many2one('adherants.animal.type')    
    TYPE = fields.Char(related="ANIMAL_TYPE_id.TYPE_ids.TYPE",string="Type",store=True)    
    NBR = fields.Integer(string='Totals', required=True)

图表视图:

<record model="ir.ui.view" id="adherants_animal_graph_view">    
    <field name="name">adherants.animal.graph</field>    
    <field name="model">adherants.animal</field>    
    <field name="arch" type="xml">    
    <graph type="pivot">    
         <field name="TYPE" type="row"/>    
         <field name="NBR" type="measure"/>    
    </graph>    
    </field>    
    </record>
问题是图表视图中的as看不到NBR值..

由于

1 个答案:

答案 0 :(得分:0)

NBR = fields.Integer(string='Totals', required=True, store=True)