تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
8614 أدوات العرض


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

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أبريل 18
33479
3
نوفمبر 24
1717
4
يونيو 24
17474
3
يناير 21
5409
4
أبريل 20
9183