← Back to team overview

openerp-india team mailing list archive

[Bug 1175983] Re: Pricelist : Error when context['date']=False

 

Hello,

We have merged Alexis's fix into openerp 7.0. Thanks for the report

Regards

revno: 9470 [merge]
revision-id: mat@xxxxxxxxxxx-20130920144529-800nviktzebexwtt


** Changed in: openobject-addons
       Status: Fix Committed => Fix Released

-- 
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/1175983

Title:
  Pricelist : Error when context['date']=False

Status in OpenERP Addons (modules):
  Fix Released

Bug description:
  In product/pricelist.py, if you enter the function price_get_multi() with context['date'] = False or None, you will have an error message :
  <<
  At least one pricelist has no active version ! Please create or activate one.
  >>

  For example, one scenario where you enter the function function
  price_get_multi() with context['date'] = False or None is when you use
  the module "product_visible_discount" :

  in product_visible_discount.py line 87, inside the function
  product_id_change() you have :

  list_price = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })
  (the function price_get() calls price_get_multi())

  and the default value for the variable "date_order" is False, as you
  can see in the proto of the function product_id_change().

  I think that the proper fix for this is simply to test if
  context['date'] has a value before using it for the 'date' variable in
  the function price_get_multi() in product/pricelist.py. My merged
  proposal that will be attached to this bug implements this fix.

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