diff --git a/pos_partner_birthdate/README.rst b/pos_partner_birthdate/README.rst new file mode 100644 index 0000000000..c34d44af97 --- /dev/null +++ b/pos_partner_birthdate/README.rst @@ -0,0 +1,86 @@ +========================================= +Point of Sale - Partner contact birthdate +========================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:864bbe07f2041995bab290c17e15507db95af367cfeb269eee3380e9dcc50d3d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/17.0/pos_partner_birthdate + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_partner_birthdate + :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=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Adds the birthdate field in the POS Customer Screen so that the +information can be directly entered there. + +**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 +------- + +* Emanuel Cino + +Contributors +------------ + +- Emanuel Cino +- Juan Carlos Bonilla Bravo + +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-ecino| image:: https://github.com/ecino.png?size=40px + :target: https://github.com/ecino + :alt: ecino + +Current `maintainer `__: + +|maintainer-ecino| + +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_partner_birthdate/__init__.py b/pos_partner_birthdate/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_partner_birthdate/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_partner_birthdate/__manifest__.py b/pos_partner_birthdate/__manifest__.py new file mode 100644 index 0000000000..b662c3a65d --- /dev/null +++ b/pos_partner_birthdate/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2023 Emanuel Cino +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Point of Sale - Partner contact birthdate", + "summary": "Adds the birthdate in the customer screen of POS", + "version": "17.0.1.0.0", + "development_status": "Beta", + "category": "Point of sale", + "website": "https://github.com/OCA/pos", + "author": "Emanuel Cino, Odoo Community Association (OCA)", + "maintainers": ["ecino"], + "license": "AGPL-3", + "installable": True, + "depends": ["point_of_sale", "partner_contact_birthdate"], + "assets": { + "point_of_sale._assets_pos": [ + "pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml", + "pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js", + ] + }, +} diff --git a/pos_partner_birthdate/i18n/es.po b/pos_partner_birthdate/i18n/es.po new file mode 100644 index 0000000000..743d2e9d5e --- /dev/null +++ b/pos_partner_birthdate/i18n/es.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_partner_birthdate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-09-02 19:38+0000\n" +"Last-Translator: Ivorra78 \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 4.17\n" + +#. module: pos_partner_birthdate +#. odoo-javascript +#: code:addons/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml:0 +#, python-format +msgid "Birthdate" +msgstr "Fecha de Nacimiento" + +#. module: pos_partner_birthdate +#: model:ir.model,name:pos_partner_birthdate.model_pos_session +msgid "Point of Sale Session" +msgstr "SesiĆ³n del Punto de Venta" diff --git a/pos_partner_birthdate/i18n/it.po b/pos_partner_birthdate/i18n/it.po new file mode 100644 index 0000000000..225d37f743 --- /dev/null +++ b/pos_partner_birthdate/i18n/it.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_partner_birthdate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-04-25 21:34+0000\n" +"Last-Translator: mymage \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.14.1\n" + +#. module: pos_partner_birthdate +#. odoo-javascript +#: code:addons/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml:0 +#, python-format +msgid "Birthdate" +msgstr "Compleanno" + +#. module: pos_partner_birthdate +#: model:ir.model,name:pos_partner_birthdate.model_pos_session +msgid "Point of Sale Session" +msgstr "Sessione punto vendita" diff --git a/pos_partner_birthdate/i18n/pos_partner_birthdate.pot b/pos_partner_birthdate/i18n/pos_partner_birthdate.pot new file mode 100644 index 0000000000..63acefe0b8 --- /dev/null +++ b/pos_partner_birthdate/i18n/pos_partner_birthdate.pot @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_partner_birthdate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_partner_birthdate +#. odoo-javascript +#: code:addons/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml:0 +#: code:addons/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml:0 +#, python-format +msgid "Birthdate" +msgstr "" + +#. module: pos_partner_birthdate +#: model:ir.model,name:pos_partner_birthdate.model_pos_session +msgid "Point of Sale Session" +msgstr "" diff --git a/pos_partner_birthdate/models/__init__.py b/pos_partner_birthdate/models/__init__.py new file mode 100644 index 0000000000..f7116e3d45 --- /dev/null +++ b/pos_partner_birthdate/models/__init__.py @@ -0,0 +1 @@ +from . import pos_session diff --git a/pos_partner_birthdate/models/pos_session.py b/pos_partner_birthdate/models/pos_session.py new file mode 100644 index 0000000000..fd3bd69bd0 --- /dev/null +++ b/pos_partner_birthdate/models/pos_session.py @@ -0,0 +1,12 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class POSSession(models.Model): + _inherit = "pos.session" + + def _loader_params_res_partner(self): + res = super()._loader_params_res_partner() + res["search_params"]["fields"].append("birthdate_date") + return res diff --git a/pos_partner_birthdate/pyproject.toml b/pos_partner_birthdate/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_partner_birthdate/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_partner_birthdate/readme/CONTRIBUTORS.md b/pos_partner_birthdate/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..f5ecf765d6 --- /dev/null +++ b/pos_partner_birthdate/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ + - Emanuel Cino \<\> + - Juan Carlos Bonilla Bravo \<\> diff --git a/pos_partner_birthdate/readme/DESCRIPTION.md b/pos_partner_birthdate/readme/DESCRIPTION.md new file mode 100644 index 0000000000..b519eb8199 --- /dev/null +++ b/pos_partner_birthdate/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +Adds the birthdate field in the POS Customer Screen so that the +information can be directly entered there. diff --git a/pos_partner_birthdate/readme/newsfragments/.gitkeep b/pos_partner_birthdate/readme/newsfragments/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_partner_birthdate/static/description/icon.png b/pos_partner_birthdate/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_partner_birthdate/static/description/icon.png differ diff --git a/pos_partner_birthdate/static/description/index.html b/pos_partner_birthdate/static/description/index.html new file mode 100644 index 0000000000..8d4926a32f --- /dev/null +++ b/pos_partner_birthdate/static/description/index.html @@ -0,0 +1,425 @@ + + + + + + +Point of Sale - Partner contact birthdate + + + +
+

Point of Sale - Partner contact birthdate

+ + +

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

+

Adds the birthdate field in the POS Customer Screen so that the +information can be directly entered there.

+

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

+
    +
  • Emanuel Cino
  • +
+
+
+

Contributors

+ +
+
+

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:

+

ecino

+

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_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js b/pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js new file mode 100644 index 0000000000..63ba5bce66 --- /dev/null +++ b/pos_partner_birthdate/static/src/js/ClientDetailsEdit.esm.js @@ -0,0 +1,13 @@ +/** @odoo-module **/ +import {PartnerDetailsEdit} from "@point_of_sale/app/screens/partner_list/partner_editor/partner_editor"; +import {patch} from "@web/core/utils/patch"; + +patch(PartnerDetailsEdit.prototype, { + setup() { + super.setup(...arguments); + this.changes.birthdate_date = this.props.partner.birthdate_date || null; + }, + _today() { + return new Date().toISOString().split("T")[0]; + }, +}); diff --git a/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml b/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml new file mode 100644 index 0000000000..6957cc60e6 --- /dev/null +++ b/pos_partner_birthdate/static/src/xml/ClientDetailsEdit.xml @@ -0,0 +1,25 @@ + + + + + +
+ + +
+
+
+