[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:
hveficent
2019-08-01 10:25:47 +02:00
committed by Kitti U
parent 8c5c746bb1
commit 957559d0f2
11 changed files with 605 additions and 37 deletions

View File

@@ -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. """