Skip to content

Commit c6a166a

Browse files
alfredoavanzoscanajuaristi
authored andcommitted
[16.0][FIX] stock_picking_sorted: Fix "sorted" command when field has no value.
1 parent d801d65 commit c6a166a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

stock_picking_sorted/report/report_stock_picking_operations.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<t t-as="ml" position="attributes">
55
<attribute
66
name="t-foreach"
7-
>o.move_line_ids_without_package.sorted(lambda ml: (ml.move_id.categ_id.display_name, ml.move_id.product_brand_id.name, ml.product_id.display_name))</attribute>
7+
>o.move_line_ids_without_package.sorted(lambda ml: (ml.move_id.categ_id.display_name or '', ml.move_id.product_brand_id.name or '', ml.product_id.display_name or ''))
8+
</attribute>
89
</t>
910
<!--
1011
<xpath expr="//thead/tr/th[4]" position="attributes">
@@ -21,21 +22,21 @@
2122
<t
2223
t-if="lines"
2324
t-set="lines"
24-
t-value="lines.sorted(lambda m: (m.categ_id.display_name, m.product_brand_id.name, m.product_id.display_name))"
25+
t-value="lines.sorted(lambda m: (m.categ_id.display_name or '', m.product_brand_id.name or '', m.product_id.display_name or ''))"
2526
/>
2627
</t>
2728
<t t-set="package_move_lines" position="after">
2829
<t
2930
t-if="package_move_lines"
3031
t-set="package_move_lines"
31-
t-value="package_move_lines.sorted(lambda ml: (ml.move_id.categ_id.display_name, ml.move_id.product_brand_id.name, ml.product_id.display_name))"
32+
t-value="package_move_lines.sorted(lambda ml: (ml.move_id.categ_id.display_name or '', ml.move_id.product_brand_id.name or '', ml.product_id.display_name or ''))"
3233
/>
3334
</t>
3435
<t t-set="move_lines" position="after">
3536
<t
3637
t-if="move_lines"
3738
t-set="move_lines"
38-
t-value="move_lines.sorted(lambda ml: (ml.move_id.categ_id.display_name, ml.move_id.product_brand_id.name, ml.product_id.display_name))"
39+
t-value="move_lines.sorted(lambda ml: (ml.move_id.categ_id.display_name or '', ml.move_id.product_brand_id.name or '', ml.product_id.display_name or ''))"
3940
/>
4041
</t>
4142
<xpath
@@ -44,13 +45,13 @@
4445
>
4546
<attribute
4647
name="t-foreach"
47-
>o.move_line_ids.sorted(lambda ml: (ml.move_id.categ_id.display_name, ml.move_id.product_brand_id.name, ml.product_id.display_name))</attribute>
48+
>o.move_line_ids.sorted(lambda ml: (ml.move_id.categ_id.display_name or '', ml.move_id.product_brand_id.name or '', ml.product_id.display_name or ''))</attribute>
4849
</xpath>
4950
<t t-set="bo_lines" position="after">
5051
<t
5152
t-if="bo_lines"
5253
t-set="bo_lines"
53-
t-value="bo_lines.sorted(lambda m: (m.categ_id.display_name, m.product_brand_id.name, m.product_id.display_name))"
54+
t-value="bo_lines.sorted(lambda m: (m.categ_id.display_name or '', m.product_brand_id.name or '', m.product_id.display_name or ''))"
5455
/>
5556
</t>
5657
</template>

0 commit comments

Comments
 (0)