← Back to team overview

credativ team mailing list archive

[Bug 898099] [NEW] [addons-6.0][point_of_sale][report][pos_details.py] The calculation of the total amount discounted is wrong in the report

 

Public bug reported:

Ubuntu 10.4 - openerp-server & client 6.0.3

I have noticed a mistake in the report /point_of_sale/report/pos_details.py
At the end in the "total discount" line, the amount is wrong

In the report, the amount discounted by order line
(pos_order_line.price_ded)  is multiply by the quantity of products
(pos_order_line.qty) and it shouldn't.

In fact, the price_ded in the pos_order_line table is already the TOTAL
amount disounted per order line (discount per product TIMES quantity of
product)

The Total discount should be only the sum of all
pos_order_line.price_ded

==============

I modified the code and the amount looks good now.
In the code (pos_order_report.py)

def _get_sum_dis_2(self,form,user):
        res4=[]
#       self.cr.execute ("select sum(pol.price_ded * pol.qty)" \
        self.cr.execute ("select sum(pol.price_ded)" \

** Affects: openobject-addons
     Importance: Undecided
         Status: New

** Description changed:

  Ubuntu 10.4 - openerp-server & client 6.0.3
- 
  
  I have noticed a mistake in the report /point_of_sale/report/pos_details.py
  At the end in the "total discount" line, the amount is wrong
  
  In the report, the amount discounted by order line
  (pos_order_line.price_ded)  is multiply by the quantity of products
  (pos_order_line.qty) and it shouldn't.
  
- In fact, the price_ded in the pos_order_line table is already the TOTAL amount disounted per order line (discount per product TIMES quantity of product)
-  
- The Total discount should be only the sum of all pos_order_line.price_ded
+ In fact, the price_ded in the pos_order_line table is already the TOTAL
+ amount disounted per order line (discount per product TIMES quantity of
+ product)
+ 
+ The Total discount should be only the sum of all
+ pos_order_line.price_ded
  
  ==============
  
  I modified the code and the amount looks good now.
- In the code (pos_order_reportr.py)
+ In the code (pos_order_report.py)
  
  def _get_sum_dis_2(self,form,user):
-         res4=[]
+         res4=[]
  #       self.cr.execute ("select sum(pol.price_ded * pol.qty)" \
-         self.cr.execute ("select sum(pol.price_ded)" \
+         self.cr.execute ("select sum(pol.price_ded)" \

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

Title:
  [addons-6.0][point_of_sale][report][pos_details.py] The calculation of
  the total amount discounted is wrong in the report

Status in OpenERP Addons (modules):
  New

Bug description:
  Ubuntu 10.4 - openerp-server & client 6.0.3

  I have noticed a mistake in the report /point_of_sale/report/pos_details.py
  At the end in the "total discount" line, the amount is wrong

  In the report, the amount discounted by order line
  (pos_order_line.price_ded)  is multiply by the quantity of products
  (pos_order_line.qty) and it shouldn't.

  In fact, the price_ded in the pos_order_line table is already the
  TOTAL amount disounted per order line (discount per product TIMES
  quantity of product)

  The Total discount should be only the sum of all
  pos_order_line.price_ded

  ==============

  I modified the code and the amount looks good now.
  In the code (pos_order_report.py)

  def _get_sum_dis_2(self,form,user):
          res4=[]
  #       self.cr.execute ("select sum(pol.price_ded * pol.qty)" \
          self.cr.execute ("select sum(pol.price_ded)" \

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


Follow ups

References