[IMP] Improved warning messages for stock module
bzr revid: pso@tinyerp.com-20120725103041-2ndjekods10xmhg8
This commit is contained in:
parent
c7b3b8665d
commit
c8b2503d05
|
@ -792,7 +792,7 @@ msgstr ""
|
||||||
#. module: stock
|
#. module: stock
|
||||||
#: code:addons/stock/product.py:75
|
#: code:addons/stock/product.py:75
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Specify valuation Account for Product Category: %s"
|
msgid "Specify valuation Account for Product Category: %s."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock
|
#. module: stock
|
||||||
|
@ -1043,7 +1043,7 @@ msgstr ""
|
||||||
#: code:addons/stock/product.py:147
|
#: code:addons/stock/product.py:147
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid ""
|
msgid ""
|
||||||
"Define stock output account for this product: \"%s\" (id: %d)"
|
"Please define stock output account for this product: \"%s\" (id: %d)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock
|
#. module: stock
|
||||||
|
@ -2548,7 +2548,7 @@ msgstr ""
|
||||||
#: code:addons/stock/product.py:121
|
#: code:addons/stock/product.py:121
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid ""
|
msgid ""
|
||||||
"Define stock input account for this product: \"%s\" (id: %d)"
|
"Please define stock input account for this product: \"%s\" (id: %d)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: stock
|
#. module: stock
|
||||||
|
|
|
@ -93,7 +93,7 @@ class product_product(osv.osv):
|
||||||
product_obj=self.browse(cr, uid, ids, context=context)[0]
|
product_obj=self.browse(cr, uid, ids, context=context)[0]
|
||||||
account_valuation = product_obj.categ_id.property_stock_valuation_account_id
|
account_valuation = product_obj.categ_id.property_stock_valuation_account_id
|
||||||
account_valuation_id = account_valuation and account_valuation.id or False
|
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 not account_valuation_id: raise osv.except_osv(_('Error!'), _('Specify valuation Account for Product Category: %s.') % (product_obj.categ_id.name))
|
||||||
move_ids = []
|
move_ids = []
|
||||||
loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
|
loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
|
||||||
for rec_id in ids:
|
for rec_id in ids:
|
||||||
|
@ -110,7 +110,7 @@ class product_product(osv.osv):
|
||||||
if not diff: raise osv.except_osv(_('Error!'), _("No difference between standard price and new price!"))
|
if not diff: raise osv.except_osv(_('Error!'), _("No difference between standard price and new price!"))
|
||||||
if qty:
|
if qty:
|
||||||
company_id = location.company_id and location.company_id.id or False
|
company_id = location.company_id and location.company_id.id or False
|
||||||
if not company_id: raise osv.except_osv(_('Error!'), _('Specify company in Location.'))
|
if not company_id: raise osv.except_osv(_('Error!'), _('Please specify company in Location.'))
|
||||||
#
|
#
|
||||||
# Accounting Entries
|
# Accounting Entries
|
||||||
#
|
#
|
||||||
|
@ -118,8 +118,8 @@ class product_product(osv.osv):
|
||||||
journal_id = product.categ_id.property_stock_journal and product.categ_id.property_stock_journal.id or False
|
journal_id = product.categ_id.property_stock_journal and product.categ_id.property_stock_journal.id or False
|
||||||
if not journal_id:
|
if not journal_id:
|
||||||
raise osv.except_osv(_('Error!'),
|
raise osv.except_osv(_('Error!'),
|
||||||
_('Define journal '\
|
_('Please define journal '\
|
||||||
'on the product category: "%s" (id: %d)') % \
|
'on the product category: "%s" (id: %d).') % \
|
||||||
(product.categ_id.name,
|
(product.categ_id.name,
|
||||||
product.categ_id.id,))
|
product.categ_id.id,))
|
||||||
move_id = move_obj.create(cr, uid, {
|
move_id = move_obj.create(cr, uid, {
|
||||||
|
@ -139,8 +139,8 @@ class product_product(osv.osv):
|
||||||
property_stock_account_input_categ.id
|
property_stock_account_input_categ.id
|
||||||
if not stock_input_acc:
|
if not stock_input_acc:
|
||||||
raise osv.except_osv(_('Error!'),
|
raise osv.except_osv(_('Error!'),
|
||||||
_('Define stock input account ' \
|
_('Please define stock input account ' \
|
||||||
'for this product: "%s" (id: %d)') % \
|
'for this product: "%s" (id: %d).') % \
|
||||||
(product.name,
|
(product.name,
|
||||||
product.id,))
|
product.id,))
|
||||||
amount_diff = qty * diff
|
amount_diff = qty * diff
|
||||||
|
@ -165,8 +165,8 @@ class product_product(osv.osv):
|
||||||
property_stock_account_output_categ.id
|
property_stock_account_output_categ.id
|
||||||
if not stock_output_acc:
|
if not stock_output_acc:
|
||||||
raise osv.except_osv(_('Error!'),
|
raise osv.except_osv(_('Error!'),
|
||||||
_('Define stock output account ' \
|
_('Please define stock output account ' \
|
||||||
'for this product: "%s" (id: %d)') % \
|
'for this product: "%s" (id: %d).') % \
|
||||||
(product.name,
|
(product.name,
|
||||||
product.id,))
|
product.id,))
|
||||||
amount_diff = qty * -diff
|
amount_diff = qty * -diff
|
||||||
|
|
|
@ -2172,16 +2172,16 @@ class stock_move(osv.osv):
|
||||||
raise osv.except_osv(_('Error!'), _('Cannot create Journal Entry, Input Account of this product and Valuation account on category of this product are same.'))
|
raise osv.except_osv(_('Error!'), _('Cannot create Journal Entry, Input Account of this product and Valuation account on category of this product are same.'))
|
||||||
|
|
||||||
if not acc_src:
|
if not acc_src:
|
||||||
raise osv.except_osv(_('Error!'), _('Define stock input account for this product or its category: "%s" (id: %d)') % \
|
raise osv.except_osv(_('Error!'), _('Please define stock input account for this product or its category: "%s" (id: %d)') % \
|
||||||
(move.product_id.name, move.product_id.id,))
|
(move.product_id.name, move.product_id.id,))
|
||||||
if not acc_dest:
|
if not acc_dest:
|
||||||
raise osv.except_osv(_('Error!'), _('Define stock output account for this product or its category: "%s" (id: %d)') % \
|
raise osv.except_osv(_('Error!'), _('Please define stock output account for this product or its category: "%s" (id: %d)') % \
|
||||||
(move.product_id.name, move.product_id.id,))
|
(move.product_id.name, move.product_id.id,))
|
||||||
if not journal_id:
|
if not journal_id:
|
||||||
raise osv.except_osv(_('Error!'), _('Define journal on the product category: "%s" (id: %d)') % \
|
raise osv.except_osv(_('Error!'), _('Please define journal on the product category: "%s" (id: %d)') % \
|
||||||
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
|
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
|
||||||
if not acc_valuation:
|
if not acc_valuation:
|
||||||
raise osv.except_osv(_('Error!'), _('Define inventory valuation account on the product category: "%s" (id: %d)') % \
|
raise osv.except_osv(_('Error!'), _('Please define inventory valuation account on the product category: "%s" (id: %d)') % \
|
||||||
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
|
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
|
||||||
return journal_id, acc_src, acc_dest, acc_valuation
|
return journal_id, acc_src, acc_dest, acc_valuation
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue