diff --git a/pos_place/README.rst b/pos_place/README.rst new file mode 100644 index 0000000000..f6d93d897c --- /dev/null +++ b/pos_place/README.rst @@ -0,0 +1,121 @@ +====================== +Point of Sale - Places +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:76c33b0f9ab5a91187648f2cbb4805ddd5b53349926991e221222f99385d2312 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/16.0/pos_place + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_place + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of point of sale to support saling +in the street using the point of sale and to allow you to mention on the +pos order, the place where the seller is for the time being. + +For that purpose, it introduce a new model ``pos.place``. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure this module, you need to: + +* Add your users to the new group 'Point of Sale - Places' (User or Manager) + +* Go to Point of Sale / Configuration / Places + +* Create your places + +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/pos_place_tree.png + +Usage +===== + +To use this module, you need to + +* open the point of sale + +* Click on 'Place' Button and select the place where you are + +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/pos_front_end_ui.png + +* All the next Pos Order will be related to this place. + +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/pos_order_tree.png + + +* You can then, make statistic over best places + +.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/report_pos_order_graph.png + +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 +~~~~~~~ + +* GRAP + +Contributors +~~~~~~~~~~~~ + +* Sylvain LE GAL + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px + :target: https://github.com/legalsylvain + :alt: legalsylvain + +Current `maintainer `__: + +|maintainer-legalsylvain| + +This module is part of the `OCA/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_place/__init__.py b/pos_place/__init__.py new file mode 100644 index 0000000000..bf588bc8b8 --- /dev/null +++ b/pos_place/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import report diff --git a/pos_place/__manifest__.py b/pos_place/__manifest__.py new file mode 100644 index 0000000000..c9872c1f4b --- /dev/null +++ b/pos_place/__manifest__.py @@ -0,0 +1,42 @@ +# Copyright (C) 2014 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Point of Sale - Places", + "summary": "Define places on PoS orders", + "version": "16.0.1.0.0", + "category": "Point of Sale", + "author": "GRAP,Odoo Community Association (OCA)", + "maintainers": ["legalsylvain"], + "website": "https://github.com/OCA/pos", + "license": "AGPL-3", + "depends": ["point_of_sale"], + "data": [ + "security/ir_module_category.xml", + "security/ir_rule.xml", + "security/res_groups.xml", + "security/ir.model.access.csv", + "views/view_account_move.xml", + "views/view_pos_place.xml", + "views/view_pos_order.xml", + ], + "assets": { + "point_of_sale.assets": [ + "pos_place/static/src/js/models.esm.js", + "pos_place/static/src/xml/ChromeWidgets/PosPlaceName.xml", + "pos_place/static/src/xml/ChromeWidgets/PosPlaceName.js", + "pos_place/static/src/xml/Chrome.xml", + ], + }, + # "qweb": [ + # "static/src/xml/pos_place.xml", + # ], + "demo": [ + "demo/pos_place.xml", + ], + "images": [ + "static/description/pos_front_end_ui.png", + "static/description/pos_config_form.png", + "static/description/pos_order_search.png", + ], +} diff --git a/pos_place/demo/pos_place.xml b/pos_place/demo/pos_place.xml new file mode 100644 index 0000000000..652737a144 --- /dev/null +++ b/pos_place/demo/pos_place.xml @@ -0,0 +1,24 @@ + + + + + + MUL + La Mulatière (69350 - France) + + + + OBS + Montée de L'observance (69009 - France) + + + + GAR + Gare de Francheville (69340 - France) + + + diff --git a/pos_place/i18n/es.po b/pos_place/i18n/es.po new file mode 100644 index 0000000000..22699eaba0 --- /dev/null +++ b/pos_place/i18n/es.po @@ -0,0 +1,165 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_place +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-07-27 11:19+0000\n" +"Last-Translator: Daniel Martinez Vila \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__active +msgid "Active" +msgstr "Activo" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__code +#: model_terms:ir.ui.view,arch_db:pos_place.view_pos_place_form +msgid "Code" +msgstr "Código" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__company_id +msgid "Company" +msgstr "Compañía" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__display_name +msgid "Display Name" +msgstr "Nombre a mostrar" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__id +msgid "ID" +msgstr "ID" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place____last_update +msgid "Last Modified on" +msgstr "Última modificación en" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__write_date +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: pos_place +#: model:res.groups,name:pos_place.group_pos_place_manager +msgid "Manager" +msgstr "Gerente" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__name +#: model_terms:ir.ui.view,arch_db:pos_place.view_pos_place_form +msgid "Name" +msgstr "Nombre" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/js/widget.js:41 +#: model:ir.model.fields,field_description:pos_place.field_account_invoice__place_id +#: model:ir.model.fields,field_description:pos_place.field_pos_order__place_id +#: model:ir.model.fields,field_description:pos_place.field_report_pos_order__place_id +#, python-format +msgid "Place" +msgstr "Lugar" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/xml/pos_place.xml:28 +#: code:addons/pos_place/static/src/xml/pos_place.xml:41 +#, python-format +msgid "Place:" +msgstr "Lugar:" + +#. module: pos_place +#: model:ir.actions.act_window,name:pos_place.action_pos_place +#: model:ir.ui.menu,name:pos_place.menu_pos_place +#: model:ir.ui.menu,name:pos_place.menu_pos_place_account +msgid "Places" +msgstr "Lugares" + +#. module: pos_place +#: model:ir.module.category,name:pos_place.module_category_pos_place +msgid "Point of Sale - Places" +msgstr "Punto de Venta - Lugares" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configuración del punto de venta" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_order +msgid "Point of Sale Orders" +msgstr "Pedidos de Punto de Venta" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_report_pos_order +msgid "Point of Sale Orders Report" +msgstr "Informe de pedidos de punto de venta" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_config__group_pos_place_user_id +msgid "Point of Sale Place User Group" +msgstr "Lugares del grupo de usuarios del Punto de Venta" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_place +msgid "Point of Sale Places" +msgstr "Lugares de Punto de Venta" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/js/gui.js:31 +#, python-format +msgid "Select a Place" +msgstr "Selecciona un lugar" + +#. module: pos_place +#: model:ir.model.fields,help:pos_place.field_pos_config__group_pos_place_user_id +msgid "" +"This field is there to pass the id of the pos place user group to the point " +"of sale client." +msgstr "" +"Este campo está allí para pasar la identificación del grupo de usuarios del " +"lugar PdV al cliente del punto de venta." + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_config__use_pos_place +msgid "Use Point of Sale places" +msgstr "Use lugares de puntos de venta" + +#. module: pos_place +#: model:res.groups,name:pos_place.group_pos_place_user +msgid "User" +msgstr "Usuario" diff --git a/pos_place/i18n/fr.po b/pos_place/i18n/fr.po new file mode 100644 index 0000000000..a84dccaf8d --- /dev/null +++ b/pos_place/i18n/fr.po @@ -0,0 +1,165 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_place +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-06-23 14:53+0000\n" +"PO-Revision-Date: 2022-06-23 14:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__active +msgid "Active" +msgstr "Actif" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__code +#: model_terms:ir.ui.view,arch_db:pos_place.view_pos_place_form +msgid "Code" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__company_id +msgid "Company" +msgstr "Société" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__id +msgid "ID" +msgstr "" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_account_invoice +msgid "Invoice" +msgstr "Facture" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: pos_place +#: model:res.groups,name:pos_place.group_pos_place_manager +msgid "Manager" +msgstr "Gestionnaire" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__name +#: model_terms:ir.ui.view,arch_db:pos_place.view_pos_place_form +msgid "Name" +msgstr "Nom" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/js/widget.js:41 +#: model:ir.model.fields,field_description:pos_place.field_account_invoice__place_id +#: model:ir.model.fields,field_description:pos_place.field_pos_order__place_id +#: model:ir.model.fields,field_description:pos_place.field_report_pos_order__place_id +#, python-format +msgid "Place" +msgstr "Emplacement" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/xml/pos_place.xml:28 +#: code:addons/pos_place/static/src/xml/pos_place.xml:41 +#, python-format +msgid "Place:" +msgstr "Emplacements : " + +#. module: pos_place +#: model:ir.actions.act_window,name:pos_place.action_pos_place +#: model:ir.ui.menu,name:pos_place.menu_pos_place +#: model:ir.ui.menu,name:pos_place.menu_pos_place_account +msgid "Places" +msgstr "Emplacements" + +#. module: pos_place +#: model:ir.module.category,name:pos_place.module_category_pos_place +msgid "Point of Sale - Places" +msgstr "Point de vente - Emplacements" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Paramétrage du point de vente" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_order +msgid "Point of Sale Orders" +msgstr "Commandes du point de vente" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_report_pos_order +msgid "Point of Sale Orders Report" +msgstr "Rapport sur les commandes au point de vente" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_config__group_pos_place_user_id +msgid "Point of Sale Place User Group" +msgstr "" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_place +msgid "Point of Sale Places" +msgstr "Emplacement du Point de vente" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/js/gui.js:31 +#, python-format +msgid "Select a Place" +msgstr "Choisir un emplacement" + +#. module: pos_place +#: model:ir.model.fields,help:pos_place.field_pos_config__group_pos_place_user_id +msgid "" +"This field is there to pass the id of the pos place user group to the point " +"of sale client." +msgstr "" +"Ce champ sert à passer l'identifiant du groupe 'utilisateur des " +"emplacements' dans le point de vente." + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_config__use_pos_place +msgid "Use Point of Sale places" +msgstr "Utiliser les emplacements" + +#. module: pos_place +#: model:res.groups,name:pos_place.group_pos_place_user +msgid "User" +msgstr "Utilisateur" diff --git a/pos_place/i18n/it.po b/pos_place/i18n/it.po new file mode 100644 index 0000000000..bc13263c8a --- /dev/null +++ b/pos_place/i18n/it.po @@ -0,0 +1,165 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_place +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-12 12:13+0000\n" +"Last-Translator: Francesco Foresti \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__active +msgid "Active" +msgstr "Attivo" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__code +#: model_terms:ir.ui.view,arch_db:pos_place.view_pos_place_form +msgid "Code" +msgstr "Codice" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__company_id +msgid "Company" +msgstr "Azienda" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__id +msgid "ID" +msgstr "ID" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_account_invoice +msgid "Invoice" +msgstr "Fattura" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: pos_place +#: model:res.groups,name:pos_place.group_pos_place_manager +msgid "Manager" +msgstr "Responsabile" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__name +#: model_terms:ir.ui.view,arch_db:pos_place.view_pos_place_form +msgid "Name" +msgstr "Nome" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/js/widget.js:41 +#: model:ir.model.fields,field_description:pos_place.field_account_invoice__place_id +#: model:ir.model.fields,field_description:pos_place.field_pos_order__place_id +#: model:ir.model.fields,field_description:pos_place.field_report_pos_order__place_id +#, python-format +msgid "Place" +msgstr "Luogo" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/xml/pos_place.xml:28 +#: code:addons/pos_place/static/src/xml/pos_place.xml:41 +#, python-format +msgid "Place:" +msgstr "Luogo:" + +#. module: pos_place +#: model:ir.actions.act_window,name:pos_place.action_pos_place +#: model:ir.ui.menu,name:pos_place.menu_pos_place +#: model:ir.ui.menu,name:pos_place.menu_pos_place_account +msgid "Places" +msgstr "Luoghi" + +#. module: pos_place +#: model:ir.module.category,name:pos_place.module_category_pos_place +msgid "Point of Sale - Places" +msgstr "Punto vendita - Luoghi" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configurazione punto vendita" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_order +msgid "Point of Sale Orders" +msgstr "Ordini punto vendita" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_report_pos_order +msgid "Point of Sale Orders Report" +msgstr "Resoconto ordini punto vendita" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_config__group_pos_place_user_id +msgid "Point of Sale Place User Group" +msgstr "Gruppo utente luogo punto vendita" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_place +msgid "Point of Sale Places" +msgstr "Luoghi punto vendita" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/js/gui.js:31 +#, python-format +msgid "Select a Place" +msgstr "Selezionare un luogo" + +#. module: pos_place +#: model:ir.model.fields,help:pos_place.field_pos_config__group_pos_place_user_id +msgid "" +"This field is there to pass the id of the pos place user group to the point " +"of sale client." +msgstr "" +"Questo campo serve a trasferire l'ID del gruppo utente luogo POS al client " +"punto vendita." + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_config__use_pos_place +msgid "Use Point of Sale places" +msgstr "Utilizzo luoghi punto vendita" + +#. module: pos_place +#: model:res.groups,name:pos_place.group_pos_place_user +msgid "User" +msgstr "Utente" diff --git a/pos_place/i18n/pos_place.pot b/pos_place/i18n/pos_place.pot new file mode 100644 index 0000000000..25122ce06d --- /dev/null +++ b/pos_place/i18n/pos_place.pot @@ -0,0 +1,159 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_place +# +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_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__active +msgid "Active" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__code +#: model_terms:ir.ui.view,arch_db:pos_place.view_pos_place_form +msgid "Code" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__company_id +msgid "Company" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__create_uid +msgid "Created by" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__create_date +msgid "Created on" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__display_name +msgid "Display Name" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__id +msgid "ID" +msgstr "" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place____last_update +msgid "Last Modified on" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__write_date +msgid "Last Updated on" +msgstr "" + +#. module: pos_place +#: model:res.groups,name:pos_place.group_pos_place_manager +msgid "Manager" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_place__name +#: model_terms:ir.ui.view,arch_db:pos_place.view_pos_place_form +msgid "Name" +msgstr "" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/js/widget.js:41 +#: model:ir.model.fields,field_description:pos_place.field_account_invoice__place_id +#: model:ir.model.fields,field_description:pos_place.field_pos_order__place_id +#: model:ir.model.fields,field_description:pos_place.field_report_pos_order__place_id +#, python-format +msgid "Place" +msgstr "" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/xml/pos_place.xml:28 +#: code:addons/pos_place/static/src/xml/pos_place.xml:41 +#, python-format +msgid "Place:" +msgstr "" + +#. module: pos_place +#: model:ir.actions.act_window,name:pos_place.action_pos_place +#: model:ir.ui.menu,name:pos_place.menu_pos_place +#: model:ir.ui.menu,name:pos_place.menu_pos_place_account +msgid "Places" +msgstr "" + +#. module: pos_place +#: model:ir.module.category,name:pos_place.module_category_pos_place +msgid "Point of Sale - Places" +msgstr "" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_order +msgid "Point of Sale Orders" +msgstr "" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_report_pos_order +msgid "Point of Sale Orders Report" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_config__group_pos_place_user_id +msgid "Point of Sale Place User Group" +msgstr "" + +#. module: pos_place +#: model:ir.model,name:pos_place.model_pos_place +msgid "Point of Sale Places" +msgstr "" + +#. module: pos_place +#. openerp-web +#: code:addons/pos_place/static/src/js/gui.js:31 +#, python-format +msgid "Select a Place" +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,help:pos_place.field_pos_config__group_pos_place_user_id +msgid "This field is there to pass the id of the pos place user group to the point of sale client." +msgstr "" + +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_config__use_pos_place +msgid "Use Point of Sale places" +msgstr "" + +#. module: pos_place +#: model:res.groups,name:pos_place.group_pos_place_user +msgid "User" +msgstr "" + diff --git a/pos_place/models/__init__.py b/pos_place/models/__init__.py new file mode 100644 index 0000000000..7be8e96c62 --- /dev/null +++ b/pos_place/models/__init__.py @@ -0,0 +1,5 @@ +from . import account_move +from . import pos_place +from . import pos_config +from . import pos_order +from . import pos_session diff --git a/pos_place/models/account_move.py b/pos_place/models/account_move.py new file mode 100644 index 0000000000..fe757b9196 --- /dev/null +++ b/pos_place/models/account_move.py @@ -0,0 +1,10 @@ +# Copyright (C) 2022 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import fields, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + place_id = fields.Many2one(string="Place", comodel_name="pos.place") diff --git a/pos_place/models/pos_config.py b/pos_place/models/pos_config.py new file mode 100644 index 0000000000..a5f4ba443c --- /dev/null +++ b/pos_place/models/pos_config.py @@ -0,0 +1,22 @@ +# Copyright (C) 2018 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import fields, models + + +class PosConfig(models.Model): + _inherit = "pos.config" + + group_pos_place_user_id = fields.Many2one( + "res.groups", + string="Point of Sale Place User Group", + compute="_compute_group_pos_place_user_id", + help="This field is there to pass the id of the pos place user" + " group to the point of sale client.", + ) + + def _compute_group_pos_place_user_id(self): + for config in self: + config.group_pos_place_user_id = self.env.ref( + "pos_place.group_pos_place_user" + ) diff --git a/pos_place/models/pos_order.py b/pos_place/models/pos_order.py new file mode 100644 index 0000000000..7f6dbf0f67 --- /dev/null +++ b/pos_place/models/pos_order.py @@ -0,0 +1,21 @@ +# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + + +class PosOrder(models.Model): + _inherit = "pos.order" + + place_id = fields.Many2one(string="Place", comodel_name="pos.place") + + @api.model + def _order_fields(self, ui_order): + res = super()._order_fields(ui_order) + res["place_id"] = ui_order.get("place_id", False) + return res + + def _prepare_invoice(self): + res = super()._prepare_invoice() + res["place_id"] = self.place_id.id + return res diff --git a/pos_place/models/pos_place.py b/pos_place/models/pos_place.py new file mode 100644 index 0000000000..4a51a489f0 --- /dev/null +++ b/pos_place/models/pos_place.py @@ -0,0 +1,25 @@ +# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class PosPlace(models.Model): + _name = "pos.place" + _description = "Point of Sale Places" + + code = fields.Char(required=True, size=6) + + name = fields.Char(required=True) + + active = fields.Boolean(default=True) + + company_id = fields.Many2one( + string="Company", + comodel_name="res.company", + default=lambda x: x._default_company_id(), + ) + + def _default_company_id(self): + return self.env.company diff --git a/pos_place/models/pos_session.py b/pos_place/models/pos_session.py new file mode 100644 index 0000000000..e506c2c165 --- /dev/null +++ b/pos_place/models/pos_session.py @@ -0,0 +1,24 @@ +# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class PosSession(models.Model): + _inherit = "pos.session" + + def _pos_ui_models_to_load(self): + result = super()._pos_ui_models_to_load() + if self.env.user.has_group("pos_place.group_pos_place_user"): + result.append("pos.place") + return result + + def _loader_params_pos_place(self): + return { + "search_params": { + "fields": ["code", "name"], + }, + } + + def _get_pos_ui_pos_place(self, params): + return self.env["pos.place"].search_read(**params["search_params"]) diff --git a/pos_place/readme/CONFIGURE.rst b/pos_place/readme/CONFIGURE.rst new file mode 100644 index 0000000000..720fbaccbe --- /dev/null +++ b/pos_place/readme/CONFIGURE.rst @@ -0,0 +1,9 @@ +To configure this module, you need to: + +* Add your users to the new group 'Point of Sale - Places' (User or Manager) + +* Go to Point of Sale / Configuration / Places + +* Create your places + +.. figure:: ../static/description/pos_place_tree.png diff --git a/pos_place/readme/CONTRIBUTORS.rst b/pos_place/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..9f76a75bc1 --- /dev/null +++ b/pos_place/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Sylvain LE GAL diff --git a/pos_place/readme/DESCRIPTION.rst b/pos_place/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..5cc0c16743 --- /dev/null +++ b/pos_place/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +This module extends the functionality of point of sale to support saling +in the street using the point of sale and to allow you to mention on the +pos order, the place where the seller is for the time being. + +For that purpose, it introduce a new model ``pos.place``. diff --git a/pos_place/readme/USAGE.rst b/pos_place/readme/USAGE.rst new file mode 100644 index 0000000000..a2979330b2 --- /dev/null +++ b/pos_place/readme/USAGE.rst @@ -0,0 +1,16 @@ +To use this module, you need to + +* open the point of sale + +* Click on 'Place' Button and select the place where you are + +.. figure:: ../static/description/pos_front_end_ui.png + +* All the next Pos Order will be related to this place. + +.. figure:: ../static/description/pos_order_tree.png + + +* You can then, make statistic over best places + +.. figure:: ../static/description/report_pos_order_graph.png diff --git a/pos_place/report/__init__.py b/pos_place/report/__init__.py new file mode 100644 index 0000000000..a22a048147 --- /dev/null +++ b/pos_place/report/__init__.py @@ -0,0 +1 @@ +from . import report_pos_order diff --git a/pos_place/report/report_pos_order.py b/pos_place/report/report_pos_order.py new file mode 100644 index 0000000000..ccf564428c --- /dev/null +++ b/pos_place/report/report_pos_order.py @@ -0,0 +1,15 @@ +# Copyright (C) 2019 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import fields, models + + +class PosOrderReport(models.Model): + _inherit = "report.pos.order" + + place_id = fields.Many2one(comodel_name="pos.place", string="Place", readonly=True) + + def _select(self): + res = super()._select() + res += ", s.place_id as place_id" + return res diff --git a/pos_place/security/ir.model.access.csv b/pos_place/security/ir.model.access.csv new file mode 100644 index 0000000000..90934f50ca --- /dev/null +++ b/pos_place/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_pos_place_user,PoS Places User,model_pos_place,point_of_sale.group_pos_user,1,,, +access_pos_place_manager,PoS Places Manager,model_pos_place,group_pos_place_manager,1,1,1,1 diff --git a/pos_place/security/ir_module_category.xml b/pos_place/security/ir_module_category.xml new file mode 100644 index 0000000000..2721ff4344 --- /dev/null +++ b/pos_place/security/ir_module_category.xml @@ -0,0 +1,13 @@ + + + + + + Point of Sale - Places + + + diff --git a/pos_place/security/ir_rule.xml b/pos_place/security/ir_rule.xml new file mode 100644 index 0000000000..c497b264bb --- /dev/null +++ b/pos_place/security/ir_rule.xml @@ -0,0 +1,16 @@ + + + + + + Point of Sale Places + + + [('company_id', 'in', company_ids + [False])] + + + diff --git a/pos_place/security/res_groups.xml b/pos_place/security/res_groups.xml new file mode 100644 index 0000000000..6ce2c8ad78 --- /dev/null +++ b/pos_place/security/res_groups.xml @@ -0,0 +1,20 @@ + + + + + + User + + + + + Manager + + + + + diff --git a/pos_place/static/description/icon.png b/pos_place/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_place/static/description/icon.png differ diff --git a/pos_place/static/description/index.html b/pos_place/static/description/index.html new file mode 100644 index 0000000000..0307e5e196 --- /dev/null +++ b/pos_place/static/description/index.html @@ -0,0 +1,465 @@ + + + + + +Point of Sale - Places + + + +
+

Point of Sale - Places

+ + +

Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

+

This module extends the functionality of point of sale to support saling +in the street using the point of sale and to allow you to mention on the +pos order, the place where the seller is for the time being.

+

For that purpose, it introduce a new model pos.place.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  • Add your users to the new group ‘Point of Sale - Places’ (User or Manager)
  • +
  • Go to Point of Sale / Configuration / Places
  • +
  • Create your places
  • +
+
+https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/pos_place_tree.png +
+
+
+

Usage

+

To use this module, you need to

+
    +
  • open the point of sale
  • +
  • Click on ‘Place’ Button and select the place where you are
  • +
+
+https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/pos_front_end_ui.png +
+
    +
  • All the next Pos Order will be related to this place.
  • +
+
+https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/pos_order_tree.png +
+
    +
  • You can then, make statistic over best places
  • +
+
+https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/report_pos_order_graph.png +
+
+
+

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

+
    +
  • GRAP
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

legalsylvain

+

This module is part of the OCA/pos project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/pos_place/static/description/pos_front_end_ui.png b/pos_place/static/description/pos_front_end_ui.png new file mode 100644 index 0000000000..46b66ed74c Binary files /dev/null and b/pos_place/static/description/pos_front_end_ui.png differ diff --git a/pos_place/static/description/pos_order_tree.png b/pos_place/static/description/pos_order_tree.png new file mode 100644 index 0000000000..ad1e617490 Binary files /dev/null and b/pos_place/static/description/pos_order_tree.png differ diff --git a/pos_place/static/description/pos_place_tree.png b/pos_place/static/description/pos_place_tree.png new file mode 100644 index 0000000000..9819691647 Binary files /dev/null and b/pos_place/static/description/pos_place_tree.png differ diff --git a/pos_place/static/description/report_pos_order_graph.png b/pos_place/static/description/report_pos_order_graph.png new file mode 100644 index 0000000000..3b450a5309 Binary files /dev/null and b/pos_place/static/description/report_pos_order_graph.png differ diff --git a/pos_place/static/src/js/chrome.js b/pos_place/static/src/js/chrome.js new file mode 100644 index 0000000000..7ca4d79dea --- /dev/null +++ b/pos_place/static/src/js/chrome.js @@ -0,0 +1,23 @@ +/** +Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +@author: Sylvain LE GAL (https://twitter.com/legalsylvain) +License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +**/ + +odoo.define("pos_place.chrome", function (require) { + "use strict"; + + var chrome = require("point_of_sale.chrome"); + var pos_place_widget = require("pos_place.widgets"); + + chrome.Chrome.include({ + init: function () { + this.widgets.push({ + name: "place_name", + widget: pos_place_widget.PlaceNameWidget, + replace: ".placeholder-PlaceNameWidget", + }); + return this._super(arguments[0], {}); + }, + }); +}); diff --git a/pos_place/static/src/js/gui.js b/pos_place/static/src/js/gui.js new file mode 100644 index 0000000000..7e3be5383b --- /dev/null +++ b/pos_place/static/src/js/gui.js @@ -0,0 +1,51 @@ +/** +Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +@author: Sylvain LE GAL (https://twitter.com/legalsylvain) +License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +**/ + +odoo.define("pos_place.gui", function (require) { + "use strict"; + + var gui = require("point_of_sale.gui"); + var core = require("web.core"); + var _t = core._t; + + gui.Gui.include({ + select_place: function () { + var def = new $.Deferred(); + var current_place = this.pos.get_place(); + + var list = []; + for (var i = 0; i < this.pos.places.length; i++) { + var item = this.pos.places[i]; + list.push({ + label: item.code + " - " + item.name, + item: item, + }); + } + + this.show_popup("selection", { + title: _t("Select a Place"), + list: list, + confirm: function (place) { + def.resolve(place); + }, + cancel: function () { + def.resolve(null); + }, + is_selected: function (place) { + if (current_place) { + return place.id === current_place.id; + } + + return false; + }, + }); + + return def.then(function (place) { + return place; + }); + }, + }); +}); diff --git a/pos_place/static/src/js/models.esm.js b/pos_place/static/src/js/models.esm.js new file mode 100644 index 0000000000..0be73e539d --- /dev/null +++ b/pos_place/static/src/js/models.esm.js @@ -0,0 +1,141 @@ +/** @odoo-module **/ + +import {Order, PosGlobalState} from "point_of_sale.models"; +import Registries from "point_of_sale.Registries"; + +const OverloadPosGlobalState = (PosGlobalState) => + class extends PosGlobalState { + async _processData(loadedData) { + await super._processData(...arguments); + if (this.config.module_pos_hr) { + this.employees = loadedData["hr.employee"]; + this.employee_by_id = loadedData.employee_by_id; + this.reset_cashier(); + } + } + async after_load_server_data() { + await super.after_load_server_data(...arguments); + if (this.config.module_pos_hr) { + this.hasLoggedIn = !this.config.module_pos_hr; + } + } + reset_cashier() { + this.cashier = { + name: null, + id: null, + barcode: null, + user_id: null, + pin: null, + role: null, + }; + } + set_cashier(employee) { + this.cashier = employee; + const selectedOrder = this.get_order(); + if (selectedOrder && !selectedOrder.get_orderlines().length) { + // Order without lines can be considered to be un-owned by any employee. + // We set the cashier on that order to the currently set employee. + selectedOrder.cashier = employee; + } + if (!this.cashierHasPriceControlRights() && this.numpadMode === "price") { + this.numpadMode = "quantity"; + } + } + + /** {name: null, id: null, barcode: null, user_id:null, pin:null} + * If pos_hr is activated, return {name: string, id: int, barcode: string, pin: string, user_id: int} + * @returns {null|*} + */ + get_cashier() { + if (this.config.module_pos_hr) { + return this.cashier; + } + return super.get_cashier(); + } + get_cashier_user_id() { + if (this.config.module_pos_hr) { + return this.cashier.user_id ? this.cashier.user_id : null; + } + return super.get_cashier_user_id(); + } + }; +Registries.Model.extend(PosGlobalState, PosHrPosGlobalState); + +export const OverloadOrder = (OriginalOrder) => + class extends OriginalOrder { + get_place() { + return this.current_place; + // || this.db.load("current_place") + } + set_place(place) { + this.current_place = place; + // This.db.save("current_place", place || null); + } + + export_for_printing() { + var result = super.export_for_printing(...arguments); + result.place = this.get_place(); + return res; + } + + export_as_JSON() { + const json = super.export_as_JSON(...arguments); + /* Const place = this.pos.get_place(); + json.place = place ? place.id : false; +*/ + json.place = this.get_place(); + return json; + } + + init_from_JSON(json) { + super.init_from_JSON(...arguments); + this.set_place(json.place); + } + }; + +Registries.Model.extend(Order, OverloadOrder); + +/* Odoo.define("pos_place.models", function (require) { + "use strict"; + + var models = require("point_of_sale.models"); + var _super_order = models.Order.prototype; + + // Load pos.place model + models.load_models({ + model: "pos.place", + loaded: function (self, places) { + self.places = []; + for (var i = 0; i < places.length; i++) { + self.places.push(places[i]); + } + }, + });*/ + +/* // Make place persistent in the session + models.PosModel = models.PosModel.extend({ + get_place: function () { + return this.get("current_place") || this.db.load("current_place"); + }, + set_place: function (place) { + this.set("current_place", place); + this.db.save("current_place", place || null); + }, + }); +*/ +/* models.Order = models.Order.extend({ + export_for_printing: function () { + var result = super.export_for_printing(...arguments); + result.place = this.pos.get_place(); + return res; + }, + + export_as_JSON: function () { + var json = _super_order.export_as_JSON.apply(this, arguments); + var place = this.pos.get_place(); + json.place_id = place ? place.id : false; + return json; + }, + }); +}); +*/ diff --git a/pos_place/static/src/js/widget.js b/pos_place/static/src/js/widget.js new file mode 100644 index 0000000000..c556f10bf3 --- /dev/null +++ b/pos_place/static/src/js/widget.js @@ -0,0 +1,51 @@ +/** +Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +@author: Sylvain LE GAL (https://twitter.com/legalsylvain) +License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +**/ + +odoo.define("pos_place.widgets", function (require) { + "use strict"; + + var PosBaseWidget = require("point_of_sale.BaseWidget"); + var core = require("web.core"); + var _t = core._t; + + var PlaceNameWidget = PosBaseWidget.extend({ + template: "PlaceNameWidget", + renderElement: function () { + var self = this; + this._super(); + + this.$el.click(function () { + self.click_place(); + }); + }, + click_place: function () { + var self = this; + this.gui.select_place({}).then(function (place) { + self.pos.set_place(place); + self.renderElement(); + }); + }, + is_visible: function () { + return ( + this.pos.config.use_pos_place && + this.pos.user.groups_id.indexOf( + this.pos.config.group_pos_place_user_id[0] + ) !== -1 + ); + }, + get_name: function () { + var place = this.pos.get_place(); + if (place) { + return place.code; + } + return _t("Place"); + }, + }); + + return { + PlaceNameWidget: PlaceNameWidget, + }; +}); diff --git a/pos_place/static/src/xml/Chrome.xml b/pos_place/static/src/xml/Chrome.xml new file mode 100644 index 0000000000..186be46887 --- /dev/null +++ b/pos_place/static/src/xml/Chrome.xml @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/pos_place/static/src/xml/ChromeWidgets/PosPlaceName.js b/pos_place/static/src/xml/ChromeWidgets/PosPlaceName.js new file mode 100644 index 0000000000..5475e47893 --- /dev/null +++ b/pos_place/static/src/xml/ChromeWidgets/PosPlaceName.js @@ -0,0 +1,61 @@ +odoo.define("pos_place.PosPlaceName", function (require) { + "use strict"; + + const PosComponent = require("point_of_sale.PosComponent"); + const Registries = require("point_of_sale.Registries"); + + // Previously UsernameWidget + class PosPlaceName extends PosComponent { + /** + * Select a place, the returning value will either be an object or nothing (undefined) + */ + async selectPosPlace() { + if (this.env.pos.config.module_pos_hr) { + const employeesList = this.env.pos.employees + .filter((employee) => employee.id !== this.env.pos.get_cashier().id) + .map((employee) => { + return { + id: employee.id, + item: employee, + label: employee.name, + isSelected: false, + }; + }); + let {confirmed, payload: employee} = await this.showPopup( + "SelectionPopup", + { + title: this.env._t("Change Cashier"), + list: employeesList, + } + ); + + if (!confirmed) { + return; + } + + if (employee && employee.pin) { + employee = await this.askPin(employee); + } + if (employee) { + this.env.pos.set_cashier(employee); + } + return employee; + } + } + + get username() { + const {name} = this.env.pos.get_cashier(); + return name ? name : ""; + } + get avatar() { + const user_id = this.env.pos.get_cashier_user_id(); + const id = user_id ? user_id : -1; + return `/web/image/res.users/${id}/avatar_128`; + } + } + PosPlaceName.template = "PosPlaceName"; + + Registries.Component.add(PosPlaceName); + + return PosPlaceName; +}); diff --git a/pos_place/static/src/xml/ChromeWidgets/PosPlaceName.xml b/pos_place/static/src/xml/ChromeWidgets/PosPlaceName.xml new file mode 100644 index 0000000000..cf9b26cf31 --- /dev/null +++ b/pos_place/static/src/xml/ChromeWidgets/PosPlaceName.xml @@ -0,0 +1,15 @@ + + + + +
+ BOB + +
+
+ +
diff --git a/pos_place/static/src/xml/PosPlaceName.xml b/pos_place/static/src/xml/PosPlaceName.xml new file mode 100644 index 0000000000..2531d23f81 --- /dev/null +++ b/pos_place/static/src/xml/PosPlaceName.xml @@ -0,0 +1,14 @@ + + + + +
+ +
+
+ +
diff --git a/pos_place/static/src/xml/pos_place.xml b/pos_place/static/src/xml/pos_place.xml new file mode 100644 index 0000000000..7789dc2190 --- /dev/null +++ b/pos_place/static/src/xml/pos_place.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ Place:
+
+
+
+
+ + + + + +
+
--------------------------------
+
Place:
+
+
+
+
+ +
diff --git a/pos_place/views/view_account_move.xml b/pos_place/views/view_account_move.xml new file mode 100644 index 0000000000..1cf7164cf6 --- /dev/null +++ b/pos_place/views/view_account_move.xml @@ -0,0 +1,33 @@ + + + + + + account.move + + + + + + + + + + account.move + + + + + + + + + diff --git a/pos_place/views/view_pos_order.xml b/pos_place/views/view_pos_order.xml new file mode 100644 index 0000000000..5e6b6994ce --- /dev/null +++ b/pos_place/views/view_pos_order.xml @@ -0,0 +1,33 @@ + + + + + + pos.order + + + + + + + + + + pos.order + + + + + + + + + diff --git a/pos_place/views/view_pos_place.xml b/pos_place/views/view_pos_place.xml new file mode 100644 index 0000000000..6461f1c36d --- /dev/null +++ b/pos_place/views/view_pos_place.xml @@ -0,0 +1,85 @@ + + + + + + pos.place + + + + + + + + + + + pos.place + +
+ +
+ + + + +
+
+
+
+

+ +

+
+
+

+ +

+
+ + + + + +
+
+
+
+ + + Places + ir.actions.act_window + pos.place + tree,form + + + + + + +
diff --git a/setup/pos_place/odoo/addons/pos_place b/setup/pos_place/odoo/addons/pos_place new file mode 120000 index 0000000000..49c2edf91c --- /dev/null +++ b/setup/pos_place/odoo/addons/pos_place @@ -0,0 +1 @@ +../../../../pos_place \ No newline at end of file diff --git a/setup/pos_place/setup.py b/setup/pos_place/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_place/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)