Skip to Content
Menu
This question has been flagged

Hi,

We need to know the sale order line which caused the purchase order line to be generated.

Sale orders are automatically generated by defining suppliers and re-ordering rules for each product.

We have the following requirement: The user needs to be able to delete some lines from the automatically generated purchase order. On deletion, it is required that the sale line (which caused the purchase line to be created) to be moved to a different delivery order.

However, there is no link between the "purchase_order_line" and "sale_order_line" tables. Additionally, when I checked the "procurement_order" table, I found a record for the sale order line (the sale_line_id is set, and purchase_line_id is empty) and another record for the purchase order line (the purchase_line_id is set, and sale_line_id is empty), and I could not find a way to connect the 2 records together.

As a solution, I am thinking of overriding the "procurement_order.make_po" method. I will fill the "purchase_line_id" field of the "procurement_order" table for the procurement orders originated from the sale orders. 

So, what is the best way to link the the "purchase_order_line" to the "sale_order_line", when the PO is automatically generated using reordering rules?


Thanks a lot


Avatar
Discard
Related Posts Replies Views Activity
1
Nov 23
529
2
Mar 21
8096
0
Mar 15
2685
1
Mar 15
5626
1
Sep 21
3199