diff options
| author | Prakash Prajapati <ppr@odoo.com> | 2019-01-30 10:16:14 +0000 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2019-02-01 10:36:14 +0000 |
| commit | 8a25e58ed2848705fa905446212c47fdf3205afa (patch) | |
| tree | a01694c103154bc70419292ab65250bf76b360df /addons | |
| parent | ff368fdbd5db8c97e25bf385f3d8573c284d91b5 (diff) | |
[FIX] purchase_requisition_stock: onchange and picking type
Issue:
- Create a RFQ for a stockable product
- Try to validate
- A required field "deliver to" (picking_type_id) is not set
Rev [1] moved the stock related part of purchase_requisition to
purchase_requisition_stock.
It implements an onchange on the purchase order setting the
picking_type_id of the one of the requisition. When no requisition is
set, it wiped the default one.
We fix the issue by only using the picking type of the requisition if a
requisition is actually set.
[1] 826f927a1ed54f6e2468e8f3b8649c1b7cfdf04b
Task: 1935077
closes odoo/odoo#30685
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/purchase_requisition_stock/models/purchase.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/purchase_requisition_stock/models/purchase.py b/addons/purchase_requisition_stock/models/purchase.py index 344fc1b8ea7..9debe4e8297 100644 --- a/addons/purchase_requisition_stock/models/purchase.py +++ b/addons/purchase_requisition_stock/models/purchase.py @@ -10,4 +10,5 @@ class PurchaseOrder(models.Model): @api.onchange('requisition_id') def _onchange_requisition_id(self): super(PurchaseOrder, self)._onchange_requisition_id() - self.picking_type_id = self.requisition_id.picking_type_id.id + if self.requisition_id: + self.picking_type_id = self.requisition_id.picking_type_id.id |
