Skip to Content
Menu
This question has been flagged

Hello,

I have the following issue with odoo 8:

When I create a sale.order with sale.order.lines with multiple product.supplierinfo for a product, if two or more suppliers have the same criteria, always the first one is selected (and the purchase.order created from the invoice is always for the first supplier), my issue is that i need to be able to select the supplier when creating the sale.order because sometimes the supplier selection is related with external factors from odoo (supplier availability or other business logic not related with odoo)


I have few knowledges with odoo and with odoo modules so can someone give me some tips about how to develop this with python or if there is any module that can help me achieve this?


regards,

juanma.

Avatar
Discard
Best Answer

Hi,

it would be quite hard, since when purchase orders are created you do not have info about a sales order.

Generally, what you should do:

  1. Add in sale.order.line info about a supplier as m2o to supplier info (the same as in a product)

  2. Somehow transfer SO this info through procurement. E.g. have a look at the method _prepare_order_line_procurement of sale.order and at how a chain of procurements is generated in the module 'procurement'. 

  3. Then in the purchase.order method _check_supplier_info add a check from this info, instead of getting it from a product.

Simplier way would be to define some logical parameter how to select a supplier. So, you add some extra parameter to supplier.info (such as availability for example) and use this parameter to _check_supplier_info to select a proper vendor.

Hope that helps.



 


Avatar
Discard
Author Best Answer

I can't edit the topic so I will explain again my issue:

When I create a sale.order, when adding a product in the sale.order.lines the supplier is selected automatically depending on some criteria, that is ok, the common behaviour, but if two or more suppliers have the same criteria, always the first one is selected (and the purchase.order created automatically from MRP module is always for the first supplier), my issue is that i need to be able to select the supplier within the same criteria when creating the sale.order because sometimes the supplier selection is related with external apart away from odoo (supplier availability or other business logic not related with odoo)

Avatar
Discard

And the answer is still the same: you need to-rework procurement, what is quite hard

Related Posts Replies Views Activity
0
Oct 23
268
1
Jun 21
4882
2
Jan 20
13433
16
Aug 19
8648
1
Jan 19
4311