Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2240 Zobrazení

Hi! I'm creating a report en odoo with Qviews and I have problems with call fields from other models. For example , I want to access the field "origin " of the table stock_move since the sale.order model.


Please need help with this. Thanks!!


<?xml version="1.0"?>

<t t-name="sale.another_report">

<t t-foreach="docs" t-as="o">

<div class="page">

<div class="header">

<div class="row">

<div class="col-xs-4 col-xs-offset-6">

<img src="#"/>

</div>

</div>

</div>

<div class="body">

<div class="col-xs-12">

<p>Order Number: <span t-field="o.name"/></p>

</div>

<div class="col-xs-12">

<p>Origin: <span t-field="NEED ACCESS SINCE SALE MODEL TO STOCK MODEL FOR THE "Origin" FIELD (stock_move table)"/></p>

</div>

<div class="col-xs-12">

<p>Customer: <span t-field="o.partner_id"/> </p>

</div>

<div class="col-xs-12">

<p>Product Name: <span t-field="o.product_id.name_template"/> </p>

</div>

</div>

</div>

</t>

</t>


Avatar
Zrušit
Nejlepší odpověď

Hello,

In this case, the origin in the stock picking corresponds to the sale order name, so there's no need to retrieve it from the stock move.

But the answer is  this:

<p>Origin: <span t-field="o.picking_ids.move_lines.origin"/></p>

Best regards,

Avatar
Zrušit