This question has been flagged

I'm want the sale order/quotation form to sort on a field I made in studio.

In the delivery slip it works with the following code:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
        <template id="report_delivery_document_inh" inherit_id="stock.report_delivery_document">
                <xpath expr="//tr[@t-foreach='lines']" position="attributes">
                        <attribute name="t-foreach">lines.sorted(key=lambda l: (l.product_id.x_studio_many2one_field_qllol.x_name), reverse=False)</attribute>
                </xpath>
            </template>
</odoo>



The code for the saleorder/qoutation is as follows:

<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <template id="sale.report_saleorder_document_ihn" inherit_id="  sale.report_saleorder_document">

        <xpath expr="//tr[@t-foreach='lines']" position="attributes">

            <attribute name="t-foreach">lines.sorted(key=lambda l: (l.product_id.x_studio_many2one_field_qllol.x_name), reverse=False)</attribute>

        </xpath>

    </template>

</odoo>



The manifest file:

{
'name': 'Bluezebra Extension',
'category': '',
'version': '14.0.0.1',
'author': '',
'description': """""",
'sequence': '1',
'depends': ['product'],
'data': [
'report/report_deliveryslip.xml',
'report/report_sale_order.xml',
],
}


I tried to force an update with odoo-bin -d <database> -u <module name>


What am I doing wrong?


Bouke

Avatar
Discard