Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
8577 Lượt xem


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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Mostafa,

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


Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 18
33427
3
thg 11 24
1681
4
thg 6 24
17419
3
thg 1 21
5376
4
thg 4 20
9156