diff --git a/addons/l10n_in_pos/i18n/l10n_in_pos.pot b/addons/l10n_in_pos/i18n/l10n_in_pos.pot new file mode 100644 index 00000000000..34ee4cd99c6 --- /dev/null +++ b/addons/l10n_in_pos/i18n/l10n_in_pos.pot @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_in_pos +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-06-12 07:24+0000\n" +"PO-Revision-Date: 2023-06-12 07:24+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_in_pos +#: code:addons/l10n_in_pos/models/pos_config.py:0 +#, python-format +msgid "Go to Company configuration" +msgstr "" + +#. module: l10n_in_pos +#. openerp-web +#: code:addons/l10n_in_pos/static/src/xml/pos_receipt.xml:0 +#, python-format +msgid "HSN Code:" +msgstr "" + +#. module: l10n_in_pos +#. openerp-web +#: code:addons/l10n_in_pos/static/src/xml/pos_receipt.xml:0 +#, python-format +msgid "Phone:" +msgstr "" + +#. module: l10n_in_pos +#: model:ir.model,name:l10n_in_pos.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: l10n_in_pos +#: model:ir.model,name:l10n_in_pos.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: l10n_in_pos +#: code:addons/l10n_in_pos/models/pos_config.py:0 +#, python-format +msgid "" +"Your company %s needs to have a correct address in order to open the session.\n" +"Set the address of your company (Don't forget the State field)" +msgstr "" diff --git a/addons/l10n_in_pos/models/__init__.py b/addons/l10n_in_pos/models/__init__.py index 9fb4d858140..d1d0d79d296 100644 --- a/addons/l10n_in_pos/models/__init__.py +++ b/addons/l10n_in_pos/models/__init__.py @@ -3,3 +3,4 @@ from . import pos_order from . import pos_session +from . import pos_config diff --git a/addons/l10n_in_pos/models/pos_config.py b/addons/l10n_in_pos/models/pos_config.py new file mode 100644 index 00000000000..ad3159df512 --- /dev/null +++ b/addons/l10n_in_pos/models/pos_config.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +from odoo import models +from odoo.exceptions import RedirectWarning +from odoo.tools.translate import _ + + +class PosConfig(models.Model): + _inherit = 'pos.config' + + def open_ui(self): + for config in self: + if config.company_id.country_id.code == 'IN' and not config.company_id.state_id: + msg = _("Your company %s needs to have a correct address in order to open the session.\n" + "Set the address of your company (Don't forget the State field)") % (config.company_id.name) + action = { + "view_mode": "form", + "res_model": "res.company", + "type": "ir.actions.act_window", + "res_id" : config.company_id.id, + "views": [[self.env.ref("base.view_company_form").id, "form"]], + } + raise RedirectWarning(msg, action, _('Go to Company configuration')) + return super(PosConfig, self).open_ui()