Help

0

How to transfer values from sale order to manufacturing order?

Avatar
Jan Krähling

Hello, I'm using Odoo 13 Community Edition.


In the sale order form view i can specify each sale order with customer reference (client_order_ref) and of course with a customer (partner_id).


In the manufacturing order tree view (mrp_production_tree_view) i want to group the orders by the customer reference from the sale order, so it need to be transferred to a custom field (mo_order_ref) and i want to transfer the partner_id to a custom field in the manufacturing order too (costumer_id).

My problem is that the manufacturing orders are created from the sale order automatically, so i think i have to change it in the stock.rule model, but where and what? 


The best solution for me would be if i know how to add these things at "propagation" in the stock rules. I found the mothod def _get_stock_move_values in stock_rule.py, i think that could be nearly what i have to edit.


Thanks in advance.

Avatar
Discard
2 Answers
0
Best Answer

Did you see this example of assigning a logo attached to the Sales Order to the Manufacturing Order, based on the Source Document field?

https://www.odoo.com/forum/help-1/question/logo-for-manufacturing-order-entered-on-the-sale-order-shown-on-the-manufacturing-order-168388

You can create functional fields that search for the matching Sales Order and bring over information from client_order_ref and partner_id



Avatar
Discard
0
Avatar
Haresh Chavda
Best Answer

Hello Jan,

I have found one odoo module into odoo10 that used for link the sale order into manufacture order base on procurement rules.so that could help to get sale order data into Manufacture.Here below is reference link.

https://apps.odoo.com/apps/modules/10.0/deltatech_mrp_sale_ref/

Second option is you can try to find the link of create MO base on procurement rules from Sale order.
Here def _prepare_mo_vals method is call to fetch the data from the procurement that exist into addons->mrp->stock_rule.py file may be it could be help also.


Best Regards

Haresh


Avatar
Discard