[IMP] Improved warning messages/exceptions for stock modules
bzr revid: pso@tinyerp.com-20120717132135-w9w65og3akobeons
This commit is contained in:
commit
bcdaf0cdb4
|
@ -344,7 +344,7 @@ msgstr ""
|
|||
#: code:addons/stock/stock.py:2119
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Can not create Journal Entry, Input Account defined on this product and "
|
||||
"Cannot create Journal Entry, Input Account defined on this product and "
|
||||
"Valuation account on category of this product are same."
|
||||
msgstr ""
|
||||
|
||||
|
@ -533,7 +533,7 @@ msgstr ""
|
|||
#: code:addons/stock/stock.py:2125
|
||||
#, python-format
|
||||
msgid ""
|
||||
"There is no stock output account defined for this product or its category: "
|
||||
"No stock output account defined for this product or its category: "
|
||||
"\"%s\" (id: %d)"
|
||||
msgstr ""
|
||||
|
||||
|
@ -557,7 +557,7 @@ msgstr ""
|
|||
#. module: stock
|
||||
#: code:addons/stock/stock.py:760
|
||||
#, python-format
|
||||
msgid "You can not process picking without stock moves"
|
||||
msgid "You cannot process picking without stock moves."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
@ -675,7 +675,7 @@ msgstr ""
|
|||
#: code:addons/stock/stock.py:2131
|
||||
#, python-format
|
||||
msgid ""
|
||||
"There is no inventory Valuation account defined on the product category: \"%s"
|
||||
"No inventory Valuation account defined on the product category: \"%s"
|
||||
"\" (id: %d)"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1370,7 +1370,7 @@ msgstr ""
|
|||
#. module: stock
|
||||
#: code:addons/stock/product.py:92
|
||||
#, python-format
|
||||
msgid "Company is not specified in Location"
|
||||
msgid "Company is not specified in Location."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
@ -1471,7 +1471,7 @@ msgstr ""
|
|||
#. module: stock
|
||||
#: code:addons/stock/wizard/stock_invoice_onshipping.py:112
|
||||
#, python-format
|
||||
msgid "No Invoices were created"
|
||||
msgid "No Invoices were created."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
@ -1755,7 +1755,7 @@ msgstr ""
|
|||
#. module: stock
|
||||
#: code:addons/stock/stock.py:513
|
||||
#, python-format
|
||||
msgid "You can not remove a lot line !"
|
||||
msgid "You cannot remove a lot line !"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
@ -1873,7 +1873,7 @@ msgstr ""
|
|||
#: code:addons/stock/stock.py:2116
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Can not create Journal Entry, Output Account defined on this product and "
|
||||
"Cannot create Journal Entry, Output Account defined on this product and "
|
||||
"Valuation account on category of this product are same."
|
||||
msgstr ""
|
||||
|
||||
|
@ -1906,7 +1906,7 @@ msgstr ""
|
|||
#: code:addons/stock/stock.py:2122
|
||||
#, python-format
|
||||
msgid ""
|
||||
"There is no stock input account defined for this product or its category: "
|
||||
"No stock input account defined for this product or its category: "
|
||||
"\"%s\" (id: %d)"
|
||||
msgstr ""
|
||||
|
||||
|
@ -2138,7 +2138,7 @@ msgstr ""
|
|||
#. module: stock
|
||||
#: code:addons/stock/product.py:89
|
||||
#, python-format
|
||||
msgid "Could not find any difference between standard price and new price!"
|
||||
msgid "No difference between standard price and new price!"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
@ -2554,7 +2554,7 @@ msgstr ""
|
|||
#. module: stock
|
||||
#: code:addons/stock/stock.py:2445
|
||||
#, python-format
|
||||
msgid "Can not consume a move with negative or zero quantity !"
|
||||
msgid "Cannot consume a move with negative or zero quantity !"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
@ -2842,7 +2842,7 @@ msgstr ""
|
|||
#: code:addons/stock/stock.py:2379 code:addons/stock/stock.py:2440
|
||||
#: code:addons/stock/wizard/stock_partial_picking.py:141
|
||||
#, python-format
|
||||
msgid "Please provide Proper Quantity !"
|
||||
msgid "Please provide Proper Quantity."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
@ -3578,7 +3578,7 @@ msgstr ""
|
|||
#. module: stock
|
||||
#: code:addons/stock/wizard/stock_return_picking.py:189
|
||||
#, python-format
|
||||
msgid "Please specify at least one non-zero quantity!"
|
||||
msgid "Please specify at least one non-zero quantity."
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
@ -3623,7 +3623,7 @@ msgstr ""
|
|||
#. module: stock
|
||||
#: code:addons/stock/product.py:100 code:addons/stock/stock.py:2128
|
||||
#, python-format
|
||||
msgid "There is no journal defined on the product category: \"%s\" (id: %d)"
|
||||
msgid "No journal defined on the product category: \"%s\" (id: %d)"
|
||||
msgstr ""
|
||||
|
||||
#. module: stock
|
||||
|
|
|
@ -93,7 +93,7 @@ class product_product(osv.osv):
|
|||
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!'), _('Valuation Account is not specified 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 = []
|
||||
loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
|
||||
for rec_id in ids:
|
||||
|
@ -107,10 +107,10 @@ class product_product(osv.osv):
|
|||
product = self.browse(cr, uid, rec_id, context=c)
|
||||
qty = product.qty_available
|
||||
diff = product.standard_price - new_price
|
||||
if not diff: raise osv.except_osv(_('Error!'), _("Could not find any 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:
|
||||
company_id = location.company_id and location.company_id.id or False
|
||||
if not company_id: raise osv.except_osv(_('Error!'), _('Company is not specified in Location'))
|
||||
if not company_id: raise osv.except_osv(_('Error!'), _('Specify company in Location.'))
|
||||
#
|
||||
# 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
|
||||
if not journal_id:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
_('There is no journal defined '\
|
||||
'on the product category: "%s" (id: %d)') % \
|
||||
_('Define journal '\
|
||||
'on the product category: "%s" (id: %d)') % \
|
||||
(product.categ_id.name,
|
||||
product.categ_id.id,))
|
||||
move_id = move_obj.create(cr, uid, {
|
||||
|
@ -139,7 +139,7 @@ class product_product(osv.osv):
|
|||
property_stock_account_input_categ.id
|
||||
if not stock_input_acc:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
_('There is no stock input account defined ' \
|
||||
_('Define stock input account ' \
|
||||
'for this product: "%s" (id: %d)') % \
|
||||
(product.name,
|
||||
product.id,))
|
||||
|
@ -165,7 +165,7 @@ class product_product(osv.osv):
|
|||
property_stock_account_output_categ.id
|
||||
if not stock_output_acc:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
_('There is no stock output account defined ' \
|
||||
_('Define stock output account ' \
|
||||
'for this product: "%s" (id: %d)') % \
|
||||
(product.name,
|
||||
product.id,))
|
||||
|
|
|
@ -516,7 +516,7 @@ class stock_tracking(osv.osv):
|
|||
return res
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
raise osv.except_osv(_('Error'), _('You can not remove a lot line !'))
|
||||
raise osv.except_osv(_('Error'), _('You cannot remove a lot line.'))
|
||||
|
||||
def action_traceability(self, cr, uid, ids, context={}):
|
||||
""" It traces the information of a product
|
||||
|
@ -762,7 +762,7 @@ class stock_picking(osv.osv):
|
|||
wf_service = netsvc.LocalService("workflow")
|
||||
for pick in self.browse(cr, uid, ids):
|
||||
if not pick.move_lines:
|
||||
raise osv.except_osv(_('Error !'),_('You can not process picking without stock moves'))
|
||||
raise osv.except_osv(_('Error !'),_('You cannot process picking without stock moves.'))
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick.id,
|
||||
'button_confirm', cr)
|
||||
return True
|
||||
|
@ -2166,22 +2166,22 @@ class stock_move(osv.osv):
|
|||
journal_id = accounts['stock_journal']
|
||||
|
||||
if acc_dest == acc_valuation:
|
||||
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Output Account defined on this product and Valuation account on category of this product are same.'))
|
||||
raise osv.except_osv(_('Error!'), _('Cannot create Journal Entry, Output Account of this product and Valuation account on category of this product are same.'))
|
||||
|
||||
if acc_src == acc_valuation:
|
||||
raise osv.except_osv(_('Error!'), _('Can not create Journal Entry, Input Account defined on 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:
|
||||
raise osv.except_osv(_('Error!'), _('There is no stock input account defined for this product or its category: "%s" (id: %d)') % \
|
||||
raise osv.except_osv(_('Error!'), _('Define stock input account for this product or its category: "%s" (id: %d)') % \
|
||||
(move.product_id.name, move.product_id.id,))
|
||||
if not acc_dest:
|
||||
raise osv.except_osv(_('Error!'), _('There is no stock output account defined for this product or its category: "%s" (id: %d)') % \
|
||||
raise osv.except_osv(_('Error!'), _('Define stock output account for this product or its category: "%s" (id: %d)') % \
|
||||
(move.product_id.name, move.product_id.id,))
|
||||
if not journal_id:
|
||||
raise osv.except_osv(_('Error!'), _('There is no journal defined on the product category: "%s" (id: %d)') % \
|
||||
raise osv.except_osv(_('Error!'), _('Define journal on the product category: "%s" (id: %d)') % \
|
||||
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
|
||||
if not acc_valuation:
|
||||
raise osv.except_osv(_('Error!'), _('There is no inventory Valuation account defined on the product category: "%s" (id: %d)') % \
|
||||
raise osv.except_osv(_('Error!'), _('Define inventory valuation account on the product category: "%s" (id: %d)') % \
|
||||
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
|
||||
return journal_id, acc_src, acc_dest, acc_valuation
|
||||
|
||||
|
@ -2387,7 +2387,7 @@ class stock_move(osv.osv):
|
|||
"""
|
||||
#quantity should in MOVE UOM
|
||||
if quantity <= 0:
|
||||
raise osv.except_osv(_('Warning!'), _('Please provide a positive quantity to scrap!'))
|
||||
raise osv.except_osv(_('Warning!'), _('Please provide a positive quantity to scrap.'))
|
||||
res = []
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
move_qty = move.product_qty
|
||||
|
@ -2431,7 +2431,7 @@ class stock_move(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
if quantity <= 0:
|
||||
raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
|
||||
raise osv.except_osv(_('Warning!'), _('Please provide proper quantity.'))
|
||||
|
||||
res = []
|
||||
|
||||
|
@ -2492,12 +2492,12 @@ class stock_move(osv.osv):
|
|||
if context is None:
|
||||
context = {}
|
||||
if quantity <= 0:
|
||||
raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
|
||||
raise osv.except_osv(_('Warning!'), _('Please provide proper quantity.'))
|
||||
res = []
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
move_qty = move.product_qty
|
||||
if move_qty <= 0:
|
||||
raise osv.except_osv(_('Error!'), _('Can not consume a move with negative or zero quantity !'))
|
||||
raise osv.except_osv(_('Error!'), _('Cannot consume a move with negative or zero quantity.'))
|
||||
quantity_rest = move.product_qty
|
||||
quantity_rest -= quantity
|
||||
uos_qty_rest = quantity_rest / move_qty * move.product_uos_qty
|
||||
|
|
|
@ -109,7 +109,7 @@ class stock_invoice_onshipping(osv.osv_memory):
|
|||
action_model = False
|
||||
action = {}
|
||||
if not invoice_ids:
|
||||
raise osv.except_osv(_('Error'), _('No Invoices were created'))
|
||||
raise osv.except_osv(_('Error'), _('No Invoices were created.'))
|
||||
if inv_type == "out_invoice":
|
||||
action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree1")
|
||||
elif inv_type == "in_invoice":
|
||||
|
|
|
@ -164,7 +164,7 @@ class stock_partial_picking(osv.osv_memory):
|
|||
|
||||
#Quantiny must be Positive
|
||||
if wizard_line.quantity < 0:
|
||||
raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
|
||||
raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity.'))
|
||||
|
||||
#Compute the quantity for respective wizard_line in the line uom (this jsut do the rounding if necessary)
|
||||
qty_in_line_uom = uom_obj._compute_qty(cr, uid, line_uom.id, wizard_line.quantity, line_uom.id)
|
||||
|
|
|
@ -103,7 +103,7 @@ class stock_return_picking(osv.osv_memory):
|
|||
if m.product_qty * m.product_uom.factor > return_history[m.id]:
|
||||
valid_lines += 1
|
||||
if not valid_lines:
|
||||
raise osv.except_osv(_('Warning !'), _("There are no products to return (only lines in Done state and not fully returned yet can be returned)!"))
|
||||
raise osv.except_osv(_('Warning !'), _("No products to return (only lines in Done state and not fully returned yet can be returned)!"))
|
||||
return res
|
||||
|
||||
def get_return_history(self, cr, uid, pick_id, context=None):
|
||||
|
@ -195,7 +195,7 @@ class stock_return_picking(osv.osv_memory):
|
|||
})
|
||||
move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]}, context=context)
|
||||
if not returned_lines:
|
||||
raise osv.except_osv(_('Warning !'), _("Please specify at least one non-zero quantity!"))
|
||||
raise osv.except_osv(_('Warning !'), _("Please specify at least one non-zero quantity."))
|
||||
|
||||
if set_invoice_state_to_none:
|
||||
pick_obj.write(cr, uid, [pick.id], {'invoice_state':'none'}, context=context)
|
||||
|
|
|
@ -68,7 +68,7 @@ class stock_planning_createlines(osv.osv_memory):
|
|||
prod_categ_ids = prod_categ_obj.search(cr,uid,[('parent_id','child_of',categ_ids)])
|
||||
products_id1 = product_obj.search(cr,uid,[('categ_id','in',prod_categ_ids)])
|
||||
if len(products_id1)==0:
|
||||
raise osv.except_osv(_('Error !'), _('No forecasts for selected period or no products in selected category !'))
|
||||
raise osv.except_osv(_('Error !'), _('No forecasts for selected period or no products available in selected category !'))
|
||||
|
||||
for p in product_obj.browse(cr, uid, products_id1,context=context):
|
||||
if len(planning_obj.search(cr, uid, [('product_id','=',p.id),
|
||||
|
|
|
@ -55,7 +55,7 @@ class stock_sale_forecast_createlines(osv.osv_memory):
|
|||
prod_categ_ids = prod_categ_obj.search(cr, uid, [('parent_id','child_of', categ_ids)])
|
||||
products_ids = product_obj.search(cr, uid, [('categ_id','in',prod_categ_ids)])
|
||||
if len(products_ids) == 0:
|
||||
raise osv.except_osv(_('Error !'), _('No products in selected category !'))
|
||||
raise osv.except_osv(_('Error !'), _('No products available in selected category !'))
|
||||
copy = f.copy_forecast
|
||||
for p in product_obj.browse(cr, uid, products_ids,{}):
|
||||
if len(forecast_obj.search(cr, uid, [('product_id','=',p.id) , \
|
||||
|
|
Loading…
Reference in New Issue