Python @api.1依赖于非存储字段不工作

Python @api.1依赖于非存储字段不工作,python,field,store,odoo-10,computed-field,Python,Field,Store,Odoo 10,Computed Field,我需要存储一个计算字段,以便在树状图中的group by中使用它,问题是一旦我添加store=True,该字段就不会更新并返回0,即使使用@api.depends 注:金额总和也是一个计算字段,所以可能这就是问题所在,请帮我解决 这是我的密码: @api.one @api.depends('amount_total') def check_negatif_or_positif(self): if (self.picking_type_id.name =='Receptions'):

我需要存储一个计算字段,以便在树状图中的group by中使用它,问题是一旦我添加store=True,该字段就不会更新并返回0,即使使用@api.depends

注:金额总和也是一个计算字段,所以可能这就是问题所在,请帮我解决

这是我的密码:

@api.one
@api.depends('amount_total')
def check_negatif_or_positif(self):
    if (self.picking_type_id.name =='Receptions'):
        self.amount_calcul = self.amount_total * (-1) 

    else:
        self.amount_calcul = self.amount_total 

 amount_calcul= fields.Float(compute='check_negatif_or_positif ,string='Amount' ,store=True)

感谢存储您的计算字段,请在字段中给出readonly=False