← Back to team overview

openerp-india team mailing list archive

[Bug 1238233] Re: [trunk/7.0] product_visible_discount doesn't update price_unit on UOM change

 

** Summary changed:

- [7.0] product_visible_discount doesn't update price_unit on UOM change
+ [trunk/7.0] product_visible_discount doesn't update price_unit on UOM change

** Changed in: openobject-addons
   Importance: Undecided => Medium

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

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP R&D Addons Team 2 (openerp-dev-addons2)

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

Title:
  [trunk/7.0] product_visible_discount doesn't update price_unit on UOM
  change

Status in OpenERP Addons (modules):
  Confirmed

Bug description:
  On product_visible_discount the function get_real_price is not
  considering UOM.

  I have a product with uom_id = 'Unit(s)' with price of 12
  When I change the uom to dozen on sale_order, get_real_price returns 12 too.

  I've detected why.

              factor = 1.0
              if uom_id and uom_id != product.uom_id.id:
                  product_uom_obj = self.pool.get('product.uom')
                  uom_data = product_uom_obj.browse(cr, uid,  product.uom_id.id)
                  factor = uom_data.factor
              return product_read[field_name] * factor

  If your product_id.uom is unit even if you change uom on sale_order
  this is pulling the factor only from product_id uom. So it's going to
  be 1.

  The fix must be:

              factor = 1.0
              if uom_id and uom_id != product.uom_id.id:
                  product_uom_obj = self.pool.get('product.uom')
                  uom_data = product_uom_obj.browse(cr, uid,  product.uom_id.id)
                  factor_uom = product_uom_obj.browse(cr, uid, uom).factor
                  factor_product=uom_data.factor
                  factor=factor_product/factor_uom
              return product_read[field_name] * factor

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


References