Comment 1 for bug 1246116

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hi Alexis,

Thanks for reporting. The configuration you describe is a bit unusual because there is little reason to mark a contact as a supplier in most cases. Nevertheless if users do it, then perhaps they actually meant to have that contact always appear as the supplier for a given product. And in that case, they should probably be able to select that supplier on the product form, so the system will automatically select it when a draft PO is created for a procurement.

Based on the above, the fix I would suggest is to correct the supplier matching in purchase.order.line.onchange_product_id() so that it will allow matching any supplier that belongs to the same "commercial entity" (comparing `.commercial_partner_id.id` of both partners, instead of `id`) . This should be a one-line patch and would give maximum flexibility to the users. The first match would be found in the order in which they defined the suppliers. What do you think?