Skip to content

Commit 358b1e5

Browse files
[18.0][ADD] contract_invoice_force_date_queue
Ensure forced invoice dates are applied when invoices are generated with job queues.
1 parent d26bb46 commit 358b1e5

16 files changed

Lines changed: 646 additions & 0 deletions
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
=================================
2+
Contract Invoice Force Date Queue
3+
=================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:8e145a66bc9513caaac6df3295680f8699e2b8b47ed9dbf5e978c70b107610a4
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
20+
:target: https://github.com/OCA/contract/tree/18.0/contract_invoice_force_date_queue
21+
:alt: OCA/contract
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract_invoice_force_date_queue
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Ensure forced invoice dates are applied when invoices are generated with
32+
job queues.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Usage
40+
=====
41+
42+
This module does not impact the user interface.
43+
44+
Changelog
45+
=========
46+
47+
18.0.1.0.0 (2026-02-13)
48+
-----------------------
49+
50+
- Add module
51+
52+
Bug Tracker
53+
===========
54+
55+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_.
56+
In case of trouble, please check there if your issue has already been reported.
57+
If you spotted it first, help us to smash it by providing a detailed and welcomed
58+
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract_invoice_force_date_queue%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
59+
60+
Do not contact contributors directly about support or help with technical issues.
61+
62+
Credits
63+
=======
64+
65+
Authors
66+
-------
67+
68+
* ACSONE SA/NV
69+
70+
Contributors
71+
------------
72+
73+
- Tobias Zehntner tobias.zehntner@acsone.eu (https://www.acsone.eu)
74+
75+
Maintainers
76+
-----------
77+
78+
This module is maintained by the OCA.
79+
80+
.. image:: https://odoo-community.org/logo.png
81+
:alt: Odoo Community Association
82+
:target: https://odoo-community.org
83+
84+
OCA, or the Odoo Community Association, is a nonprofit organization whose
85+
mission is to support the collaborative development of Odoo features and
86+
promote its widespread use.
87+
88+
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/18.0/contract_invoice_force_date_queue>`_ project on GitHub.
89+
90+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import models
2+
from . import wizards
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2026 ACSONE SA/NV
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Contract Invoice Force Date Queue",
6+
"summary": """Bridge between contract_invoice_force_date and contract_queue_job""",
7+
"version": "18.0.1.0.0",
8+
"license": "AGPL-3",
9+
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
10+
"website": "https://github.com/OCA/contract",
11+
"depends": [
12+
"contract_invoice_force_date",
13+
"contract_queue_job",
14+
],
15+
"auto_install": True,
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import contract_contract
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2026 ACSONE SA/NV
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, models
5+
6+
7+
class ContractContract(models.Model):
8+
_inherit = "contract.contract"
9+
10+
@api.model
11+
def _job_prepare_context_before_enqueue_keys(self):
12+
"""
13+
Keys to keep in context of stored jobs
14+
"""
15+
return (
16+
*super()._job_prepare_context_before_enqueue_keys(),
17+
"invoice_date_forced",
18+
)
19+
20+
def _recurring_create_invoice(self, date_ref=False):
21+
moves = super()._recurring_create_invoice(date_ref=date_ref)
22+
if invoice_date := self.env.context.get("invoice_date_forced", False):
23+
moves.write({"invoice_date": invoice_date})
24+
return moves
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Tobias Zehntner <tobias.zehntner@acsone.eu> (https://www.acsone.eu)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure forced invoice dates are applied when invoices are generated with job queues.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 18.0.1.0.0 (2026-02-13)
2+
3+
- Add module
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
> This module does not impact the user interface.

0 commit comments

Comments
 (0)