diff --git a/pos_category_complete_name/README.rst b/pos_category_complete_name/README.rst new file mode 100644 index 0000000000..5037644c94 --- /dev/null +++ b/pos_category_complete_name/README.rst @@ -0,0 +1,89 @@ +============================ +PoS Category - Complete Name +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:4e3aea97044e0d2e77b065fef7d6eb97bcf026ebb7a576a63b1898c5613db888 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_category_complete_name + :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_category_complete_name + :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 functionnality of the Odoo Point of Sale to +allow the cashier to change the payments of a PoS order. + +This feature is usefull when the user realized that he did a mistake, +just after he marked the order as paid, or during the close of the session, +Only if entries has not been generated. + +**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 +~~~~~~~ + +* 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_category_complete_name/__init__.py b/pos_category_complete_name/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_category_complete_name/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_category_complete_name/__manifest__.py b/pos_category_complete_name/__manifest__.py new file mode 100644 index 0000000000..7211d9285d --- /dev/null +++ b/pos_category_complete_name/__manifest__.py @@ -0,0 +1,15 @@ +# 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). +{ + "name": "PoS Category - Complete Name", + "version": "16.0.1.0.0", + "summary": "Adds the complete name field on the pos category field.", + "category": "Point Of Sale", + "author": "GRAP, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "license": "AGPL-3", + "depends": ["point_of_sale"], + "maintainers": ["legalsylvain"], + "installable": True, +} diff --git a/pos_category_complete_name/i18n/fr.po b/pos_category_complete_name/i18n/fr.po new file mode 100644 index 0000000000..b6ea821e35 --- /dev/null +++ b/pos_category_complete_name/i18n/fr.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_category_complete_name +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-22 15:38+0000\n" +"PO-Revision-Date: 2024-11-22 15:38+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: pos_category_complete_name +#: model:ir.model.fields,field_description:pos_category_complete_name.field_pos_category__complete_name +msgid "Complete Name" +msgstr "Nom complet" + +#. module: pos_category_complete_name +#: model:ir.model.fields,field_description:pos_category_complete_name.field_pos_category__parent_path +msgid "Parent Path" +msgstr "Chemin parent" + +#. module: pos_category_complete_name +#: model:ir.model,name:pos_category_complete_name.model_pos_category +msgid "Point of Sale Category" +msgstr "Catégorie du point de vente" diff --git a/pos_category_complete_name/models/__init__.py b/pos_category_complete_name/models/__init__.py new file mode 100644 index 0000000000..9a1a22a5e7 --- /dev/null +++ b/pos_category_complete_name/models/__init__.py @@ -0,0 +1 @@ +from . import pos_category diff --git a/pos_category_complete_name/models/pos_category.py b/pos_category_complete_name/models/pos_category.py new file mode 100644 index 0000000000..a866ad52c5 --- /dev/null +++ b/pos_category_complete_name/models/pos_category.py @@ -0,0 +1,38 @@ +# 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 api, fields, models + +from odoo.addons.point_of_sale.models.pos_category import ( + PosCategory as OriginalPosCategory, +) + + +class PosCategory(models.Model): + _inherit = "pos.category" + _parent_name = "parent_id" + _parent_store = True + _rec_name = "complete_name" + + complete_name = fields.Char( + compute="_compute_complete_name", recursive=True, store=True + ) + + parent_path = fields.Char(index=True, unaccent=False) + + @api.depends("name", "parent_id.complete_name") + def _compute_complete_name(self): + for category in self: + if category.parent_id: + category.complete_name = "%s / %s" % ( + category.parent_id.complete_name, + category.name, + ) + else: + category.complete_name = category.name + + +# Disable the definition of pos.category name_get function +# and fallback in the default function. +OriginalPosCategory.name_get = models.BaseModel.name_get diff --git a/pos_category_complete_name/readme/CONTRIBUTORS.rst b/pos_category_complete_name/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..9f76a75bc1 --- /dev/null +++ b/pos_category_complete_name/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Sylvain LE GAL diff --git a/pos_category_complete_name/readme/DESCRIPTION.rst b/pos_category_complete_name/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..f725ca719c --- /dev/null +++ b/pos_category_complete_name/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +This module extends the functionnality of the Odoo Point of Sale to +allow the cashier to change the payments of a PoS order. + +This feature is usefull when the user realized that he did a mistake, +just after he marked the order as paid, or during the close of the session, +Only if entries has not been generated. diff --git a/pos_category_complete_name/static/description/index.html b/pos_category_complete_name/static/description/index.html new file mode 100644 index 0000000000..a7b42d0b94 --- /dev/null +++ b/pos_category_complete_name/static/description/index.html @@ -0,0 +1,429 @@ + + + + + +PoS Category - Complete Name + + + +
+

PoS Category - Complete Name

+ + +

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

+

This module extends the functionnality of the Odoo Point of Sale to +allow the cashier to change the payments of a PoS order.

+

This feature is usefull when the user realized that he did a mistake, +just after he marked the order as paid, or during the close of the session, +Only if entries has not been generated.

+

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

+
    +
  • 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/setup/pos_category_complete_name/odoo/addons/pos_category_complete_name b/setup/pos_category_complete_name/odoo/addons/pos_category_complete_name new file mode 120000 index 0000000000..ca2b88a3b5 --- /dev/null +++ b/setup/pos_category_complete_name/odoo/addons/pos_category_complete_name @@ -0,0 +1 @@ +../../../../pos_category_complete_name \ No newline at end of file diff --git a/setup/pos_category_complete_name/setup.py b/setup/pos_category_complete_name/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_category_complete_name/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)