From b7a5a1d928edd12092f1260caff05d7c7efbee69 Mon Sep 17 00:00:00 2001 From: "Saurang Suthar(OpenERP)" <> Date: Wed, 25 Jul 2012 16:19:32 +0530 Subject: [PATCH] [IMP] Improved warning messages for POS module bzr revid: pso@tinyerp.com-20120725104932-1awd9eerplzglhui --- addons/point_of_sale/i18n/point_of_sale.pot | 2 +- addons/point_of_sale/point_of_sale.py | 18 +++++++++--------- addons/point_of_sale/wizard/pos_box_entries.py | 2 +- addons/point_of_sale/wizard/pos_box_out.py | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/addons/point_of_sale/i18n/point_of_sale.pot b/addons/point_of_sale/i18n/point_of_sale.pot index b0f707c5ba6..8c766f112f2 100644 --- a/addons/point_of_sale/i18n/point_of_sale.pot +++ b/addons/point_of_sale/i18n/point_of_sale.pot @@ -2523,7 +2523,7 @@ msgstr "" #. module: point_of_sale #: code:addons/point_of_sale/wizard/pos_box_out.py:86 #, python-format -msgid "please check that account is set to %s" +msgid "please check that account is set to %s." msgstr "" #. module: point_of_sale diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 7a58f4983cb..9a4962ba5ea 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -301,8 +301,8 @@ class pos_session(osv.osv): return True _constraints = [ - (_check_unicity, "You can not create two active sessions with the same responsible!", ['user_id', 'state']), - (_check_pos_config, "You can not create two active sessions related to the same point of sale!", ['config_id']), + (_check_unicity, "You cannot create two active sessions with the same responsible!", ['user_id', 'state']), + (_check_pos_config, "You cannot create two active sessions related to the same point of sale!", ['config_id']), ] def create(self, cr, uid, values, context=None): @@ -404,7 +404,7 @@ class pos_session(osv.osv): if order.state != 'paid': raise osv.except_osv( _('Error !'), - _("You can not confirm all orders of this session, because they have not the 'paid' status")) + _("You cannot confirm all orders of this session, because they have not the 'paid' status")) else: wf_service.trg_validate(uid, 'pos.order', order.id, 'done', cr) @@ -513,7 +513,7 @@ class pos_order(osv.osv): 'company_id':fields.many2one('res.company', 'Company', required=True, readonly=True), 'shop_id': fields.related('session_id', 'config_id', 'shop_id', relation='sale.shop', type='many2one', string='Shop', store=True, readonly=True), 'date_order': fields.datetime('Order Date', readonly=True, select=True), - 'user_id': fields.many2one('res.users', 'Salesman', help="Person who uses the the cash register. It could be a reliever, a student or an interim employee."), + 'user_id': fields.many2one('res.users', 'Salesman', help="Person who uses the the cash register. It can be a reliever, a student or an interim employee."), 'amount_tax': fields.function(_amount_all, string='Taxes', digits_compute=dp.get_precision('Point Of Sale'), multi='all'), 'amount_total': fields.function(_amount_all, string='Total', multi='all'), 'amount_paid': fields.function(_amount_all, string='Paid', states={'draft': [('readonly', False)]}, readonly=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'), @@ -677,7 +677,7 @@ class pos_order(osv.osv): msg = _('There is no receivable account defined to make payment.') else: msg = _('There is no receivable account defined to make payment for the partner: "%s" (id:%d).') % (order.partner_id.name, order.partner_id.id,) - raise osv.except_osv(_('Configuration Error !'), msg) + raise osv.except_osv(_('Configuration Error!'), msg) context.pop('pos_session_id', False) @@ -693,7 +693,7 @@ class pos_order(osv.osv): break if not statement_id: - raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox')) + raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox.')) args.update({ 'statement_id' : statement_id, @@ -839,7 +839,7 @@ class pos_order(osv.osv): #session_ids = set(order.session_id for order in self.browse(cr, uid, ids, context=context)) if session and not all(session.id == order.session_id.id for order in self.browse(cr, uid, ids, context=context)): - raise osv.except_osv(_('Error!'), _('The selected orders do not have the same session !')) + raise osv.except_osv(_('Error!'), _('Selected orders do not have the same session!')) current_company = user_proxy.browse(cr, uid, uid, context=context).company_id @@ -944,8 +944,8 @@ class pos_order(osv.osv): elif line.product_id.categ_id.property_account_income_categ.id: income_account = line.product_id.categ_id.property_account_income_categ.id else: - raise osv.except_osv(_('Error !'), _('There is no income '\ - 'account defined for this product: "%s" (id:%d).') \ + raise osv.except_osv(_('Error!'), _('Please define income '\ + 'account for this product: "%s" (id:%d).') \ % (line.product_id.name, line.product_id.id, )) # Empty the tax list as long as there is no tax code: diff --git a/addons/point_of_sale/wizard/pos_box_entries.py b/addons/point_of_sale/wizard/pos_box_entries.py index 647d5625448..d68e19dd736 100644 --- a/addons/point_of_sale/wizard/pos_box_entries.py +++ b/addons/point_of_sale/wizard/pos_box_entries.py @@ -115,7 +115,7 @@ class pos_box_entries(osv.osv_memory): curr_company = res_obj.browse(cr, uid, uid, context=context).company_id.id statement_id = statement_obj.search(cr, uid, [('journal_id', '=', int(data['journal_id'])), ('company_id', '=', curr_company), ('user_id', '=', uid), ('state', '=', 'open')], context=context) if not statement_id: - raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox')) + raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox.')) product = product_obj.browse(cr, uid, int(data['product_id'])) acc_id = product.property_account_income or product.categ_id.property_account_income_categ diff --git a/addons/point_of_sale/wizard/pos_box_out.py b/addons/point_of_sale/wizard/pos_box_out.py index f09ea4e6d6d..6198f65f4b6 100644 --- a/addons/point_of_sale/wizard/pos_box_out.py +++ b/addons/point_of_sale/wizard/pos_box_out.py @@ -86,9 +86,9 @@ class pos_box_out(osv.osv_memory): product = product_obj.browse(cr, uid, data['product_id'], context=context) acc_id = product.property_account_expense or product.categ_id.property_account_expense_categ if not acc_id: - raise osv.except_osv(_('Error !'), _('please check that account is set to %s')%(product.name)) + raise osv.except_osv(_('Error !'), _('please check that account is set to %s.')%(product.name)) if not statement_ids: - raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox')) + raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox.')) vals['statement_id'] = statement_ids[0] vals['journal_id'] = data['journal_id'] vals['account_id'] = acc_id.id