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

Hello everyone,

I’m trying to display the components (and their lot numbers) of manufactured products directly on the Delivery Slip or Customer Invoice PDF, using Odoo Studio (v19) only — without custom modules.

The goal is straightforward:

When a finished product is delivered or invoiced, the report should show the lot numbers of the components consumed in its manufacturing order.

We’ve tried several approaches through Studio: duplicating the standard reports, adding computed fields, or using server actions to gather the data.

However, we keep running into the same issues:

  • Studio refuses to save the report with errors like “Error while rendering the template” or “Entity ' ' not defined”
  • Or the report saves but the component section stays empty
  • Or we get RPC_ERROR exceptions, usually caused by the QWeb rendering engine limitations in Studio

In short, the XML/QWeb code works perfectly fine in a custom module, but not in Studio — it seems Studio doesn’t support nested loops such as:

t-foreach="move.production_id.move_raw_ids.mapped('move_line_ids')"

👉 Has anyone managed to display the component lots linked to a manufactured product in a Delivery Slip or Invoice purely using Odoo Studio?

Is there any known workaround or recommended approach to bypass the QWeb limitations (for example, by preparing the data in a computed field or a server action)?

Thanks in advance for your insights or shared experiences!

— Franck

Avatar
Verwerfen
Beste Antwort

Hi,


Odoo Studio has strict technical limitations that make it unsuitable for handling complex QWeb loops or deep relational traversals, such as linking delivery lines to manufacturing orders and their component lot numbers. While this type of nested logic (t-foreach="move.production_id.move_raw_ids.mapped('move_line_ids')") works fine in a custom module, Studio’s sandboxed environment blocks such operations for safety and performance reasons. This results in common issues like rendering errors, empty report sections, or RPC errors when trying to display component and lot details directly in a report.


To work around these restrictions, the best approach is to precompute and flatten the data before displaying it. One option is to create a computed text field on the related record (e.g., delivery or invoice line) that aggregates all component and lot details into a readable string such as “Component A (Lot 123), Component B (Lot 456).” This field can be populated through an automated or server action triggered when the manufacturing order is completed. Once the data is stored in a single field, you can easily include it in your report using Studio without any nested loops.


Alternatively, you can create a simple custom model in Studio to store these precomputed component-lot details and link it as a one2many relation to the delivery or invoice record. This allows you to use a single-level t-foreach loop, which Studio supports safely. In summary, since Studio cannot handle deep relational logic inside reports, the most reliable way to display manufacturing component lots on delivery slips or invoices is to prepare the data in advance and store it in a field that can be directly printed.



Hope it helps

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
3
Nov. 22
5143
3
Juli 19
7085
2
Okt. 18
4171
1
März 15
4823
2
Juli 25
3352