Hello everyone,
I am working on Odoo 16 (Enterprise Edition on odoo.sh) and currently facing an issue with retrieving and displaying the owner_id field from the stock.move.line model within the pos.order.line model through a related field.
Current Flow:
I am attempting to fetch the owner_id field from the stock.move.line model and display it in the pos.order.line model. My goal is to show the correct owner of the stock movement (as seen in the stock picking’s "Move History" after a POS sale) in the corresponding POS order lines.
Challenge:
I have tried using several combinations of related fields, but I haven’t been able to display the correct owner_id in the POS order lines. The owner data retrieved is not accurate, and I suspect that the link between pos.order.line and stock.move.line is not correctly established.
Expected Flow:
What I would like to achieve is a related field within pos.order.line that accurately links to the owner_id (or "From Owner") field in the stock.move.line model. This field should display the ownership information correctly for each POS order line in the view.
Current Approach:
Initially, I would prefer to implement this using Odoo Studio, which is the method I am currently trying. However, I am open to creating a custom module if that would be a more suitable or effective solution.
I would really appreciate any guidance on how to establish the correct relationship between these models. Also, would automation rules or specific field paths through Odoo Studio help resolve this issue? Any additional information on achieving this would be highly helpful.
Thanks in advance!