Skip to Content
Menú
This question has been flagged
2 Respostes
2011 Vistes

I want to make a module that copies a sale.order.line comment to the purchase.order.line 

Does anyone know where exactly in the code this conversion is done ?


OCA has a https://github.com/OCA/sale-reporting/tree/14.0/sale_comment_template module but also this comment does not migrate into the purchase order.

Avatar
Descartar
Best Answer

Hello Jaco, its very likely that the customer needs to bring some information from the sale.order.line to the purchase.order.line and even more when we're using de MTO route in our product. This is not avaliable in odoo standard because we have several lines in our sales order than can be one line in the purchase order ej:

sale order line 1: t-shirt with the comment "customized with an odoo logo" with a $5 sales price

sale order line 2: t-shirt with the comment "customized with a coca-cola logo" with a $10 sales price

On our purchase order we will have a one and only line:

line 1: 2 t-shirts

Even though we bring our field "sale.order.item" to the purchase order line you'll need to select the sale.order.line manually because this fields are many2many and there's no way that odoo figures out or knows automatically which sale order line we are talking about regarding that we could have 1 purchase line per multiple sales lines.

There's a forum entry that explains a workaround for service type products which have the reordering configuration as "subcontract service" in case you're talking about services. 

Here's the link: https://accounts.odoo.com/es_ES/forum/ayuda-1/how-to-define-the-po-price-from-the-so-v14-and-v15-199906

Hope this information helps you.

Regards,



Avatar
Descartar
Autor

I can write a module, adding an extra field on both models, but i dont really find where in the code the purchase.order.lines are created from the sale.order.lines

Best Answer

Thank you for sharing this detailed explanation regarding the challenges of transferring information from sale.order.line to purchase.order.line, especially when using the MTO route.

Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
de maig 25
142
1
de maig 25
536
4
de maig 25
1841
1
de febr. 25
5313
3
de des. 24
1790