diff --git a/pos_order_remove_line/README.rst b/pos_order_remove_line/README.rst new file mode 100644 index 0000000000..e3482ebd77 --- /dev/null +++ b/pos_order_remove_line/README.rst @@ -0,0 +1,83 @@ +===================== +POS Order Remove Line +===================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-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_order_remove_line + :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_order_remove_line + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/184/16.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +The module adds the possibility to delete a POS Order Line from the POS interface. + +**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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Roberto Fichera + +Contributors +~~~~~~~~~~~~ + +* Roberto Fichera +* Iván Todorovich +* Foram Shah + +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-robyf70| image:: https://github.com/robyf70.png?size=40px + :target: https://github.com/robyf70 + :alt: robyf70 + +Current `maintainer `__: + +|maintainer-robyf70| + +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_order_remove_line/__init__.py b/pos_order_remove_line/__init__.py new file mode 100644 index 0000000000..bd06eb177f --- /dev/null +++ b/pos_order_remove_line/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2023 LevelPrime +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) diff --git a/pos_order_remove_line/__manifest__.py b/pos_order_remove_line/__manifest__.py new file mode 100644 index 0000000000..4203aa0157 --- /dev/null +++ b/pos_order_remove_line/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2023 LevelPrime +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +{ + "name": "POS Order Remove Line", + "summary": "Add button to remove POS order line.", + "author": "Roberto Fichera, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "category": "Point of Sale", + "maintainers": ["robyf70"], + "version": "16.0.1.0.0", + "license": "LGPL-3", + "depends": ["point_of_sale"], + "assets": { + "point_of_sale.assets": [ + "pos_order_remove_line/static/src/js/*.js", + "pos_order_remove_line/static/src/css/*.scss", + "pos_order_remove_line/static/src/xml/*xml", + ] + }, +} diff --git a/pos_order_remove_line/i18n/pos_order_remove_line.pot b/pos_order_remove_line/i18n/pos_order_remove_line.pot new file mode 100644 index 0000000000..4d8b20f912 --- /dev/null +++ b/pos_order_remove_line/i18n/pos_order_remove_line.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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_order_remove_line/readme/CONTRIBUTORS.rst b/pos_order_remove_line/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..5db6b87b78 --- /dev/null +++ b/pos_order_remove_line/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Roberto Fichera +* Iván Todorovich +* Foram Shah +* Juan Bonilla diff --git a/pos_order_remove_line/readme/DESCRIPTION.rst b/pos_order_remove_line/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..450df8dff8 --- /dev/null +++ b/pos_order_remove_line/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +The module adds the possibility to delete a POS Order Line from the POS interface. diff --git a/pos_order_remove_line/static/description/icon.png b/pos_order_remove_line/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_order_remove_line/static/description/icon.png differ diff --git a/pos_order_remove_line/static/description/index.html b/pos_order_remove_line/static/description/index.html new file mode 100644 index 0000000000..42841a871c --- /dev/null +++ b/pos_order_remove_line/static/description/index.html @@ -0,0 +1,423 @@ + + + + + + +POS Order Remove Line + + + +
+

POS Order Remove Line

+ + +

Beta License: LGPL-3 OCA/pos Translate me on Weblate Try me on Runbot

+

The module adds the possibility to delete a POS Order Line from the POS interface.

+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Roberto Fichera
  • +
+
+
+

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:

+

robyf70

+

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_order_remove_line/static/src/css/orderline.scss b/pos_order_remove_line/static/src/css/orderline.scss new file mode 100644 index 0000000000..3c441b46ae --- /dev/null +++ b/pos_order_remove_line/static/src/css/orderline.scss @@ -0,0 +1,11 @@ +/* + * Copyright 2023 LevelPrime + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + */ + +.remove-line-button { + float: right; + padding: 0 5px 0 10px; + cursor: pointer; + margin-left: 6px; +} diff --git a/pos_order_remove_line/static/src/js/orderline.esm.js b/pos_order_remove_line/static/src/js/orderline.esm.js new file mode 100644 index 0000000000..1897e53b53 --- /dev/null +++ b/pos_order_remove_line/static/src/js/orderline.esm.js @@ -0,0 +1,30 @@ +/** @odoo-module **/ +/* + * Copyright 2023 LevelPrime + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + */ + +import Orderline from "point_of_sale.Orderline"; +import Registries from "point_of_sale.Registries"; + +const PosOrderline = (Orderline) => + class extends Orderline { + async removeLine(ev) { + const order = this.env.pos.get_order(); + if (order) { + ev.stopPropagation(); + ev.preventDefault(); + this.selectLine(); + order.remove_orderline(order.get_selected_orderline()); + this.checkRewardLines(order); + } + } + // Dependecy-less suport to pos_loyalty + checkRewardLines(order) { + const anyRewardLine = order.orderlines.some((line) => line.is_reward_line); + if (anyRewardLine) { + order._updateRewards(); + } + } + }; +Registries.Component.extend(Orderline, PosOrderline); diff --git a/pos_order_remove_line/static/src/xml/orderline.xml b/pos_order_remove_line/static/src/xml/orderline.xml new file mode 100644 index 0000000000..b06f5cc591 --- /dev/null +++ b/pos_order_remove_line/static/src/xml/orderline.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/setup/pos_order_remove_line/odoo/addons/pos_order_remove_line b/setup/pos_order_remove_line/odoo/addons/pos_order_remove_line new file mode 120000 index 0000000000..a6868e7178 --- /dev/null +++ b/setup/pos_order_remove_line/odoo/addons/pos_order_remove_line @@ -0,0 +1 @@ +../../../../pos_order_remove_line \ No newline at end of file diff --git a/setup/pos_order_remove_line/setup.py b/setup/pos_order_remove_line/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_order_remove_line/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)