[IMP] improved warning messages
authorBharat R. Devnani (OpenERP) <bde@tinyerp.com>
Mon, 2 Dec 2013 08:42:04 +0000 (14:12 +0530)
committerBharat R. Devnani (OpenERP) <bde@tinyerp.com>
Mon, 2 Dec 2013 08:42:04 +0000 (14:12 +0530)
bzr revid: bde@tinyerp.com-20131202084204-r0br5ytoc12ysjrl

addons/delivery/delivery.py
addons/hr_timesheet_sheet/hr_timesheet_sheet.py
addons/purchase/purchase.py
addons/purchase_requisition/wizard/purchase_requisition_partner.py
addons/sale_stock/sale_stock.py
addons/stock/stock.py

index 7675021..c388b1d 100644 (file)
@@ -217,7 +217,7 @@ class delivery_grid(osv.osv):
                 ok = True
                 break
         if not ok:
-            raise osv.except_osv(_('No price available!'), _('No line matched this product or order in the chosen delivery grid.'))
+            raise osv.except_osv(_("Unable to fetch delivery method!"), _("Selected product in the delivery method doesn't fulfill any of the delivery grid(s) criteria."))
 
         return price
 
index 9226787..12eae4e 100644 (file)
@@ -65,7 +65,7 @@ class hr_timesheet_sheet(osv.osv):
     def create(self, cr, uid, vals, *args, **argv):
         if 'employee_id' in vals:
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id:
-                raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.'))
+                raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must relate a user to it.'))
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id:
                 raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product, like \'Consultant\'.'))
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id:
@@ -76,7 +76,7 @@ class hr_timesheet_sheet(osv.osv):
         if 'employee_id' in vals:
             new_user_id = self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id.id or False
             if not new_user_id:
-                raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.'))
+                raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must relate a user to it.'))
             if not self._sheet_date(cr, uid, ids, forced_user_id=new_user_id):
                 raise osv.except_osv(_('Error!'), _('You cannot have 2 timesheets that overlap!\nYou should use the menu \'My Timesheet\' to avoid this problem.'))
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id:
index 75f6856..1befe7c 100644 (file)
@@ -476,7 +476,7 @@ class purchase_order(osv.osv):
             if not acc_id:
                 acc_id = po_line.product_id.categ_id.property_account_expense_categ.id
             if not acc_id:
-                raise osv.except_osv(_('Error!'), _('Define expense account for this company: "%s" (id:%d).') % (po_line.product_id.name, po_line.product_id.id,))
+                raise osv.except_osv(_('Error!'), _('Define expense account for this product: "%s" (id:%d).') % (po_line.product_id.name, po_line.product_id.id,))
         else:
             acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category', context=context).id
         fpos = po_line.order_id.fiscal_position or False
@@ -597,8 +597,7 @@ class purchase_order(osv.osv):
             for inv in purchase.invoice_ids:
                 if inv and inv.state not in ('cancel','draft'):
                     raise osv.except_osv(
-                        _('Unable to cancel this purchase order.'),
-                        _('You must first cancel all receptions related to this purchase order.'))
+                        _('You must first cancel all invoices related to this purchase order.'))
             self.pool.get('account.invoice') \
                 .signal_invoice_cancel(cr, uid, map(attrgetter('id'), purchase.invoice_ids))
         self.write(cr,uid,ids,{'state':'cancel'})
index 0fee874..5aeb2c8 100644 (file)
@@ -38,7 +38,7 @@ class purchase_requisition_partner(osv.osv_memory):
         record_id = context and context.get('active_id', False) or False
         tender = self.pool.get('purchase.requisition').browse(cr, uid, record_id, context=context)
         if not tender.line_ids:
-            raise osv.except_osv(_('Error!'), _('No Product in Tender.'))
+            raise osv.except_osv(_('Error!'), _('No Product in Requisition.'))
         return res
 
     def create_order(self, cr, uid, ids, context=None):
index 341aaef..6135e43 100644 (file)
@@ -160,7 +160,7 @@ class sale_order(osv.osv):
             if s['state'] in ['draft', 'cancel']:
                 unlink_ids.append(s['id'])
             else:
-                raise osv.except_osv(_('Invalid Action!'), _('In order to delete a confirmed sales order, you must cancel it.\nTo do so, you must first cancel related picking for delivery orders.'))
+                raise osv.except_osv(_('Invalid Action!'), _('In order to delete a confirmed sales order, you must cancel it. \nTo do so, you must first cancel all related delivery order(s).'))
 
         return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
 
index 69d2c6e..524a516 100644 (file)
@@ -1195,7 +1195,7 @@ class stock_picking(osv.osv):
                 return True
             for move in pick.move_lines:
                 if move.state == 'done':
-                    raise osv.except_osv(_('Error!'), _('You cannot cancel the picking as some moves have been done. You should cancel the picking lines.'))
+                    raise osv.except_osv(_('Error!'), _('You cannot cancel the picking as some moves have been done. You should cancel remaining moves of this picking.'))
         return True
 
     def unlink(self, cr, uid, ids, context=None):