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.')) #
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 :
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 valuation_ id: raise osv.except_ osv(_(' Error!' ), _('Specify valuation Account for Product Category: %s.') % (product_ obj.categ_ id.name) ) 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) ) obj.search( cr, uid,[(' usage', '=','internal' )])
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!")) 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.'))
#
>
> 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 @@
- if not account_
+ if product_
move_ids = []
loc_ids = location_
for rec_id in ids:
@@ -108,7 +108,7 @@
- if qty:
+ if qty and product_