0
比如我想要得到的稅值隨就像一個價格值乘以:如何從Odoo 8中的模型獲取記錄到另一個模型的值?
class tax(models.Model):
_name = 'tax'
tax = fields.Float('tax')
class daily_transaction(models.Model):
_name = "daily.transaction"
total = fields.Float('total')
price = fields.Float(compute ='adding')
@api.multi
def adding(self):
ids =[1,2,3]
tax = self.env['tax'].browse(ids)
for record in self:
record.total = record.price * float(tax.tax(1))
我得到的錯誤ValueError異常
Expected singleton: tax(1, 2, 3)