Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
8660 Ansichten


Hi,


I've got an error and not possible for me to find the cause.


In the view mrp.report_mrporder, i want to keep date order from sale_order since mrp.production

With the following code, it works when i taste it directly in the mrp.report_mrporder view

But i've got error "object unbound" when i add the same code in an XML view which inherit from mrp.report_mrporder

<xpath expr="/t[1]/t[1]/t[1]/t[1]/div[1]/div[3]/div[2]" position="after">

    <div class="col-3">

        <strong>Date Commande:</strong><br/>

        <tr t-foreach="request.env['sale.order'].search([('name','=',o.origin)])" t-as="cde">

            <t t-esc="cde.date_order" t-options='{"widget": "date"}'/>

        </tr>

    </div>

</xpath>


Any idea for this problem ?!

Vincent

Avatar
Verwerfen
Autor

It works, thank you Arya ;)

 

Beste Antwort

In the report, you cannot use the request variable.

Try the following code:

<tr t-foreach="o.env['sale.order'].search([('name','=',o.origin)])" t-as="cde"> 


Avatar
Verwerfen