mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
fix default_get to ensure product_qty is not set
This commit is contained in:
committed by
Alexandre Fayolle
parent
2cec2e50ff
commit
b664229bb9
@@ -59,6 +59,17 @@ class StockReservation(models.Model):
|
||||
select=1)
|
||||
date_validity = fields.Date('Validity Date')
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
"""
|
||||
Ensure default value of computed field `product_qty` is not set
|
||||
as it would raise an error
|
||||
"""
|
||||
res = super(StockReservation, self).default_get(fields_list)
|
||||
if 'product_qty' in res:
|
||||
del res['product_qty']
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def get_location_from_ref(self, ref):
|
||||
""" Get a location from a xmlid if allowed
|
||||
|
||||
Reference in New Issue
Block a user