Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
998 Widoki

Is there a way to sort the products listed on the manufacturing order in ascending and print a report in this order?

Awatar
Odrzuć
Najlepsza odpowiedź

Hi @Chantal Doucet

Hope you are doing well

For you to sort the products on MO in ascending and print on the report, you will need to inherit the report_mrporder template and make below changes to it for sorting the product on report.

Please find code in comment.

I hope this would be helpful.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari



Awatar
Odrzuć

Please find code here :-

<template id="report_mrporder_sorted" inherit_id="mrp.report_mrporder">
<xpath expr="//t[@t-if='o.move_raw_ids']/tr" position="attributes">
<attribute name="t-foreach">o.move_raw_ids.filtered(lambda m: m.state != 'cancel').sorted(key=lambda m: m.product_id.name)</attribute>
</xpath>
</template>