Maintainers
+Maintainers
This module is maintained by the OCA.
@@ -522,6 +520,5 @@ diff --git a/contract/README.rst b/contract/README.rst index 1c2dc198eb..73b79a554e 100644 --- a/contract/README.rst +++ b/contract/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ================================ Recurring - Contracts Management ================================ @@ -17,7 +13,7 @@ Recurring - Contracts Management .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status :alt: Production/Stable -.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png +.. |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 @@ -75,6 +71,9 @@ Usage - #START# - #END# or #INVOICEMONTHNAME# in the description field to display the start/end date or the start month of the invoiced period in the invoice line description + - #START-NEXT-MONTH# or #END-NEXT-MONTH# to display next month's + dates based on the invoice period start, useful when invoicing the + next month's services - pre-paid (invoice at period start) or post-paid (invoice at start of next period) diff --git a/contract/models/contract_line.py b/contract/models/contract_line.py index 5b8207c27f..f89dcdf69f 100644 --- a/contract/models/contract_line.py +++ b/contract/models/contract_line.py @@ -623,6 +623,18 @@ def _insert_markers(self, first_date_invoiced, last_date_invoiced): name = self.name name = name.replace("#START#", first_date_invoiced.strftime(date_format)) name = name.replace("#END#", last_date_invoiced.strftime(date_format)) + name = name.replace( + "#START-NEXT-MONTH#", + (first_date_invoiced + relativedelta(months=1, day=1)).strftime( + date_format + ), + ) + name = name.replace( + "#END-NEXT-MONTH#", + (first_date_invoiced + relativedelta(months=1, day=31)).strftime( + date_format + ), + ) name = name.replace( "#INVOICEMONTHNAME#", self.with_context(lang=lang.code)._translate_marker_month_name( diff --git a/contract/readme/USAGE.md b/contract/readme/USAGE.md index 8cc5f31818..746612671d 100644 --- a/contract/readme/USAGE.md +++ b/contract/readme/USAGE.md @@ -14,6 +14,9 @@ - \#START# - \#END# or \#INVOICEMONTHNAME# in the description field to display the start/end date or the start month of the invoiced period in the invoice line description + - \#START-NEXT-MONTH\# or \#END-NEXT-MONTH\# to display next month's + dates based on the invoice period start, useful when invoicing the + next month's services - pre-paid (invoice at period start) or post-paid (invoice at start of next period) 4. The "Generate Recurring Invoices from Contracts" cron runs daily to diff --git a/contract/static/description/index.html b/contract/static/description/index.html index 1aae071dcd..6ed10504b7 100644 --- a/contract/static/description/index.html +++ b/contract/static/description/index.html @@ -3,7 +3,7 @@
-This module enables contracts management with recurring invoicing functions. Also you can print and send by email contract report.
It works for customer contract and supplier contracts.
@@ -395,14 +390,14 @@To view discount field in contract line, you need to set Discount on lines in user access rights.
Contracts can be viewed on the portal (list and detail) if the user logged into the portal is a follower of the contract.

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 @@ -461,16 +459,16 @@
Do not contact contributors directly about support or help with technical issues.