Merge lp:~openerp-dev/openobject-addons/trunk-opw-577224-port-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-opw-577224-port-mma
Merge into: lp:openobject-addons
Diff against target: 33 lines (+9/-3)
1 file modified
sale/report/sale_report.py (+9/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-opw-577224-port-mma
Reviewer Review Type Date Requested Status
Fabien (Open ERP) Pending
Review via email: mp+140590@code.launchpad.net

This proposal supersedes a proposal from 2012-11-23.

Description of the change

Hello,

  I have Fixed the issue of currency conversion in sales analysis report.
  sales with different currency but in sale analysis report Total price should be convert with
  Base currency of company.
  e.g
     create a sale order with GBP, USD and EUR(Price lsit) in order line it will convert properly according to currency rate with base currency.But in sales analysis report it is not converting Total price with base currency.

   code is forward port from 6.1

Thanks,
Mayur

To post a comment you must log in.
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote : Posted in a previous version of this proposal

invalid fix, you must use the price from the SO, not the product (eventually with a currency conversion)

review: Disapprove
Revision history for this message
Mayur Maheshwari(OpenERP) (mma-openerp) wrote :

Hello

   I haveimprove code and now use price from the so with currency conversion

Thanks,
Mayur

Unmerged revisions

8106. By Mayur Maheshwari(OpenERP)

[IMP]sale: use unit price on so with a currency conversion to fix total price was not reflecting in currency conversion

8105. By Hardik Ansodariya (OpenERP)

[FIX]sale_report: Total price was not reflecting in currency conversion

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale/report/sale_report.py'
2--- sale/report/sale_report.py 2012-12-06 14:56:32 +0000
3+++ sale/report/sale_report.py 2012-12-19 05:59:28 +0000
4@@ -70,7 +70,7 @@
5 l.product_id as product_id,
6 t.uom_id as product_uom,
7 sum(l.product_uom_qty / u.factor * u2.factor) as product_uom_qty,
8- sum(l.product_uom_qty * l.price_unit * (100.0-l.discount) / 100.0) as price_total,
9+ sum(l.product_uom_qty * (l.price_unit/cr.rate) * (100.0-l.discount) / 100.0) as price_total,
10 1 as nbr,
11 s.date_order as date,
12 s.date_confirm as date_confirm,
13@@ -88,12 +88,18 @@
14 s.project_id as analytic_account_id
15 from
16 sale_order s
17+ left join product_pricelist pp on (pp.id=s.pricelist_id)
18 left join sale_order_line l on (s.id=l.order_id)
19- left join product_product p on (l.product_id=p.id)
20- left join product_template t on (p.product_tmpl_id=t.id)
21+ left join product_product p on (l.product_id=p.id)
22+ left join product_template t on (p.product_tmpl_id=t.id)
23 left join product_uom u on (u.id=l.product_uom)
24 left join product_uom u2 on (u2.id=t.uom_id)
25+ left join res_currency_rate cr on (cr.currency_id=pp.currency_id)
26 where l.product_id is not null
27+ AND cr.id IN (SELECT id FROM res_currency_rate cr2
28+ WHERE (cr2.currency_id = pp.currency_id)
29+ AND (cr.name <= NOW())
30+ ORDER BY name DESC LIMIT 1)
31 group by
32 l.product_id,
33 l.product_uom_qty,

Subscribers

People subscribed via source and target branches

to all changes: