diff --git a/pos_auto_invoice/README.rst b/pos_auto_invoice/README.rst new file mode 100644 index 0000000000..c980ac99e6 --- /dev/null +++ b/pos_auto_invoice/README.rst @@ -0,0 +1,98 @@ +=================================== +Point of Sale Automatically Invoice +=================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2b6908cde80186b7b4159c0a6080960f88db5f379a2d78b9748fcb03dff8fdd6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.0/pos_auto_invoice + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_auto_invoice + :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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Allow to set point-of-sale orders as to-invoice by default. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +This module adds an “Invoice By Default” option to the Accounting +section of the Point of Sale settings. + +To set orders as to-invoice by default, check the “Invoice By Default” +checkbox. + +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 +------- + +* Coop IT Easy SC + +Contributors +------------ + +- `Coop IT Easy SC `__: + + - Carmen Bianca Bakker + - hugues de keyzer + +- `Trobz `__: + + - Tris Doan + +Other credits +------------- + +The migration of this module from 16.0 to 18.0 was financially supported +by Camptocamp. + +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. + +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_auto_invoice/__init__.py b/pos_auto_invoice/__init__.py new file mode 100644 index 0000000000..3eb78877c5 --- /dev/null +++ b/pos_auto_invoice/__init__.py @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2024 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from . import models diff --git a/pos_auto_invoice/__manifest__.py b/pos_auto_invoice/__manifest__.py new file mode 100644 index 0000000000..b70119d561 --- /dev/null +++ b/pos_auto_invoice/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2022 Coop IT Easy SC +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Point of Sale Automatically Invoice", + "summary": "Allow to set POS orders as to-invoice by default", + "version": "18.0.1.0.0", + "category": "Point of Sale", + "website": "https://github.com/OCA/pos", + "author": "Coop IT Easy SC, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": [ + "point_of_sale", + ], + "data": [ + "views/res_config_settings_view.xml", + ], + "assets": { + "point_of_sale._assets_pos": ["pos_auto_invoice/static/src/**/*"], + }, +} diff --git a/pos_auto_invoice/i18n/it.po b/pos_auto_invoice/i18n/it.po new file mode 100644 index 0000000000..c0ddfcf277 --- /dev/null +++ b/pos_auto_invoice/i18n/it.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_auto_invoice +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-04-10 13:24+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 5.10.4\n" + +#. module: pos_auto_invoice +#: model:ir.model,name:pos_auto_invoice.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni configurazione" + +#. module: pos_auto_invoice +#: model:ir.model.fields,field_description:pos_auto_invoice.field_pos_config__invoice_by_default +#: model:ir.model.fields,field_description:pos_auto_invoice.field_res_config_settings__pos_invoice_by_default +msgid "Invoice By Default" +msgstr "Fattura predefinita" + +#. module: pos_auto_invoice +#: model:ir.model,name:pos_auto_invoice.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configurazione punto vendita" + +#. module: pos_auto_invoice +#: model_terms:ir.ui.view,arch_db:pos_auto_invoice.res_config_settings_view_form +msgid "Set orders as to-invoice by default" +msgstr "Imposta ordini come da fatturare in modo predefinito" diff --git a/pos_auto_invoice/i18n/pos_auto_invoice.pot b/pos_auto_invoice/i18n/pos_auto_invoice.pot new file mode 100644 index 0000000000..cc8f2ddaf5 --- /dev/null +++ b/pos_auto_invoice/i18n/pos_auto_invoice.pot @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_auto_invoice +# +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_auto_invoice +#: model:ir.model,name:pos_auto_invoice.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: pos_auto_invoice +#: model:ir.model.fields,field_description:pos_auto_invoice.field_pos_config__invoice_by_default +#: model:ir.model.fields,field_description:pos_auto_invoice.field_res_config_settings__pos_invoice_by_default +msgid "Invoice By Default" +msgstr "" + +#. module: pos_auto_invoice +#: model:ir.model,name:pos_auto_invoice.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_auto_invoice +#: model_terms:ir.ui.view,arch_db:pos_auto_invoice.res_config_settings_view_form +msgid "Set orders as to-invoice by default" +msgstr "" diff --git a/pos_auto_invoice/models/__init__.py b/pos_auto_invoice/models/__init__.py new file mode 100644 index 0000000000..7133ebc21e --- /dev/null +++ b/pos_auto_invoice/models/__init__.py @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2024 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from . import pos_config +from . import res_config_settings diff --git a/pos_auto_invoice/models/pos_config.py b/pos_auto_invoice/models/pos_config.py new file mode 100644 index 0000000000..b69db852eb --- /dev/null +++ b/pos_auto_invoice/models/pos_config.py @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: 2024 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from odoo import fields, models + + +class PosConfig(models.Model): + _inherit = "pos.config" + + invoice_by_default = fields.Boolean() diff --git a/pos_auto_invoice/models/res_config_settings.py b/pos_auto_invoice/models/res_config_settings.py new file mode 100644 index 0000000000..f0f8e611f6 --- /dev/null +++ b/pos_auto_invoice/models/res_config_settings.py @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2024 Coop IT Easy SC +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + pos_invoice_by_default = fields.Boolean( + related="pos_config_id.invoice_by_default", + readonly=False, + ) diff --git a/pos_auto_invoice/pyproject.toml b/pos_auto_invoice/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_auto_invoice/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_auto_invoice/readme/CONFIGURE.md b/pos_auto_invoice/readme/CONFIGURE.md new file mode 100644 index 0000000000..6b2d29a2a0 --- /dev/null +++ b/pos_auto_invoice/readme/CONFIGURE.md @@ -0,0 +1,5 @@ +This module adds an “Invoice By Default” option to the Accounting +section of the Point of Sale settings. + +To set orders as to-invoice by default, check the “Invoice By Default” +checkbox. diff --git a/pos_auto_invoice/readme/CONTRIBUTORS.md b/pos_auto_invoice/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..77a6ad6a7c --- /dev/null +++ b/pos_auto_invoice/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- [Coop IT Easy SC](https://coopiteasy.be): + - Carmen Bianca Bakker + - hugues de keyzer +- [Trobz](https://trobz.com): + - Tris Doan diff --git a/pos_auto_invoice/readme/CREDITS.md b/pos_auto_invoice/readme/CREDITS.md new file mode 100644 index 0000000000..57e03a9fe7 --- /dev/null +++ b/pos_auto_invoice/readme/CREDITS.md @@ -0,0 +1 @@ +The migration of this module from 16.0 to 18.0 was financially supported by Camptocamp. diff --git a/pos_auto_invoice/readme/DESCRIPTION.md b/pos_auto_invoice/readme/DESCRIPTION.md new file mode 100644 index 0000000000..448aad1f2a --- /dev/null +++ b/pos_auto_invoice/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Allow to set point-of-sale orders as to-invoice by default. diff --git a/pos_auto_invoice/static/description/icon.png b/pos_auto_invoice/static/description/icon.png new file mode 100644 index 0000000000..1dcc49c24f Binary files /dev/null and b/pos_auto_invoice/static/description/icon.png differ diff --git a/pos_auto_invoice/static/description/index.html b/pos_auto_invoice/static/description/index.html new file mode 100644 index 0000000000..a975e226b2 --- /dev/null +++ b/pos_auto_invoice/static/description/index.html @@ -0,0 +1,445 @@ + + + + + +Point of Sale Automatically Invoice + + + +
+

Point of Sale Automatically Invoice

+ + +

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

+

Allow to set point-of-sale orders as to-invoice by default.

+

Table of contents

+ +
+

Configuration

+

This module adds an “Invoice By Default” option to the Accounting +section of the Point of Sale settings.

+

To set orders as to-invoice by default, check the “Invoice By Default” +checkbox.

+
+
+

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

+
    +
  • Coop IT Easy SC
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 16.0 to 18.0 was financially supported +by Camptocamp.

+
+
+

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.

+

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_auto_invoice/static/src/js/payment_screen.esm.js b/pos_auto_invoice/static/src/js/payment_screen.esm.js new file mode 100644 index 0000000000..066ae0cd2e --- /dev/null +++ b/pos_auto_invoice/static/src/js/payment_screen.esm.js @@ -0,0 +1,13 @@ +import {PaymentScreen} from "@point_of_sale/app/screens/payment_screen/payment_screen"; +import {patch} from "@web/core/utils/patch"; + +patch(PaymentScreen.prototype, { + onMounted() { + super.onMounted(); + const invoice_by_default = this.pos.config.invoice_by_default; + if (invoice_by_default) { + const order = this.pos.get_order(); + order.set_to_invoice(invoice_by_default); + } + }, +}); diff --git a/pos_auto_invoice/views/res_config_settings_view.xml b/pos_auto_invoice/views/res_config_settings_view.xml new file mode 100644 index 0000000000..b8059c4575 --- /dev/null +++ b/pos_auto_invoice/views/res_config_settings_view.xml @@ -0,0 +1,23 @@ + + + + + res.config.settings.view.form + res.config.settings + + + + + + + + + +