[IMP] Improved warning messages for POS module
bzr revid: pso@tinyerp.com-20120725104932-1awd9eerplzglhui
This commit is contained in:
parent
e9f73afd66
commit
b7a5a1d928
|
@ -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
|
||||||
|
|
|
@ -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'),
|
||||||
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue