Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
8469 Widoki


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


Awatar
Odrzuć
Najlepsza odpowiedź

Hello Mostafa,

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


Thanks

Awatar
Odrzuć
Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
0
kwi 18
33223
3
lis 24
1572
4
cze 24
17229
3
sty 21
5257
4
kwi 20
9064