[FIX] stock: traceback on routes report
As putaway strategies were replaced by putaway rules, some properties were renamed but were unchanged in the report, causing traceback. opw-1957005 closes odoo/odoo#31938 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
@@ -34,14 +34,13 @@ class ReportStockRule(models.AbstractModel):
|
||||
for location in locations:
|
||||
# TODO: group the RR by location_id to avoid a filtered at each loop
|
||||
rr = reordering_rules.filtered(lambda r: r.location_id.id == location.id)
|
||||
if location.putaway_strategy_id or rr:
|
||||
putaways = product.putaway_rule_ids.filtered(lambda p: p.location_in_id.id == location.id)
|
||||
if putaways or rr:
|
||||
header_lines[location.id] = {'putaway': [], 'orderpoint': []}
|
||||
if location.putaway_strategy_id:
|
||||
putaway = location.putaway_strategy_id._get_putaway_rule(product)
|
||||
for putaway in putaways:
|
||||
header_lines[location.id]['putaway'].append(putaway)
|
||||
if rr:
|
||||
for r in rr:
|
||||
header_lines[location.id]['orderpoint'].append(r)
|
||||
for r in rr:
|
||||
header_lines[location.id]['orderpoint'].append(r)
|
||||
route_lines = []
|
||||
colors = self._get_route_colors()
|
||||
for color_index, route in enumerate(routes):
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<t t-foreach="header_lines[location.id]['putaway']" t-as="lines">
|
||||
<t t-foreach="lines" t-as="line">
|
||||
<div class="o_report_stock_rule_putaway" t-att-res-id="location.id" t-att-res-model="location._name" view-type="form">
|
||||
<p>Putaway: <t t-esc="line.fixed_location_id.display_name"/></p>
|
||||
<p>Putaway: <t t-esc="line.location_out_id.display_name"/></p>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user