[FIX] purchase_requisition: Use correct UoM field

uom_po_id is the 'Purchase Unit of Measure' and is required so should be used
here.
This way, the onchange matches the behaviour of purchase module or the reset of
the purchase_requisition code

closes odoo/odoo#29717

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
Swapnesh Shah
2019-03-07 08:45:42 +00:00
committed by Martin Trigaux
parent dcf8c67fe3
commit b8ff6754fb
@@ -265,7 +265,7 @@ class PurchaseRequisitionLine(models.Model):
@api.onchange('product_id')
def _onchange_product_id(self):
if self.product_id:
self.product_uom_id = self.product_id.uom_id
self.product_uom_id = self.product_id.uom_po_id
self.product_qty = 1.0
if not self.schedule_date:
self.schedule_date = self.requisition_id.schedule_date