[IMP] Improved warning messages for POS module

bzr revid: pso@tinyerp.com-20120725104932-1awd9eerplzglhui
This commit is contained in:
Saurang Suthar(OpenERP) 2012-07-25 16:19:32 +05:30 committed by pso (OpenERP)
parent e9f73afd66
commit b7a5a1d928
4 changed files with 13 additions and 13 deletions

View File

@ -2523,7 +2523,7 @@ msgstr ""
#. module: point_of_sale #. module: point_of_sale
#: code:addons/point_of_sale/wizard/pos_box_out.py:86 #: code:addons/point_of_sale/wizard/pos_box_out.py:86
#, python-format #, python-format
msgid "please check that account is set to %s" msgid "please check that account is set to %s."
msgstr "" msgstr ""
#. module: point_of_sale #. module: point_of_sale

View File

@ -301,8 +301,8 @@ class pos_session(osv.osv):
return True return True
_constraints = [ _constraints = [
(_check_unicity, "You can not create two active sessions with the same responsible!", ['user_id', 'state']), (_check_unicity, "You cannot 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_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): def create(self, cr, uid, values, context=None):
@ -404,7 +404,7 @@ class pos_session(osv.osv):
if order.state != 'paid': if order.state != 'paid':
raise osv.except_osv( raise osv.except_osv(
_('Error !'), _('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: else:
wf_service.trg_validate(uid, 'pos.order', order.id, 'done', cr) 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), '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), '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), '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_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_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'), '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.') msg = _('There is no receivable account defined to make payment.')
else: 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,) 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) context.pop('pos_session_id', False)
@ -693,7 +693,7 @@ class pos_order(osv.osv):
break break
if not statement_id: 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({ args.update({
'statement_id' : statement_id, '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)) #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)): 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 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: elif line.product_id.categ_id.property_account_income_categ.id:
income_account = line.product_id.categ_id.property_account_income_categ.id income_account = line.product_id.categ_id.property_account_income_categ.id
else: else:
raise osv.except_osv(_('Error !'), _('There is no income '\ raise osv.except_osv(_('Error!'), _('Please define income '\
'account defined for this product: "%s" (id:%d).') \ 'account for this product: "%s" (id:%d).') \
% (line.product_id.name, line.product_id.id, )) % (line.product_id.name, line.product_id.id, ))
# Empty the tax list as long as there is no tax code: # Empty the tax list as long as there is no tax code:

View File

@ -115,7 +115,7 @@ class pos_box_entries(osv.osv_memory):
curr_company = res_obj.browse(cr, uid, uid, context=context).company_id.id 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) 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: 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'])) product = product_obj.browse(cr, uid, int(data['product_id']))
acc_id = product.property_account_income or product.categ_id.property_account_income_categ acc_id = product.property_account_income or product.categ_id.property_account_income_categ

View File

@ -86,9 +86,9 @@ class pos_box_out(osv.osv_memory):
product = product_obj.browse(cr, uid, data['product_id'], context=context) 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 acc_id = product.property_account_expense or product.categ_id.property_account_expense_categ
if not acc_id: 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: 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['statement_id'] = statement_ids[0]
vals['journal_id'] = data['journal_id'] vals['journal_id'] = data['journal_id']
vals['account_id'] = acc_id.id vals['account_id'] = acc_id.id