Skip to content
Snippets Groups Projects
Commit b9e3c153 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] stock_dropshipping: consolidated lines

- Create a SO with 2 lines of the same product (set route as Drop Ship)
- At validation, both lines are merged into a single line in the PO

As a result, one SO line will be over-delivered, and the other
under-delivered.

Two lines should be kept in the PO.

opw-1928702

closes odoo/odoo#30800
parent 64f06858
Branches
Tags
No related merge requests found
......@@ -16,6 +16,12 @@ class PurchaseOrderLine(models.Model):
re['sale_line_id'] = self.sale_line_id.id
return res
def _merge_in_existing_line(self, product_id, product_qty, product_uom, location_id, name, origin, values):
if values.get('route_ids') and values['route_ids'] == self.env.ref('stock_dropshipping.route_drop_shipping'):
return False
return super(PurchaseOrderLine, self)._merge_in_existing_line(
product_id=product_id, product_qty=product_qty, product_uom=product_uom,
location_id=location_id, name=name, origin=origin, values=values)
class ProcurementRule(models.Model):
_inherit = 'procurement.rule'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment