Skip to Content
Menu
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
Related Posts Replies Views Activity
0
Sep 24
132
1
Jul 22
2066
1
Jun 22
644
0
Jun 22
1073
1
Nov 21
633