Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
8484 Zobrazení


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


Avatar
Zrušit
Nejlepší odpověď

Hello Mostafa,

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


Thanks

Avatar
Zrušit
Autor

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

Related Posts Odpovědi Zobrazení Aktivita
0
dub 18
33256
3
lis 24
1585
4
čvn 24
17271
3
led 21
5269
4
dub 20
9079