Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
8607 มุมมอง


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
33473
3
พ.ย. 24
1712
4
มิ.ย. 24
17464
Can't Update Quantity on Hand Odoo 13 EE แก้ไขแล้ว
3
ม.ค. 21
5406
4
เม.ย. 20
9181