Hello,
I want to to show discount, price sell, etc. in delivery order. So I have to connect sale.order.line with stock.pack.operation.
Unfortunately, there is no easy and proper way to do that.
In fact, there is a link between them :
stock_pack_operation---(picking_id+produc_id)--->stock_move--(procurement_id)--->procurement_order---(sale_line_id)--->sale_order_line
Here my SQL request (notice that I had state='assigned' for stock_move):
SELECT DISTINCT a.id, a.product_qty, a.state, a.procurement_id, a.product_id, a.picking_id, b.id, b.product_qty, b.picking_id, c.id, c.sale_line_id, c.origin, c.product_qty, d.id, d.product_uom_qty, d.price_unit, d.price_subtotal, d.discount FROM stock_move a, stock_pack_operation b, procurement_order c, sale_order_line d WHERE a.picking_id = b.picking_id AND a.product_id = b.product_id AND a.state = 'assigned' AND a.procurement_id = c.id AND c.sale_line_id = d.id |
Here, I could show price and discount on delivery order, even if there are 2 same products on the sale order : for example 1 "Mac ref1" at 500€ and 1 "Mac ref1" at 250€ (50% because it's already used/broken).
I got 2 questions:
Is there an easy way to connect sale.order.line and stock.pack.operation ?
How could I use my request to inherit model "stock_pack_operation" and use it on delivery order ?
Thank you.
FTK
I also want to do the same, working with stock_pack_operation, I want to know how it is related to moves and how it is working with Qaunts.!
Any answer will be appreciated!