The wizard "update price" should not create accounting when valuation='manual_periodic'

Bug #1194406 reported by Numérigraphe
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP R&D Addons Team 3

Bug Description

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.

It should only create accounting moves when valuation='real_time', not when valuation='manual_periodic'.

Lionel Sausin

Tags: maintenance

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
tags: added: maintenance
Revision history for this message
Numérigraphe (numerigraphe) wrote : Re: OpenERP Enterprise Edition Bugfix: The wizard "update price" should not create accounting when valuation='manual_periodic'

Dear Foram Katharotiya,
Your patch solves the problem we met, though the wizard is very slow
(probably because the second test is a loop that is useless in this
context).
Will you be so kind as to inform us when this patch lands on the stable
versions and the trunk?
Thanks,
Lionel Sausin.

Le 19/07/2013 14:22, Foram Katharotiya (fka) a écrit :
>
> I have attached the patch that fixes your problem of require valuation
> accounts on product categories
>
> Would you please check at your end and let me know with the result
> whether anything missing?
>
>
=== modified file 'stock/product.py'
--- stock/product.py 2013-04-17 13:20:21 +0000
+++ stock/product.py 2013-07-19 10:41:17 +0000
@@ -93,7 +93,7 @@
          product_obj=self.browse(cr, uid, ids, context=context)[0]
          account_valuation = product_obj.categ_id.property_stock_valuation_account_id
          account_valuation_id = account_valuation and account_valuation.id or False
- if not account_valuation_id: raise osv.except_osv(_('Error!'), _('Specify valuation Account for Product Category: %s.') % (product_obj.categ_id.name))
+ 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))
          move_ids = []
          loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
          for rec_id in ids:
@@ -108,7 +108,7 @@
                  qty = product.qty_available
                  diff = product.standard_price - new_price
                  if not diff: raise osv.except_osv(_('Error!'), _("No difference between standard price and new price!"))
- if qty:
+ if qty and product_obj.valuation == 'real_time':
                      company_id = location.company_id and location.company_id.id or False
                      if not company_id: raise osv.except_osv(_('Error!'), _('Please specify company in Location.'))
                      #

Revision history for this message
Foram Katharotiya (OpenERP) (fka-openerp) wrote :

Hello,

  - It has been Fixed in this branch https://code.launchpad.net/~openerp-dev/openobject-addons/7.0-opw-594333-fka.
    revno: 9279
    revid: <email address hidden>

  -It will be available in 7.0 soon.

Thanks,
FKA

Changed in openobject-addons:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.