Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2237 Представления

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>


Аватар
Отменить
Лучший ответ

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,

Аватар
Отменить