Skip to content

Commit

Permalink
[FIX] ddmrp: readd procure_location argument lost in migration
Browse files Browse the repository at this point in the history
route argument is removed becouse is not used anywhere.

This was lost in migratino to v 16.0.

Original commit details:

[FIX] ddmrp: Check sublocations in Stock Buffers

Sometimes, we want to define a Stock Buffer with entire warehouse visibility but we have Stock Demand Estimates or BoMs defined in sublocations.
This commit allows to see objects defined in sublocations.

Author:    BernatPForgeFlow <[email protected]>
Date:      Mon Jun 5 11:21:34 2023 +0200
  • Loading branch information
LoisRForgeFlow committed Jul 17, 2024
1 parent 34838b4 commit 5f480df
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions ddmrp/models/stock_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2072,14 +2072,9 @@ def cron_ddmrp(self, automatic=False):
def _values_source_location_from_route(self):
return {"warehouse_id": self.warehouse_id}

def _source_location_from_route(self, route=None):
"""Return the replenishment source location for distributed buffers
If no route is passed, it follows the source location of the rules of
all the routes it finds until it can no longer find a path.
If a route is passed, it stops at the final source location of the
rules of this route only.
"""
current_location = self.location_id
def _source_location_from_route(self, procure_location=None):
"""Return the replenishment source location for distributed buffers"""
current_location = procure_location or self.location_id
rule_values = self._values_source_location_from_route()
while current_location:
rule = self.env["procurement.group"]._get_rule(
Expand Down

0 comments on commit 5f480df

Please sign in to comment.