From 7c5b75f6269957c126caa1cf5575fc49062875c3 Mon Sep 17 00:00:00 2001 From: VPA Date: Fri, 7 Feb 2025 12:21:42 +0100 Subject: [PATCH] Corrected the property of the force invoiced field when both sale_force_invoiced and sale_order_invoice_amount are installed --- sale_force_invoice_amount/README.rst | 78 ++++ sale_force_invoice_amount/__init__.py | 1 + sale_force_invoice_amount/__manifest__.py | 13 + sale_force_invoice_amount/models/__init__.py | 1 + .../models/sale_order.py | 17 + .../readme/CONTRIBUTORS.md | 1 + .../readme/DESCRIPTION.md | 1 + .../static/description/index.html | 426 ++++++++++++++++++ .../odoo/addons/sale_force_invoice_amount | 1 + setup/sale_force_invoice_amount/setup.py | 6 + 10 files changed, 545 insertions(+) create mode 100644 sale_force_invoice_amount/README.rst create mode 100644 sale_force_invoice_amount/__init__.py create mode 100644 sale_force_invoice_amount/__manifest__.py create mode 100644 sale_force_invoice_amount/models/__init__.py create mode 100644 sale_force_invoice_amount/models/sale_order.py create mode 100644 sale_force_invoice_amount/readme/CONTRIBUTORS.md create mode 100644 sale_force_invoice_amount/readme/DESCRIPTION.md create mode 100644 sale_force_invoice_amount/static/description/index.html create mode 120000 setup/sale_force_invoice_amount/odoo/addons/sale_force_invoice_amount create mode 100644 setup/sale_force_invoice_amount/setup.py diff --git a/sale_force_invoice_amount/README.rst b/sale_force_invoice_amount/README.rst new file mode 100644 index 000000000000..1a47b8bef3ab --- /dev/null +++ b/sale_force_invoice_amount/README.rst @@ -0,0 +1,78 @@ +========================== +Sale Force Invoiced Amount +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:081eeb241f4d55cd489429e4f0c2096e77e62d90bd6c6f288c2805dbec765ac0 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fsale--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/sale-workflow/tree/16.0/sale_force_invoice_amount + :alt: OCA/sale-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_force_invoice_amount + :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/sale-workflow&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Fixes the force invoice field when both sale_force_invoiced and +sale_order_invoice_amount are installed + +**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 +------- + +* Innovyou + +Contributors +------------ + +Valerio Paretta valerio.paretta@innovyou.it +<`www.innovyou.it> >`__ + +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/sale-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_force_invoice_amount/__init__.py b/sale_force_invoice_amount/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/sale_force_invoice_amount/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_force_invoice_amount/__manifest__.py b/sale_force_invoice_amount/__manifest__.py new file mode 100644 index 000000000000..b8dec670c9dc --- /dev/null +++ b/sale_force_invoice_amount/__manifest__.py @@ -0,0 +1,13 @@ +{ + "name": "Sale Force Invoiced Amount", + "summary": "When the Force Invoiced is checked, the invoiced amount is updated.", + "version": "16.0.1.0.0", + "author": "Innovyou, Odoo Community Association (OCA)", + "category": "sale", + "license": "AGPL-3", + "website": "https://github.com/OCA/sale-workflow", + "depends": ["sale_force_invoiced", "sale_order_invoice_amount"], + "data": [], + "installable": True, + "auto_install": True, +} diff --git a/sale_force_invoice_amount/models/__init__.py b/sale_force_invoice_amount/models/__init__.py new file mode 100644 index 000000000000..6aacb753131f --- /dev/null +++ b/sale_force_invoice_amount/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order diff --git a/sale_force_invoice_amount/models/sale_order.py b/sale_force_invoice_amount/models/sale_order.py new file mode 100644 index 000000000000..9b7c62658f77 --- /dev/null +++ b/sale_force_invoice_amount/models/sale_order.py @@ -0,0 +1,17 @@ +from odoo import api, models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + @api.depends("force_invoiced") + def _compute_invoice_status(self): + res = super()._compute_invoice_status() + + if res: + for order in res: + if order.force_invoiced: + order.invoiced_amount = order.uninvoiced_amount + order.uninvoiced_amount = 0.0 + + return res diff --git a/sale_force_invoice_amount/readme/CONTRIBUTORS.md b/sale_force_invoice_amount/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..7b8ab23cdae5 --- /dev/null +++ b/sale_force_invoice_amount/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +Valerio Paretta valerio.paretta@innovyou.it \ No newline at end of file diff --git a/sale_force_invoice_amount/readme/DESCRIPTION.md b/sale_force_invoice_amount/readme/DESCRIPTION.md new file mode 100644 index 000000000000..08b18d9087fe --- /dev/null +++ b/sale_force_invoice_amount/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Fixes the force invoice field when both sale_force_invoiced and sale_order_invoice_amount are installed \ No newline at end of file diff --git a/sale_force_invoice_amount/static/description/index.html b/sale_force_invoice_amount/static/description/index.html new file mode 100644 index 000000000000..9aa7e0305f9e --- /dev/null +++ b/sale_force_invoice_amount/static/description/index.html @@ -0,0 +1,426 @@ + + + + + +Sale Force Invoiced Amount + + + +
+

Sale Force Invoiced Amount

+ + +

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

+

TEST

+

Table of contents

+ +
+

Usage

+

TEST

+
+
+

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

+
    +
  • Innovyou
  • +
+
+
+

Contributors

+

TEST

+
+
+

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/sale-workflow project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/setup/sale_force_invoice_amount/odoo/addons/sale_force_invoice_amount b/setup/sale_force_invoice_amount/odoo/addons/sale_force_invoice_amount new file mode 120000 index 000000000000..b532f73b4343 --- /dev/null +++ b/setup/sale_force_invoice_amount/odoo/addons/sale_force_invoice_amount @@ -0,0 +1 @@ +../../../../sale_force_invoice_amount \ No newline at end of file diff --git a/setup/sale_force_invoice_amount/setup.py b/setup/sale_force_invoice_amount/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/sale_force_invoice_amount/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)