diff --git a/pos_auto_invoice_default_partner/README.rst b/pos_auto_invoice_default_partner/README.rst new file mode 100644 index 0000000000..5a020629ab --- /dev/null +++ b/pos_auto_invoice_default_partner/README.rst @@ -0,0 +1,78 @@ +=================================================== +Point of Sale Automatically Invoice Default Partner +=================================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:4a70355eb4105192a1a84ca1984abd1b6fc2f7f9e3bc1ddb96a7e1882b7a326f + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_auto_invoice_default_partner + :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_auto_invoice_default_partner + :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| + +Compatibility layer between ``pos_auto_invoice`` and ``pos_default_partner``. + +**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 +~~~~~~~ + +* Coop IT Easy SC + +Contributors +~~~~~~~~~~~~ + +* `Coop IT Easy SC `_: + + * Carmen Bianca Bakker + +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_default_partner/__init__.py b/pos_auto_invoice_default_partner/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_auto_invoice_default_partner/__manifest__.py b/pos_auto_invoice_default_partner/__manifest__.py new file mode 100644 index 0000000000..7952eacc9e --- /dev/null +++ b/pos_auto_invoice_default_partner/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2022 Coop IT Easy SC +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Point of Sale Automatically Invoice Default Partner", + "summary": """ + Compatibility layer between pos_auto_invoice and pos_default_partner.""", + "version": "16.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": [ + "pos_auto_invoice", + "pos_default_partner", + ], + "auto-install": True, + "assets": { + "point_of_sale.assets": [ + "pos_auto_invoice_default_partner/static/src/js/**/*.js", + ] + }, +} diff --git a/pos_auto_invoice_default_partner/i18n/pos_auto_invoice_default_partner.pot b/pos_auto_invoice_default_partner/i18n/pos_auto_invoice_default_partner.pot new file mode 100644 index 0000000000..d2e396f159 --- /dev/null +++ b/pos_auto_invoice_default_partner/i18n/pos_auto_invoice_default_partner.pot @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +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" + diff --git a/pos_auto_invoice_default_partner/readme/CONTRIBUTORS.rst b/pos_auto_invoice_default_partner/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..d64451edcf --- /dev/null +++ b/pos_auto_invoice_default_partner/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Coop IT Easy SC `_: + + * Carmen Bianca Bakker diff --git a/pos_auto_invoice_default_partner/readme/DESCRIPTION.rst b/pos_auto_invoice_default_partner/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..c14daca011 --- /dev/null +++ b/pos_auto_invoice_default_partner/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Compatibility layer between ``pos_auto_invoice`` and ``pos_default_partner``. diff --git a/pos_auto_invoice_default_partner/static/description/index.html b/pos_auto_invoice_default_partner/static/description/index.html new file mode 100644 index 0000000000..9a9810c680 --- /dev/null +++ b/pos_auto_invoice_default_partner/static/description/index.html @@ -0,0 +1,423 @@ + + + + + +Point of Sale Automatically Invoice Default Partner + + + +
+

Point of Sale Automatically Invoice Default Partner

+ + +

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

+

Compatibility layer between pos_auto_invoice and pos_default_partner.

+

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

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

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.

+

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_default_partner/static/src/js/Screens/PaymentScreen/PaymentScreen.js b/pos_auto_invoice_default_partner/static/src/js/Screens/PaymentScreen/PaymentScreen.js new file mode 100644 index 0000000000..d27ce1c5d6 --- /dev/null +++ b/pos_auto_invoice_default_partner/static/src/js/Screens/PaymentScreen/PaymentScreen.js @@ -0,0 +1,28 @@ +odoo.define("pos_auto_invoice_default_partner.PaymentScreen", function (require) { + "use strict"; + + const PaymentScreen = require("point_of_sale.PaymentScreen"); + const Registries = require("point_of_sale.Registries"); + + // eslint-disable-next-line no-shadow + const InvoiceDefaultPartnerPaymentScreen = (PaymentScreen) => + // eslint-disable-next-line no-shadow + class InvoiceDefaultPartnerPaymentScreen extends PaymentScreen { + async validateOrder() { + const partner = this.currentOrder.get_partner(); + const default_partner_id = this.env.pos.config.default_partner_id; + if ( + this.currentOrder.is_to_invoice() && + !partner && + default_partner_id + ) { + this.currentOrder.set_partner( + this.env.pos.db.get_partner_by_id(default_partner_id[0]) + ); + } + return super.validateOrder(...arguments); + } + }; + + Registries.Component.extend(PaymentScreen, InvoiceDefaultPartnerPaymentScreen); +}); diff --git a/setup/pos_auto_invoice_default_partner/odoo/addons/pos_auto_invoice_default_partner b/setup/pos_auto_invoice_default_partner/odoo/addons/pos_auto_invoice_default_partner new file mode 120000 index 0000000000..48461a8d64 --- /dev/null +++ b/setup/pos_auto_invoice_default_partner/odoo/addons/pos_auto_invoice_default_partner @@ -0,0 +1 @@ +../../../../pos_auto_invoice_default_partner \ No newline at end of file diff --git a/setup/pos_auto_invoice_default_partner/setup.py b/setup/pos_auto_invoice_default_partner/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_auto_invoice_default_partner/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)