フィールドに操作*をしようとしていますが、機能フィールドを試しましたが機能しませんでしたが、今はこの@ api.depends APIを試しています。 odoo 8で作業しますか?それはまだ古いAPIで機能フィールドodooタイプfloat、新しいAPI
class fleuret(osv.Model):
_inherit = "mrp.bom.line"
_columns = {
'unit_price' : fields.float(string='unit price', related='product_id.lst_price', store=True, readonly=True),
'amount' : fields.Float(string='price ',store=True, readonly=True,digits=dp.get_precision('Account'),compute='_compute_price'),
}
@api.one
@api.depends('product_qty')
def _compute_price(self):
self.amount =(unit_price * self.product_qty)
に動作しない 'Float'は小文字でなければなりません、あなたは新しいものと古いAPIの間で混合されています。 – Zety