跳至內容
選單
此問題已被標幟
1 回覆
8523 瀏覽次數


class ProductTemplate(models.Model):
_inherit = 'product.template'

qty = fields.Float(compute='_calculate',store=True)
@api.multi
@api.depends('qty_available')
def _calculate(self):

for rec in self:

if rec.qty_available:

rec.qty = rec.qty_available


頭像
捨棄
最佳答案

Hello Mostafa,

Check these answers: https://stackoverflow.com/questions/31945069/odoo-computed-fields-works-without-store-true-doesnt-work-with-store-true


Thanks

頭像
捨棄
作者

i found it the problem with qty_available which field shoud i use in @api.depends(' ') when quantity on hand change

相關帖文 回覆 瀏覽次數 活動
0
4月 18
33318
3
11月 24
1614
4
6月 24
17327
3
1月 21
5305
4
4月 20
9102