Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
8544 Prikazi


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
Opusti
Best Answer

Hello Mostafa,

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


Thanks

Avatar
Opusti
Avtor

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

Related Posts Odgovori Prikazi Aktivnost
0
apr. 18
33354
3
nov. 24
1631
4
jun. 24
17364
3
jan. 21
5334
4
apr. 20
9128