← Back to team overview

openerp-india team mailing list archive

[Bug 926054] Re: [trunk] Bad choice of product's supplier

 

Hello Quentin,

Both cases you describe are the expected behavior - the default supplier choice algorithm is very simple and takes the first supplier in in order of priority. The other parameters on the supplier info are only used to choose appropriate values when creating a PO, but do not take part in the choice, on purpose!
For the second case you did not specify a higher priority for CamptoCamp so the result depends on which record will be returned first by the database ... here it is the older one (but this may vary) - use distinct sequence for deterministic behavior.

Every company has its own policy for determining the "best" supplier for each PO (sometimes there's no deterministic algorithm). The OpenERP core is meant to be minimalist and extensible, therefore a unique criterion based on the priorities is used by default - the other fields are ignored for the choice.
If you want to hard-wire a more specific algorithm you should inherit and override the product.product._get_main_product_supplier() method, even using new supplierinfo fields if this is required for the algorithm.
See the merge proposal that introduces this method for more details [1]

Thanks for your understanding!

PS: this should perhaps be turned into a FAQ...

[1] https://code.launchpad.net/~akretion-team/openobject-
addons/clean_main_supplier_for_product/+merge/86254

** Changed in: openobject-addons
       Status: New => Invalid

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/926054

Title:
  [trunk] Bad choice of product's supplier

Status in OpenERP Addons (modules):
  Invalid

Bug description:
  I've found an issue on procurement order with supplier in product
  form.

  To reproduce (with demo data) :

  Change the Supply method of CPU_GEN from 'Produce' to 'Buy'.
  Add 'Maxtor' in 'Suppliers' tab with sequence = 1 and minimal quantity = 10.

  Create a new sale order to 'Axelor' with one line of 6 CPU_GEN.
  Confirm it. Run the scheduler.

  Current behaviour : the scheduler has created a PO to 'Maxtor' with one line of 10 CPU_GEN
  Expected behaviour : Error 'No supplier found' in procurement request.

  So, if you consider this behavior is an acceptable behaviour, I
  explain you another problem :

  Add 'CampToCamp' as supplier in CPU_GEN form with sequence = 1 and
  minimal quantity = 3.

  Create a new sale order to 'Axelor' with one line of 6 CPU_GEN.
  Confirm it. Run the scheduler.

  Current behaviour : the scheduler has created a PO to 'Maxtor' with one line of 10 CPU_GEN
  Expected behaviour : the scheduler has created a PO to 'CampToCamp' with one line of 6 CPU_GEN

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/926054/+subscriptions


References