mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Remove loop and use correct decorator
This commit is contained in:
@@ -29,7 +29,7 @@ class ProductTemplate(models.Model):
|
||||
"""
|
||||
_inherit = 'product.template'
|
||||
|
||||
@api.multi
|
||||
@api.one
|
||||
@api.depends('virtual_available')
|
||||
def _immediately_usable_qty(self):
|
||||
"""No-op implementation of the stock available to promise.
|
||||
@@ -38,8 +38,7 @@ class ProductTemplate(models.Model):
|
||||
|
||||
Must be overridden by another module that actually implement
|
||||
computations."""
|
||||
for product in self:
|
||||
product.immediately_usable_qty = product.virtual_available
|
||||
self.immediately_usable_qty = self.virtual_available
|
||||
|
||||
|
||||
immediately_usable_qty = fields.Float(
|
||||
|
||||
Reference in New Issue
Block a user