diff options
| author | Goffin Simon <sig@odoo.com> | 2019-07-17 12:57:38 +0000 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2019-07-31 12:09:57 +0000 |
| commit | e5a8b0632f052d5b38f065b78616e224b0b0c380 (patch) | |
| tree | 526f45ba1e857299e60744f80016fd15b8a81e3c | |
| parent | 1b1175556b82470b37786abc9035e3b73ad3beae (diff) | |
[FIX] stock_dropshipping: Dropship created after editing an existing quotation
Steps to reproduce the bug:
- Create a quotation and a SO line SOL with one product and route "Dropship"
- Confirm the SO and a PO is created
- Validate PO and process the dropship picking
- Add 4 units to the SO line SOL
Bug:
A new PO was created but the related picking was type "Receipts" instead of "Dropship"
opw:2034398
closes odoo/odoo#35323
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
| -rw-r--r-- | addons/sale_purchase/models/sale_order.py | 4 | ||||
| -rw-r--r-- | addons/stock_dropshipping/tests/test_dropship.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/sale_purchase/models/sale_order.py b/addons/sale_purchase/models/sale_order.py index 8960907f9ed..0b85753411f 100644 --- a/addons/sale_purchase/models/sale_order.py +++ b/addons/sale_purchase/models/sale_order.py @@ -114,8 +114,8 @@ class SaleOrderLine(models.Model): decreased_values = {} if 'product_uom_qty' in values: precision = self.env['decimal.precision'].precision_get('Product Unit of Measure') - increased_lines = self.sudo().filtered(lambda r: r.purchase_line_count and float_compare(r.product_uom_qty, values['product_uom_qty'], precision_digits=precision) == -1) - decreased_lines = self.sudo().filtered(lambda r: r.purchase_line_count and float_compare(r.product_uom_qty, values['product_uom_qty'], precision_digits=precision) == 1) + increased_lines = self.sudo().filtered(lambda r: r.product_id.service_to_purchase and r.purchase_line_count and float_compare(r.product_uom_qty, values['product_uom_qty'], precision_digits=precision) == -1) + decreased_lines = self.sudo().filtered(lambda r: r.product_id.service_to_purchase and r.purchase_line_count and float_compare(r.product_uom_qty, values['product_uom_qty'], precision_digits=precision) == 1) increased_values = {line.id: line.product_uom_qty for line in increased_lines} decreased_values = {line.id: line.product_uom_qty for line in decreased_lines} diff --git a/addons/stock_dropshipping/tests/test_dropship.py b/addons/stock_dropshipping/tests/test_dropship.py index f70897f9eb8..9048fb2d009 100644 --- a/addons/stock_dropshipping/tests/test_dropship.py +++ b/addons/stock_dropshipping/tests/test_dropship.py @@ -45,7 +45,7 @@ class TestDropship(common.TransactionCase): self.assertAlmostEqual(po_line.product_qty, 1.00) # Update qty on SO and check PO - so.order_line.product_uom_qty = 2.00 + so.write({'order_line': [[1, so.order_line.id, {'product_uom_qty': 2.00}]]}) self.assertAlmostEqual(po_line.product_qty, 2.00) # Create a new so line |
