[FIX] stock: return empty recordset if no rule found
When _get_rule does not find any rule, it returns False. This could create some tracebacks as we mostly expect a stock.rule. It will give: if False in <recordset>: Hence a traceback: TypeError: unsupported operand types in: False in stock.rule() By applying these changes will resolve this issue. Sentry-4206998573 closes odoo/odoo#123194 X-original-commit: d6a0b9810ffc7fad68ebf7b13902747d43024455 Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
This commit is contained in:
@@ -502,7 +502,7 @@ class ProcurementGroup(models.Model):
|
||||
""" Find a pull rule for the location_id, fallback on the parent
|
||||
locations if it could not be found.
|
||||
"""
|
||||
result = False
|
||||
result = self.env['stock.rule']
|
||||
location = location_id
|
||||
while (not result) and location:
|
||||
domain = self._get_rule_domain(location, values)
|
||||
|
||||
Reference in New Issue
Block a user