📅  最后修改于: 2022-03-11 14:45:32.134000             🧑  作者: Mango
class cars(models.Model): _name = 'cars'_inherit = “product.template”factor = fields.Float(string="", required=False, )suggeted_price = fields.Float(string="", required=False, compute=car_price )@api.one@api.depends('factor')def car_price(self):if self.factor:self.suggeted_price = self.factor * self.standard_price return