Merge lp:~openerp-dev/openobject-addons/7.0-opw-594333-fka into lp:openobject-addons/7.0

Proposed by Foram Katharotiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-594333-fka
Merge into: lp:openobject-addons/7.0
Diff against target: 21 lines (+2/-2)
1 file modified
stock/product.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-594333-fka
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+177998@code.launchpad.net

Description of the change

Hello,

Steps to reproduce:

When updating the standard price of a product with the wizard "update price", the code in stock/product.py creates accounting moves to reflect this change in accounting, regardless of the valuation setting of the product.

I have fix this issue that creates accounting moves when valuation='real_time', not when valuation='manual_periodic' and remove required valuation accounts on product categories when valuation = 'manual_periodic'.

Thanks,
FKA

To post a comment you must log in.

Unmerged revisions

9279. By Foram Katharotiya (OpenERP)

[IMP] made require valuation accounts on product categorie when we use realtime valuation

9278. By Foram Katharotiya (OpenERP)

[MERGE] with 7.0

9277. By Foram Katharotiya (OpenERP)

[IMP] create accounting moves when valuation is 'real_time'

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/product.py'
2--- stock/product.py 2013-04-17 13:20:21 +0000
3+++ stock/product.py 2013-08-01 05:31:31 +0000
4@@ -93,7 +93,7 @@
5 product_obj=self.browse(cr, uid, ids, context=context)[0]
6 account_valuation = product_obj.categ_id.property_stock_valuation_account_id
7 account_valuation_id = account_valuation and account_valuation.id or False
8- if not account_valuation_id: raise osv.except_osv(_('Error!'), _('Specify valuation Account for Product Category: %s.') % (product_obj.categ_id.name))
9+ if product_obj.valuation == 'real_time' and not account_valuation_id: raise osv.except_osv(_('Error!'), _('Specify valuation Account for Product Category: %s.') % (product_obj.categ_id.name))
10 move_ids = []
11 loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
12 for rec_id in ids:
13@@ -108,7 +108,7 @@
14 qty = product.qty_available
15 diff = product.standard_price - new_price
16 if not diff: raise osv.except_osv(_('Error!'), _("No difference between standard price and new price!"))
17- if qty:
18+ if qty and product.valuation == 'real_time':
19 company_id = location.company_id and location.company_id.id or False
20 if not company_id: raise osv.except_osv(_('Error!'), _('Please specify company in Location.'))
21 #