From a028157690124f640c6ae53431faddc853d4b73e Mon Sep 17 00:00:00 2001 From: "Saurang Suthar(OpenERP)" <> Date: Wed, 25 Jul 2012 15:14:40 +0530 Subject: [PATCH] [IMP] Improved warning messages for purchase module bzr revid: pso@tinyerp.com-20120725094440-jkyoxe5agavhafyw --- addons/purchase/i18n/purchase.pot | 20 ++++++++++---------- addons/purchase/purchase.py | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/addons/purchase/i18n/purchase.pot b/addons/purchase/i18n/purchase.pot index 306c9501424..67ab862d434 100644 --- a/addons/purchase/i18n/purchase.pot +++ b/addons/purchase/i18n/purchase.pot @@ -391,9 +391,9 @@ msgid "Stock Move" msgstr "" #. module: purchase -#: code:addons/purchase/purchase.py:419 +#: code:addons/purchase/purchase.py:506 #, python-format -msgid "You must first cancel all invoices related to this purchase order." +msgid "First cancel all invoices related to this purchase order." msgstr "" #. module: purchase @@ -441,9 +441,9 @@ msgid "Order in last month" msgstr "" #. module: purchase -#: code:addons/purchase/purchase.py:412 +#: code:addons/purchase/purchase.py:499 #, python-format -msgid "You must first cancel all receptions related to this purchase order." +msgid "First cancel all receptions related to this purchase order." msgstr "" #. module: purchase @@ -670,9 +670,9 @@ msgid "Miscellaneous" msgstr "" #. module: purchase -#: code:addons/purchase/purchase.py:769 +#: code:addons/purchase/purchase.py:924 #, python-format -msgid "The selected supplier only sells this product by %s" +msgid "The selected supplier only sells this product by %s." msgstr "" #. module: purchase @@ -735,9 +735,9 @@ msgid "Receptions" msgstr "" #. module: purchase -#: code:addons/purchase/purchase.py:285 +#: code:addons/purchase/purchase.py:370 #, python-format -msgid "You cannot confirm a purchase order without any lines." +msgid "You cannot confirm a purchase order without any purchase order line." msgstr "" #. module: purchase @@ -1172,9 +1172,9 @@ msgid "Cancel Purchase Order" msgstr "" #. module: purchase -#: code:addons/purchase/purchase.py:411 code:addons/purchase/purchase.py:418 +#: code:addons/purchase/purchase.py:498 code:addons/purchase/purchase.py:505 #, python-format -msgid "Unable to cancel this purchase order." +msgid "Unable to cancel this purchase order!" msgstr "" #. module: purchase diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 9b686abd0a6..dc436e9246c 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -367,7 +367,7 @@ class purchase_order(osv.osv): todo = [] for po in self.browse(cr, uid, ids, context=context): if not po.order_line: - raise osv.except_osv(_('Error !'),_('You cannot confirm a purchase order without any lines.')) + raise osv.except_osv(_('Error !'),_('You cannot confirm a purchase order without any purchase order line.')) for line in po.order_line: if line.state=='draft': todo.append(line.id) @@ -908,7 +908,7 @@ class purchase_order_line(osv.osv): uom_id = product_uom_po_id if product.uom_id.category_id.id != product_uom.browse(cr, uid, uom_id, context=context).category_id.id: - res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')} + res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure.')} uom_id = product_uom_po_id res['value'].update({'product_uom': uom_id}) @@ -923,7 +923,7 @@ class purchase_order_line(osv.osv): if supplierinfo_ids: supplierinfo = product_supplierinfo.browse(cr, uid, supplierinfo_ids[0], context=context) if supplierinfo.product_uom.id != uom_id: - res['warning'] = {'title': _('Warning'), 'message': _('The selected supplier only sells this product by %s') % supplierinfo.product_uom.name } + res['warning'] = {'title': _('Warning'), 'message': _('The selected supplier only sells this product by %s.') % supplierinfo.product_uom.name } min_qty = product_uom._compute_qty(cr, uid, supplierinfo.product_uom.id, supplierinfo.min_qty, to_uom_id=uom_id) if qty < min_qty: # If the supplier quantity is greater than entered from user, set minimal. res['warning'] = {'title': _('Warning'), 'message': _('The selected supplier has a minimal quantity set to %s %s, you should not purchase less.') % (supplierinfo.min_qty, supplierinfo.product_uom.name)}