diff --git a/pos_eater/README.rst b/pos_eater/README.rst new file mode 100644 index 000000000..c618f800c --- /dev/null +++ b/pos_eater/README.rst @@ -0,0 +1,62 @@ +========= +POS Eater +========= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1b2557c6c403b8c1ddac87cb59f8bfdfe44bb87c8b17fec33cac593784107c1a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-beescoop%2FObeesdoo-lightgray.png?logo=github + :target: https://github.com/beescoop/Obeesdoo/tree/16.0/pos_eater + :alt: beescoop/Obeesdoo + +|badge1| |badge2| |badge3| + +Adds the eaters of the customer to the POS ActionpadWidget. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* BEES coop - Cellule IT +* Coop IT Easy SC + +Contributors +~~~~~~~~~~~~ + +* BEES coop - Cellule IT +* Coop IT Easy SC + +Maintainers +~~~~~~~~~~~ + +This module is part of the `beescoop/Obeesdoo `_ project on GitHub. + +You are welcome to contribute. diff --git a/pos_eater/__init__.py b/pos_eater/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/pos_eater/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_eater/__manifest__.py b/pos_eater/__manifest__.py new file mode 100644 index 000000000..8539e02ad --- /dev/null +++ b/pos_eater/__manifest__.py @@ -0,0 +1,28 @@ +# Copyright 2017 - 2020 BEES coop SCRLfs +# - Elouan Lebars +# - Rémy Taymans +# - Vincent Van Rossem +# - Elise Dupont +# - Thibault François +# - Grégoire Leeuwerck +# - Houssine Bakkali +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "POS Eater", + "summary": """This module adds the eaters of the customer to the POS + ActionpadWidget.""", + "author": "BEES coop - Cellule IT, Coop IT Easy SC", + "website": "https://github.com/beescoop/Obeesdoo", + "category": "Point Of Sale", + "version": "16.0.1.0.0", + "depends": ["point_of_sale", "eater"], + "assets": { + "point_of_sale.assets": [ + "pos_eater/static/src/css/pos.css", + "pos_eater/static/src/js/**/*.js", + "pos_eater/static/src/xml/**/*.xml", + ], + }, + "installable": True, + "license": "AGPL-3", +} diff --git a/pos_eater/i18n/beesdoo_pos.pot b/pos_eater/i18n/beesdoo_pos.pot new file mode 100644 index 000000000..358f0ddc3 --- /dev/null +++ b/pos_eater/i18n/beesdoo_pos.pot @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * beesdoo_pos +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \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: beesdoo_pos +#: model:ir.model,name:beesdoo_pos.model_res_partner +msgid "Contact" +msgstr "" + +#. module: beesdoo_pos +#. openerp-web +#: code:addons/beesdoo_pos/static/src/xml/templates.xml:21 +#, python-format +msgid "Name" +msgstr "" + +#. module: beesdoo_pos +#: model:ir.model,name:beesdoo_pos.model_product_template +msgid "Product Template" +msgstr "" + diff --git a/pos_eater/i18n/pos_eater.pot b/pos_eater/i18n/pos_eater.pot new file mode 100644 index 000000000..837b41b63 --- /dev/null +++ b/pos_eater/i18n/pos_eater.pot @@ -0,0 +1,20 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_eater +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \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: pos_eater +#: model:ir.model,name:pos_eater.model_res_partner +msgid "Contact" +msgstr "" + diff --git a/pos_eater/models/__init__.py b/pos_eater/models/__init__.py new file mode 100644 index 000000000..f7116e3d4 --- /dev/null +++ b/pos_eater/models/__init__.py @@ -0,0 +1 @@ +from . import pos_session diff --git a/pos_eater/models/pos_session.py b/pos_eater/models/pos_session.py new file mode 100644 index 000000000..85b949b09 --- /dev/null +++ b/pos_eater/models/pos_session.py @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2024 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from odoo import models + + +class PosSession(models.Model): + _inherit = "pos.session" + + def _loader_params_res_partner(self): + result = super()._loader_params_res_partner() + result["search_params"]["fields"].append("child_eater_ids") + return result diff --git a/pos_eater/readme/CONTRIBUTORS.rst b/pos_eater/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..5cf09c295 --- /dev/null +++ b/pos_eater/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* BEES coop - Cellule IT +* Coop IT Easy SC diff --git a/pos_eater/readme/DESCRIPTION.rst b/pos_eater/readme/DESCRIPTION.rst new file mode 100644 index 000000000..9e5d18b46 --- /dev/null +++ b/pos_eater/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Adds the eaters of the customer to the POS ActionpadWidget. diff --git a/pos_eater/static/description/index.html b/pos_eater/static/description/index.html new file mode 100644 index 000000000..77b8d94c6 --- /dev/null +++ b/pos_eater/static/description/index.html @@ -0,0 +1,417 @@ + + + + + +POS Eater + + + +
+

POS Eater

+ + +

Beta License: AGPL-3 beescoop/Obeesdoo

+

Adds the eaters of the customer to the POS ActionpadWidget.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • BEES coop - Cellule IT
  • +
  • Coop IT Easy SC
  • +
+
+
+

Contributors

+
    +
  • BEES coop - Cellule IT
  • +
  • Coop IT Easy SC
  • +
+
+
+

Maintainers

+

This module is part of the beescoop/Obeesdoo project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/pos_eater/static/src/css/pos.css b/pos_eater/static/src/css/pos.css new file mode 100644 index 000000000..4df33acc5 --- /dev/null +++ b/pos_eater/static/src/css/pos.css @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2024 Coop IT Easy SC + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +.pos .actionpad .button.set-partner .eaters { + font-weight: normal; + display: block; +} diff --git a/pos_eater/static/src/js/ActionpadWidget.esm.js b/pos_eater/static/src/js/ActionpadWidget.esm.js new file mode 100644 index 000000000..7569729a9 --- /dev/null +++ b/pos_eater/static/src/js/ActionpadWidget.esm.js @@ -0,0 +1,20 @@ +/** @odoo-module alias=pos_eater.ActionpadWidget **/ +// SPDX-FileCopyrightText: 2024 Coop IT Easy SC +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +import Registries from "point_of_sale.Registries"; +import ActionpadWidget from "point_of_sale.ActionpadWidget"; + +const EaterActionpadWidget = (ActionpadWidget) => + class extends ActionpadWidget { + get eaterNames() { + const names = this.props.partner.child_eater_ids.map( + (id) => this.env.pos.db.get_partner_by_id(id).name + ); + return names.join(", "); + } + }; + +Registries.Component.extend(ActionpadWidget, EaterActionpadWidget); +export default EaterActionpadWidget; diff --git a/pos_eater/static/src/xml/ActionpadWidget.xml b/pos_eater/static/src/xml/ActionpadWidget.xml new file mode 100644 index 000000000..4b9b4dc7f --- /dev/null +++ b/pos_eater/static/src/xml/ActionpadWidget.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + diff --git a/setup/pos_eater/odoo/addons/pos_eater b/setup/pos_eater/odoo/addons/pos_eater new file mode 120000 index 000000000..eab0560c4 --- /dev/null +++ b/setup/pos_eater/odoo/addons/pos_eater @@ -0,0 +1 @@ +../../../../pos_eater \ No newline at end of file diff --git a/setup/pos_eater/setup.py b/setup/pos_eater/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/pos_eater/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)