mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[12.0][IMP] stock_request:
* Add readme autogenerated * Add some hooks * Improve test inheritance (reduce testing time) * Don't allow qty <= 0 * SR expected_date = order expected_date if SRO
This commit is contained in:
@@ -158,6 +158,13 @@ class StockRequest(models.AbstractModel):
|
||||
'same category than the default unit '
|
||||
'of measure of the product'))
|
||||
|
||||
@api.constrains('product_qty')
|
||||
def _check_qty(self):
|
||||
for rec in self:
|
||||
if rec.product_qty <= 0:
|
||||
raise ValueError(_('Stock Request product quantity has to be'
|
||||
' strictly positive.'))
|
||||
|
||||
@api.onchange('warehouse_id')
|
||||
def onchange_warehouse_id(self):
|
||||
""" Finds location id for changed warehouse. """
|
||||
|
||||
Reference in New Issue
Block a user