Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lis 23
1785
2
mar 21
9607
0
mar 15
3865
1
mar 15
6633
1
wrz 21
4390