Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1000 Vistas

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

Avatar
Descartar
Mejor respuesta

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



Avatar
Descartar

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>