Skip to content
Permalink
Browse files

[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
  • Loading branch information...
svs-odoo committed Mar 19, 2019
1 parent 3cbb8d5 commit ec10bca1cf70815a1c99b1ee45694d4389f3844e
Showing with 6 additions and 7 deletions.
  1. +5 −6 addons/stock/report/report_stock_rule.py
  2. +1 −1 addons/stock/report/report_stock_rule.xml
@@ -34,14 +34,13 @@ def _get_report_values(self, docids, data=None):
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>

0 comments on commit ec10bca

Please sign in to comment.
You can’t perform that action at this time.