Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] pos_category_complete_name new module #1265

Draft
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions pos_category_complete_name/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/pos/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 <https://github.com/OCA/pos/issues/new?body=module:%20pos_category_complete_name%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* GRAP

Contributors
~~~~~~~~~~~~

* Sylvain LE GAL <https://twitter.com/legalsylvain>

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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_category_complete_name>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions pos_category_complete_name/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions pos_category_complete_name/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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,
}
31 changes: 31 additions & 0 deletions pos_category_complete_name/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions pos_category_complete_name/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import pos_category
38 changes: 38 additions & 0 deletions pos_category_complete_name/models/pos_category.py
Original file line number Diff line number Diff line change
@@ -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" % (

Check warning on line 28 in pos_category_complete_name/models/pos_category.py

View check run for this annotation

Codecov / codecov/patch

pos_category_complete_name/models/pos_category.py#L28

Added line #L28 was not covered by tests
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
1 change: 1 addition & 0 deletions pos_category_complete_name/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sylvain LE GAL <https://twitter.com/legalsylvain>
6 changes: 6 additions & 0 deletions pos_category_complete_name/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -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.
Loading
Loading