← Back to team overview

openerp-india team mailing list archive

[Bug 1194406] 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.'))
                      #

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

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

Status in OpenERP Addons (modules):
  Confirmed

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

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