[FIX] pos_mercury: missing translation ability
Made the error message more understandable Closes #17276
This commit is contained in:
@@ -603,6 +603,18 @@ msgstr ""
|
||||
msgid "Name of this Mercury configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_mercury
|
||||
#: code:addons/pos_mercury/models/pos_mercury_transaction.py:35
|
||||
#, python-format
|
||||
msgid "No Mercury configuration associated with the journal."
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_mercury
|
||||
#: code:addons/pos_mercury/models/pos_mercury_transaction.py:23
|
||||
#, python-format
|
||||
msgid "No opened point of sale session for user %s found"
|
||||
msgstr ""
|
||||
|
||||
#. module: pos_mercury
|
||||
#. openerp-web
|
||||
#: code:addons/pos_mercury/static/src/js/pos_mercury.js:334
|
||||
|
||||
@@ -9,6 +9,7 @@ import ssl
|
||||
import werkzeug
|
||||
|
||||
from odoo import models, api, service
|
||||
from odoo.tools.translate import _
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
|
||||
|
||||
@@ -19,7 +20,7 @@ class MercuryTransaction(models.Model):
|
||||
def _get_pos_session(self):
|
||||
pos_session = self.env['pos.session'].search([('state', '=', 'opened'), ('user_id', '=', self.env.uid)], limit=1)
|
||||
if not pos_session:
|
||||
raise UserError("No POS session")
|
||||
raise UserError(_("No opened point of sale session for user %s found") % self.env.user.name)
|
||||
|
||||
pos_session.login()
|
||||
|
||||
@@ -31,7 +32,7 @@ class MercuryTransaction(models.Model):
|
||||
if journal and journal.pos_mercury_config_id:
|
||||
return journal.pos_mercury_config_id
|
||||
else:
|
||||
raise UserError("No Mercury configuration associated with the journal.")
|
||||
raise UserError(_("No Mercury configuration associated with the journal."))
|
||||
|
||||
def _setup_request(self, data):
|
||||
# todo: in master make the client include the pos.session id and use that
|
||||
|
||||
Reference in New Issue
Block a user