[IMP] Improved warning messages/exceptions of purchase modules
authorpso (OpenERP) <pso@tinyerp.com>
Mon, 16 Jul 2012 11:34:25 +0000 (17:04 +0530)
committerpso (OpenERP) <pso@tinyerp.com>
Mon, 16 Jul 2012 11:34:25 +0000 (17:04 +0530)
bzr revid: pso@tinyerp.com-20120716113425-o30kv0bwg1lyug8t

addons/purchase/i18n/purchase.pot
addons/purchase/purchase.py
addons/purchase_requisition/i18n/purchase_requisition.pot
addons/purchase_requisition/wizard/purchase_requisition_partner.py

index 44355e2..c6fc09c 100644 (file)
@@ -61,7 +61,7 @@ msgstr ""
 #. module: purchase
 #: code:addons/purchase/purchase.py:236
 #, python-format
-msgid "In order to delete a purchase order, it must be cancelled first!"
+msgid "In order to delete a purchase order, it must be cancelled first.'))"
 msgstr ""
 
 #. module: purchase
@@ -641,7 +641,7 @@ msgstr ""
 #. module: purchase
 #: code:addons/purchase/purchase.py:349
 #, python-format
-msgid "There is no purchase journal defined for this company: \"%s\" (id:%d)"
+msgid "No purchase journal is defined for this company: \"%s\" (id:%d)"
 msgstr ""
 
 #. module: purchase
@@ -1175,7 +1175,7 @@ msgstr ""
 #. module: purchase
 #: code:addons/purchase/purchase.py:411 code:addons/purchase/purchase.py:418
 #, python-format
-msgid "Unable to cancel this purchase order!"
+msgid "Unable to cancel this purchase order."
 msgstr ""
 
 #. module: purchase
@@ -1745,7 +1745,7 @@ msgstr ""
 #: code:addons/purchase/purchase.py:359
 #: code:addons/purchase/wizard/purchase_line_invoice.py:112
 #, python-format
-msgid "There is no expense account defined for this product: \"%s\" (id:%d)"
+msgid "No expense account is defined for this company: \"%s\" (id:%d)"
 msgstr ""
 
 #. module: purchase
@@ -1762,7 +1762,7 @@ msgstr ""
 #: code:addons/purchase/purchase.py:735
 #, python-format
 msgid ""
-"You have to select a pricelist or a supplier in the purchase form !\n"
+"Before choosing a product,\n select a price list for a supplier in the purchase form.'))\n"
 "Please set one before choosing a product."
 msgstr ""
 
index f768f29..9e77180 100644 (file)
@@ -238,7 +238,7 @@ class purchase_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 purchase order, it must be cancelled first!'))
+                raise osv.except_osv(_('Invalid action !'), _('In order to delete a purchase order, it must be cancelled first.'))
 
         # TODO: temporary fix in 5.0, to remove in 5.2 when subflows support
         # automatically sending subflow.delete upon deletion
@@ -428,7 +428,7 @@ class purchase_order(osv.osv):
             journal_ids = journal_obj.search(cr, uid, [('type', '=','purchase'),('company_id', '=', order.company_id.id)], limit=1)
             if not journal_ids:
                 raise osv.except_osv(_('Error !'),
-                    _('There is no purchase journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
+                    _('No purchase journal is defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
 
             # generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line
             inv_lines = []
@@ -438,7 +438,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 !'), _('There is no expense account defined for this product: "%s" (id:%d)') % (po_line.product_id.name, po_line.product_id.id,))
+                        raise osv.except_osv(_('Error !'), _('No expense account is defined for this company: "%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').id
                 fpos = order.fiscal_position or False
@@ -495,15 +495,15 @@ class purchase_order(osv.osv):
             for pick in purchase.picking_ids:
                 if pick.state not in ('draft','cancel'):
                     raise osv.except_osv(
-                        _('Unable to cancel this purchase order!'),
-                        _('You must first cancel all receptions related to this purchase order.'))
+                        _('Unable to cancel this purchase order.'),
+                        _('First cancelled all receptions related to this purchase order.'))
             for pick in purchase.picking_ids:
                 wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_cancel', cr)
             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 invoices related to this purchase order.'))
+                        _('Unable to cancel this purchase order.'),
+                        _('First cancelled all receptions related to this purchase order.'))
                 if inv:
                     wf_service.trg_validate(uid, 'account.invoice', inv.id, 'invoice_cancel', cr)
         self.write(cr,uid,ids,{'state':'cancel'})
@@ -886,9 +886,9 @@ class purchase_order_line(osv.osv):
 
         # - check for the presence of partner_id and pricelist_id
         if not pricelist_id:
-            raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist or a supplier in the purchase form !\nPlease set one before choosing a product.'))
+            raise osv.except_osv(_('No Pricelist !'), _('Before choosing a product,\n select a price list for a supplier in the purchase form.'))
         if not partner_id:
-            raise osv.except_osv(_('No Partner!'), _('You have to select a partner in the purchase form !\nPlease set one partner before choosing a product.'))
+            raise osv.except_osv(_('No Partner!'), _('Before choosing a product.\n select a partner in purchase order.'))
 
         # - determine name and notes based on product in partner lang.
         lang = res_partner.browse(cr, uid, partner_id).lang
index c8866a0..b3b8aa3 100644 (file)
@@ -29,7 +29,7 @@ msgstr ""
 #. module: purchase_requisition
 #: code:addons/purchase_requisition/wizard/purchase_requisition_partner.py:42
 #, python-format
-msgid "No Product in Tender"
+msgid "No Product in Tender."
 msgstr ""
 
 #. module: purchase_requisition
index b18f6f3..40057fa 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 Tender.'))
         return res
 
     def create_order(self, cr, uid, ids, context=None):