From 1df6c58868f5e58dae5f11222478c4663d4bba1a Mon Sep 17 00:00:00 2001 From: Carmen Bianca Bakker Date: Wed, 11 May 2022 16:57:09 +0200 Subject: [PATCH 01/11] [ADD] pos_auto_invoice_default_partner Signed-off-by: Carmen Bianca Bakker --- pos_auto_invoice_default_partner/__init__.py | 0 .../__manifest__.py | 25 +++++++++++++++++++ .../readme/CONTRIBUTORS.rst | 3 +++ .../readme/DESCRIPTION.rst | 0 .../static/src/js/screens.js | 17 +++++++++++++ .../views/assets.xml | 15 +++++++++++ .../addons/pos_auto_invoice_default_partner | 1 + .../pos_auto_invoice_default_partner/setup.py | 6 +++++ 8 files changed, 67 insertions(+) create mode 100644 pos_auto_invoice_default_partner/__init__.py create mode 100644 pos_auto_invoice_default_partner/__manifest__.py create mode 100644 pos_auto_invoice_default_partner/readme/CONTRIBUTORS.rst create mode 100644 pos_auto_invoice_default_partner/readme/DESCRIPTION.rst create mode 100644 pos_auto_invoice_default_partner/static/src/js/screens.js create mode 100644 pos_auto_invoice_default_partner/views/assets.xml create mode 120000 setup/pos_auto_invoice_default_partner/odoo/addons/pos_auto_invoice_default_partner create mode 100644 setup/pos_auto_invoice_default_partner/setup.py 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..24812d3016 --- /dev/null +++ b/pos_auto_invoice_default_partner/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2022 Coop IT Easy SCRLfs +# 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": "12.0.1.0.0", + "category": "Point of Sale", + "website": "https://coopiteasy.be", + "author": "Coop IT Easy SCRLfs", + "license": "AGPL-3", + "application": False, + "depends": [ + "pos_auto_invoice", + "pos_default_partner", + ], + "auto-install": True, + "excludes": [], + "data": [ + "views/assets.xml", + ], + "demo": [], + "qweb": [], +} 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..9f39efbc52 --- /dev/null +++ b/pos_auto_invoice_default_partner/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Coop IT Easy SCRLfs `_: + + * 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..e69de29bb2 diff --git a/pos_auto_invoice_default_partner/static/src/js/screens.js b/pos_auto_invoice_default_partner/static/src/js/screens.js new file mode 100644 index 0000000000..b2c6f35d26 --- /dev/null +++ b/pos_auto_invoice_default_partner/static/src/js/screens.js @@ -0,0 +1,17 @@ +odoo.define("pos_auto_invoice_default_partner.screens", function (require) { + "use strict"; + var core = require("web.core"); + var screens = require("point_of_sale.screens"); + + screens.PaymentScreenWidget.include({ + finalize_validation: function () { + var order = this.pos.get_order(); + var client = order.get_client(); + var partner_id = this.pos.config.default_partner_id; + if (order.is_to_invoice() && !client && partner_id) { + order.set_client(this.pos.db.get_partner_by_id(partner_id[0])); + } + this._super(); + }, + }); +}); diff --git a/pos_auto_invoice_default_partner/views/assets.xml b/pos_auto_invoice_default_partner/views/assets.xml new file mode 100644 index 0000000000..d9a9943e06 --- /dev/null +++ b/pos_auto_invoice_default_partner/views/assets.xml @@ -0,0 +1,15 @@ + + + +