Merge lp:~openerp-dev/openobject-addons/6.0-opw-575449-ado into lp:openobject-addons/6.0

Proposed by Amit Dodiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-575449-ado
Merge into: lp:openobject-addons/6.0
Diff against target: 17 lines (+3/-2)
1 file modified
account_anglo_saxon/invoice.py (+3/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-575449-ado
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Pending
Naresh(OpenERP) Pending
Review via email: mp+110953@code.launchpad.net

Description of the change

Hello,

[FIX]: changing the uom in sale order line affects in sale order account entry entry but not affecting in account entry of anglo saxon accounting it will always take the cost price of product instead of converted uom amount

Steps:
1). Install anglo_saxon module
1). Create a product with PCE uom and set cost price(eg:50) and sale price(eg:100) with Realtime(automated).
2). Create a new UOM with UOM category unit and ratio=2
3). Create a Sale order and add sale order line with above product, change the uom to newly created uom, so unit price will change to 50.
4). Confirm the sale order, Click on "Create Final Invoice" and validate the related invoice.

Now check the Journal Entries two new entries for anglo saxon accounting is created.

The Anglo saxon accounting entries is always created with cost price of product.
It should be created with uom converted price.

If we change the uom in sale order line the cost price in journal entry should be change as per the ratio.

Regards,
Amit Dodiya

To post a comment you must log in.
Revision history for this message
joseponzo (joseponzo) wrote :

I have the same problem with openerp 7 account_anglo_saxon (revision 9925)

Revision history for this message
joseponzo (joseponzo) wrote :

this fix work for me openerp 7 account_anglo_saxon (revision 9925)

Unmerged revisions

5258. By Amit Dodiya<email address hidden>

[FIX]: changing the uom in sale order line affects in sale order account entry entry but not affecting in account entry of anglo saxon accounting it will always take the cost price of product instead of converted uom amount

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_anglo_saxon/invoice.py'
2--- account_anglo_saxon/invoice.py 2011-01-14 00:11:01 +0000
3+++ account_anglo_saxon/invoice.py 2012-06-19 06:03:21 +0000
4@@ -32,10 +32,11 @@
5 company_currency = inv.company_id.currency_id.id
6 def get_price(cr, uid, inv, company_currency,i_line):
7 cur_obj = self.pool.get('res.currency')
8+ standard_price_line = self.pool.get('product.uom')._compute_price(cr, uid, i_line.product_id.product_tmpl_id.uom_id.id, i_line.product_id.product_tmpl_id.standard_price, i_line.uos_id.id)
9 if inv.currency_id.id != company_currency:
10- price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, i_line.product_id.product_tmpl_id.standard_price * i_line.quantity, context={'date': inv.date_invoice})
11+ price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, standard_price_line * i_line.quantity, context={'date': inv.date_invoice})
12 else:
13- price = i_line.product_id.product_tmpl_id.standard_price * i_line.quantity
14+ price = standard_price_line * i_line.quantity
15 return price
16
17 if inv.type in ('out_invoice','out_refund'):