Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
5906 Переглядів

The picking report document (stock.report_picking) has the following loop inside the table that print out the lines of the report:

 <t t-foreach="o.move_ids_without_package.sorted(key=lambda m: m.product_id.id)" t-as="move">

                                        <!-- In case you come accross duplicated lines, ask NIM or LAP -->

                                        <t t-foreach="move.move_line_ids.sorted(key=lambda ml: ml.location_id.id)" t-as="ml">


--------------------------------------------------------------------------------------------------------

How can I modify these lines of code to sort by WH location which has this area below inside the table:


<td t-if="o.picking_type_id.code != 'incoming'" groups="stock.group_stock_multi_locations">

                                                    <span t-esc="ml.location_id.display_name"/>

                                                        <t t-if="ml.package_id">

                                                            <span t-field="ml.package_id"/>

                                                        </t>

                                                </td>


I need to be able to sort the location by descending order ( https://imgur.com/pAyX8aB ) so that the highest alphabet comes on top before others. 

Thanks for your time. 

Аватар
Відмінити
Найкраща відповідь

Hello,

<t t-foreach="move.move_line_ids.sorted(key=lambda ml: ml.location_id.name , reverse=True)" t-as="ml">

please try this for sort the location by descending order.

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
вер. 24
1871
1
серп. 23
2297
2
трав. 23
1785
1
бер. 23
1655
2
груд. 22
5351