diff --git a/contract_update_last_date_invoiced/README.rst b/contract_update_last_date_invoiced/README.rst new file mode 100644 index 000000000..397422b50 --- /dev/null +++ b/contract_update_last_date_invoiced/README.rst @@ -0,0 +1,82 @@ +========================= +Contract Last Date Update +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-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%2Fcontract-lightgray.png?logo=github + :target: https://github.com/OCA/contract/tree/14.0/contract_update_last_date_invoiced + :alt: OCA/contract +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/contract-14-0/contract-14-0-contract_update_last_date_invoiced + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/110/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows users to update the last date invoiced +(e.g.: deletion of invoices). + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to Invoicing > Customers > Customer Contracts +* Select a contract and click on Update Last Date Invoiced +* Fill in the last date invoiced with the desired value + +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 +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Souheil Bejaoui +* Denis Roussel + +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/contract `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/contract_update_last_date_invoiced/__init__.py b/contract_update_last_date_invoiced/__init__.py new file mode 100644 index 000000000..aee8895e7 --- /dev/null +++ b/contract_update_last_date_invoiced/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/contract_update_last_date_invoiced/__manifest__.py b/contract_update_last_date_invoiced/__manifest__.py new file mode 100644 index 000000000..e51c9e17c --- /dev/null +++ b/contract_update_last_date_invoiced/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2022 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Contract Last Date Update", + "summary": """ + This module allows to update the last date invoiced if invoices are deleted.""", + "version": "14.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/contract", + "depends": ["contract"], + "data": [ + "security/security.xml", + "views/contract_line.xml", + "wizards/update_last_date_invoiced.xml", + ], +} diff --git a/contract_update_last_date_invoiced/models/__init__.py b/contract_update_last_date_invoiced/models/__init__.py new file mode 100644 index 000000000..6143a3650 --- /dev/null +++ b/contract_update_last_date_invoiced/models/__init__.py @@ -0,0 +1 @@ +from . import contract_line diff --git a/contract_update_last_date_invoiced/models/contract_line.py b/contract_update_last_date_invoiced/models/contract_line.py new file mode 100644 index 000000000..6d2b7de7a --- /dev/null +++ b/contract_update_last_date_invoiced/models/contract_line.py @@ -0,0 +1,35 @@ +# Copyright 2019 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import _, models + + +class ContractLine(models.Model): + + _inherit = "contract.line" + + def action_update_last_date_invoiced(self): + self.ensure_one() + context = { + "default_contract_line_id": self.id, + "default_last_date_invoiced": self.last_date_invoiced, + "default_recurring_next_date": self.recurring_next_date, + } + context.update(self.env.context) + return { + "type": "ir.actions.act_window", + "name": _("Update Last Date Invoiced"), + "res_model": "contract.update.last.date.invoiced", + "view_type": "form", + "view_mode": "form", + "target": "new", + "context": context, + } + + def _update_last_date_invoiced(self, last_date_invoiced, recurring_next_date): + self.write( + { + "last_date_invoiced": last_date_invoiced, + "recurring_next_date": recurring_next_date, + } + ) diff --git a/contract_update_last_date_invoiced/readme/CONTRIBUTORS.rst b/contract_update_last_date_invoiced/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..27eebf9cd --- /dev/null +++ b/contract_update_last_date_invoiced/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Souheil Bejaoui +* Denis Roussel diff --git a/contract_update_last_date_invoiced/readme/DESCRIPTION.rst b/contract_update_last_date_invoiced/readme/DESCRIPTION.rst new file mode 100644 index 000000000..825121d9b --- /dev/null +++ b/contract_update_last_date_invoiced/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows users to update the last date invoiced +(e.g.: deletion of invoices). diff --git a/contract_update_last_date_invoiced/readme/USAGE.rst b/contract_update_last_date_invoiced/readme/USAGE.rst new file mode 100644 index 000000000..043be5ead --- /dev/null +++ b/contract_update_last_date_invoiced/readme/USAGE.rst @@ -0,0 +1,3 @@ +* Go to Invoicing > Customers > Customer Contracts +* Select a contract and click on Update Last Date Invoiced +* Fill in the last date invoiced with the desired value diff --git a/contract_update_last_date_invoiced/security/security.xml b/contract_update_last_date_invoiced/security/security.xml new file mode 100644 index 000000000..57857ae74 --- /dev/null +++ b/contract_update_last_date_invoiced/security/security.xml @@ -0,0 +1,29 @@ + + + + + + Contract: Can update last date invoiced + + + + contract.update.last.date.invoiced.access (in contract_update_last_date_invoiced) + + + + + + + + + + diff --git a/contract_update_last_date_invoiced/static/description/icon.png b/contract_update_last_date_invoiced/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/contract_update_last_date_invoiced/static/description/icon.png differ diff --git a/contract_update_last_date_invoiced/static/description/index.html b/contract_update_last_date_invoiced/static/description/index.html new file mode 100644 index 000000000..afddcf03e --- /dev/null +++ b/contract_update_last_date_invoiced/static/description/index.html @@ -0,0 +1,430 @@ + + + + + + +Contract Last Date Update + + + +
+

Contract Last Date Update

+ + +

Beta License: AGPL-3 OCA/contract Translate me on Weblate Try me on Runbot

+

This module allows users to update the last date invoiced +(e.g.: deletion of invoices).

+

Table of contents

+ +
+

Usage

+
    +
  • Go to Invoicing > Customers > Customer Contracts
  • +
  • Select a contract and click on Update Last Date Invoiced
  • +
  • Fill in the last date invoiced with the desired value
  • +
+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/contract_update_last_date_invoiced/views/contract_line.xml b/contract_update_last_date_invoiced/views/contract_line.xml new file mode 100644 index 000000000..886e7f2f2 --- /dev/null +++ b/contract_update_last_date_invoiced/views/contract_line.xml @@ -0,0 +1,26 @@ + + + + + + contract.line + contract.line.form (in contract_update_last_date_invoiced) + + + +