[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
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user