コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
218 ビュー

Hello everbody,

I can no longer insert order line fields into Studio reports directly via visual editing. After /fields, only the linked order lines are visible, not the actual order lines, and all the tested fields don't return a value.

Does anyone know how to get the editing back to how it was in V18?

Many thanks in adavance

アバター
破棄
著作者

Hi, Thanks for your reply. So you confirm in essence that the report "builder" is no longer working for sales line? :-(

最善の回答

Hi,

Steps:

1. Activate Developer Mode in Odoo (Settings → Activate the developer/ debug mode).

2. Open the document/report you want to modify (e.g., a Quotation or Sales Order).

3. Click the Studio icon (top-right) to enter Studio for that model/view.

4. In Studio, open the Reports

5. Find the report template you want to edit (e.g., Sale Order / Quotation document). Click Edit.

Insert a t-foreach loop over o.order_line where you want the lines to appear. Example snippet to paste inside the <tbody> of your lines table:


<t t-foreach="o.order_line" t-as="line">

  <tr>

    <td><t t-esc="line.product_id.display_name"/></td>

    <td class="text-center"><t t-esc="line.product_uom_qty"/></td>

    <td class="text-right"><t t-esc="line.price_unit"/></td>

    <td class="text-right">

      <t t-esc="(line.price_unit * line.product_uom_qty)"/>

    </td>

  </tr>

</t>



Save the template in Studio, then Preview the report (Studio has a preview button) or close Studio and print a real document to test.


Hope it helps.

アバター
破棄