Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
8519 Представления


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

Related Posts Ответы Просмотры Активность
0
апр. 18
33317
3
нояб. 24
1612
4
июн. 24
17320
3
янв. 21
5303
4
апр. 20
9102