Skip to Content
Menu
This question has been flagged

Odoo 14 (Sales - Purchase - Inventory )

my company work by the following Operations Routes :

Buy   and    Replenish on Order (MTO)

purchased upon the confirmation of a sales order

and the related PO will have the source document field (with the related SO Number ) in odoo as is , 


now 

I need to create new field  ( Many2one) in the PO  , Named " Related SO Contact " under the odoo as is field  ( source document )

so that when the sales teem create SO its related (auto created ) PO will have the 


source document :    SO 0007


Related SO Contact :  the customer name from the related SO


-------------------------------------------------------------------------------------

A)   by odoo studio , i've created the new ( Many2one) field in the po 

B )   i've created new Automated action with the following data 


  Model  :  Purchase Order

Trigger : On Creation & Update

Action To Do : Create a new Record

Target Model : Sales Order



Trigger Fields : source document (purchase.order)

Match records with the following rule:

Source Document

contains "S0"

-------------------------------------------------------------------------------

what i need 


i need any help to 

A ) complete the automated action to work wright as it not completed wright now and not working  


OR 



B ) Execute python code in the automated action , so if any one could write it so i can copy and past 


Avatar
Discard
Best Answer

Take a look at the stock_purchase module, under models/stock_rule.py, _run_buy method.

Also, what you desire is missing the scenario when multiple SO containing the same product in its SOLs.

In result of "A RFQ with multiple SO as Source Document is possible", that way it's not Many2one relation 

Avatar
Discard
Related Posts Replies Views Activity
0
Jan 22
100
2
Aug 24
257
0
Jan 24
667
0
Oct 22
910
3
Jun 21
5689