From 3a749b1a57c44c60c522b0be8c54689e095b3abf Mon Sep 17 00:00:00 2001
From: DavidJForgeFlow
Date: Fri, 8 Nov 2024 10:43:11 +0100
Subject: [PATCH 1/6] [ADD] ddmrp_warning_as_job
---
ddmrp_warning_as_job/README.rst | 80 ++++
ddmrp_warning_as_job/__init__.py | 1 +
ddmrp_warning_as_job/__manifest__.py | 15 +
.../data/queue_job_function_data.xml | 10 +
ddmrp_warning_as_job/models/__init__.py | 1 +
ddmrp_warning_as_job/models/stock_buffer.py | 32 ++
ddmrp_warning_as_job/pyproject.toml | 3 +
ddmrp_warning_as_job/readme/CONTRIBUTORS.md | 1 +
ddmrp_warning_as_job/readme/DESCRIPTION.md | 5 +
.../static/description/icon.png | Bin 0 -> 2505 bytes
.../static/description/index.html | 421 ++++++++++++++++++
ddmrp_warning_as_job/tests/__init__.py | 1 +
.../tests/test_ddmrp_warning_as_job.py | 37 ++
13 files changed, 607 insertions(+)
create mode 100644 ddmrp_warning_as_job/README.rst
create mode 100644 ddmrp_warning_as_job/__init__.py
create mode 100644 ddmrp_warning_as_job/__manifest__.py
create mode 100644 ddmrp_warning_as_job/data/queue_job_function_data.xml
create mode 100644 ddmrp_warning_as_job/models/__init__.py
create mode 100644 ddmrp_warning_as_job/models/stock_buffer.py
create mode 100644 ddmrp_warning_as_job/pyproject.toml
create mode 100644 ddmrp_warning_as_job/readme/CONTRIBUTORS.md
create mode 100644 ddmrp_warning_as_job/readme/DESCRIPTION.md
create mode 100644 ddmrp_warning_as_job/static/description/icon.png
create mode 100644 ddmrp_warning_as_job/static/description/index.html
create mode 100644 ddmrp_warning_as_job/tests/__init__.py
create mode 100644 ddmrp_warning_as_job/tests/test_ddmrp_warning_as_job.py
diff --git a/ddmrp_warning_as_job/README.rst b/ddmrp_warning_as_job/README.rst
new file mode 100644
index 000000000..8fd9c8038
--- /dev/null
+++ b/ddmrp_warning_as_job/README.rst
@@ -0,0 +1,80 @@
+====================
+DDMRP Warning as job
+====================
+
+..
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! source digest: sha256:c0be4c0f605d82c49833a1a3f246b7c85a9b0d22c6820ab5b051b087cd6d1951
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |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%2Fddmrp-lightgray.png?logo=github
+ :target: https://github.com/OCA/ddmrp/tree/17.0/ddmrp_warning_as_job
+ :alt: OCA/ddmrp
+.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
+ :target: https://translation.odoo-community.org/projects/ddmrp-17-0/ddmrp-17-0-ddmrp_warning_as_job
+ :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/ddmrp&target_branch=17.0
+ :alt: Try me on Runboat
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+DDMRP Warning calculations are now run with Queue Jobs.
+
+The ``._generate_ddmrp_warnings`` method is automatically
+delayed when the context contains
+``auto_delay_ddmrp_generate_ddmrp_warnings=True``.
+
+**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
+-------
+
+* ForgeFlow
+
+Contributors
+------------
+
+David Jiménez david.jimenez@forgeflow.com
+
+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/ddmrp `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/ddmrp_warning_as_job/__init__.py b/ddmrp_warning_as_job/__init__.py
new file mode 100644
index 000000000..0650744f6
--- /dev/null
+++ b/ddmrp_warning_as_job/__init__.py
@@ -0,0 +1 @@
+from . import models
diff --git a/ddmrp_warning_as_job/__manifest__.py b/ddmrp_warning_as_job/__manifest__.py
new file mode 100644
index 000000000..b6905ba9f
--- /dev/null
+++ b/ddmrp_warning_as_job/__manifest__.py
@@ -0,0 +1,15 @@
+# Copyright 2024 ForgeFlow (https://www.camptocamp.com)
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
+
+{
+ "name": "DDMRP Warning as job",
+ "version": "17.0.1.0.0",
+ "summary": "Run DDMRP Warning as jobs",
+ "author": "ForgeFlow, Odoo Community Association (OCA)",
+ "website": "https://github.com/OCA/ddmrp",
+ "category": "Warehouse Management",
+ "depends": ["ddmrp_warning", "ddmrp_cron_actions_as_job", "queue_job"],
+ "data": ["data/queue_job_function_data.xml"],
+ "license": "LGPL-3",
+ "installable": True,
+}
diff --git a/ddmrp_warning_as_job/data/queue_job_function_data.xml b/ddmrp_warning_as_job/data/queue_job_function_data.xml
new file mode 100644
index 000000000..c326bd1b7
--- /dev/null
+++ b/ddmrp_warning_as_job/data/queue_job_function_data.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+ _generate_ddmrp_warnings
+
+
+
diff --git a/ddmrp_warning_as_job/models/__init__.py b/ddmrp_warning_as_job/models/__init__.py
new file mode 100644
index 000000000..46f971b6d
--- /dev/null
+++ b/ddmrp_warning_as_job/models/__init__.py
@@ -0,0 +1 @@
+from . import stock_buffer
diff --git a/ddmrp_warning_as_job/models/stock_buffer.py b/ddmrp_warning_as_job/models/stock_buffer.py
new file mode 100644
index 000000000..ca15c2fa0
--- /dev/null
+++ b/ddmrp_warning_as_job/models/stock_buffer.py
@@ -0,0 +1,32 @@
+# Copyright 2024 ForgeFlow (https://www.camptocamp.com)
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
+
+from odoo import models
+
+from odoo.addons.queue_job.job import identity_exact
+
+
+class Buffer(models.Model):
+ _inherit = "stock.buffer"
+
+ def _generate_ddmrp_warnings_job_options(self):
+ return {
+ "identity_key": identity_exact,
+ "priority": 15,
+ "description": f"DDMRP Warning calculation ({self.display_name})",
+ }
+
+ def _register_hook(self):
+ self._patch_method(
+ "_generate_ddmrp_warnings",
+ self._patch_job_auto_delay(
+ "_generate_ddmrp_warnings",
+ context_key="auto_delay_ddmrp_generate_ddmrp_warnings",
+ ),
+ )
+ return super()._register_hook()
+
+ def cron_generate_ddmrp_warnings(self, automatic=False):
+ return super(
+ Buffer, self.with_context(auto_delay_ddmrp_generate_ddmrp_warnings=True)
+ ).cron_generate_ddmrp_warnings(automatic=automatic)
diff --git a/ddmrp_warning_as_job/pyproject.toml b/ddmrp_warning_as_job/pyproject.toml
new file mode 100644
index 000000000..4231d0ccc
--- /dev/null
+++ b/ddmrp_warning_as_job/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["whool"]
+build-backend = "whool.buildapi"
diff --git a/ddmrp_warning_as_job/readme/CONTRIBUTORS.md b/ddmrp_warning_as_job/readme/CONTRIBUTORS.md
new file mode 100644
index 000000000..7cf8d69ff
--- /dev/null
+++ b/ddmrp_warning_as_job/readme/CONTRIBUTORS.md
@@ -0,0 +1 @@
+David Jiménez
diff --git a/ddmrp_warning_as_job/readme/DESCRIPTION.md b/ddmrp_warning_as_job/readme/DESCRIPTION.md
new file mode 100644
index 000000000..c098fad82
--- /dev/null
+++ b/ddmrp_warning_as_job/readme/DESCRIPTION.md
@@ -0,0 +1,5 @@
+DDMRP Warning calculations are now run with Queue Jobs.
+
+The `._generate_ddmrp_warnings` method is automatically delayed when
+the context contains `auto_delay_ddmrp_generate_ddmrp_warnings=True`.
+
diff --git a/ddmrp_warning_as_job/static/description/icon.png b/ddmrp_warning_as_job/static/description/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..90c92e98de4d65be4f1b62cf9756293b4d887ee7
GIT binary patch
literal 2505
zcmV;)2{!hLP)iAr+wtAt6%Hms%&OQ#VoCI*se5q$z6re$3qSeJt*s@z@@ZJ+JHQ
znfu$!Ip?02zyEpMd(OGnVrFEd2e;o9$kQ21W6eKTLX@rIab_{iX22nS4YclKK|xf2-8Lh{(0+$EN3@_O@4<+_xI_J2kei3gXRY
zg6tEuw%-tB%ukAm?oXBa7ctRNPyL=cmUQ+H2o
z>Hyo8-xbYVAx1)cwQuTSfVgBQ594%
zHN!k;CCr<}zhuue4G?5;_TkxY8k+^!wn1f>o{$r-nc0JtumTL-?d((_vL(LMEviB+
zn5u}Hp@x})H!wxKfq5}+ikXP2p$ckd<^^wvdGLnCznDk7VWx(9K~+Ufu+YpKSO~sd
zVYk2$$Lkos{O;Sh)50*H0mK|r_R+~U~X@3w~-n3{PLF*UqN
z|8ww)f##px?EP1nL@3k|4MPbgIyb-$a$5$S>@_wVZ4IlO_XH()O
zG;BZ(TY~vfxTUkzJ(%P%Ka6Nz%nu8G7<5?h1&1F7Uv%P!F)e~uaX)|L(=!cwMumog
z%zl1$b^N*U%fLMV3nufU(i?&dh-qX*@k8K;#I%4!#uf7g5iNo*#6})bbj0Bc&ip9i
zW#dV*K`Bxx?4NtC*KQG;vV%LO&JxX@5U%m5`VWD1|EAp{jJ!AU?85B}kDJ*iR?ODQ
zChLR3q2_8;pF@}qA$}+@UjRRBQHvdR<_oc*iw^`hyV@%}ciDu?xz|p|A45n+tnQ
z(3BtmT)AtMmGaYA_V(58*d3PTw)a{X`<_~D~9Yf`8OX>QJAV^4%
z0c*OTzC&1J_2^Wy$yyWS#=r%za!YCZheaJZ7GNXnq4q#L{M9bBJrt4iF<7z9*cXb
zt7#au0#|!ChQy5pqMkoMIch{(|E5DNKc}@Rh)y6i(~#e=K*|u5fUTmJYut5`?24nz
zvG58xYR;|6JDh&?Fa$%d#C#zxyt*vDQCGe;ue(2Kg{Jz9~#vAFiMypJ%d-?wQm6
z`yxb1hBx`8wcFha?F(XVLy#f*Pms-biXOk-*84T>3sM}Ipt3KL*CnVk$@MaWwp?`!
z7dd@>xk2n*Xx~oaCCg4AhbIw>_KkD48a+k#0nu>fLH@{J-}zN1
zvTS}&eJ5TY|1K)u0^t4N!x!I}ewD+W5%i3*Ek-Kp>a36VF>X;y9@u(T=&f_scrrPphDDJXrrzacE{f;Luc1#TDWDf!OsW`rN{L9=79_2#r
z8+fOzp{P^V(WsThEzhHrP)bhmPFb-^OSQlEW9<6!0CrG(`mR?;(F?*dC
zURdo$*4-22{P{WH?XKm&pLDVJclUg*_2_{*)vo(FB-9J_ow-~D$ydTrPWf&(r{mmZ+@iT8QwrFXkoK=%bX
zd-e^WH}*)R`^RUyFNm39cE0Q7BtZhbJ(>3ed*P(Kh~j~!r}5-+e@~*IM#U?69E%)6wOg^91*B4-JZk?&A#Q$~2
z{t1#%m+X5bDI*gkWn_Y+j7*S}kqMGAGC@*CCP>Q21W6g0ASojgBxPiRq>TRqDz!5F
Tc6@2j00000NkvXXu0mjfE;rbf
literal 0
HcmV?d00001
diff --git a/ddmrp_warning_as_job/static/description/index.html b/ddmrp_warning_as_job/static/description/index.html
new file mode 100644
index 000000000..0618d1a61
--- /dev/null
+++ b/ddmrp_warning_as_job/static/description/index.html
@@ -0,0 +1,421 @@
+
+
+
+
+
+DDMRP Warning as job
+
+
+
+
+
DDMRP Warning as job
+
+
+

+
DDMRP Warning calculations are now run with Queue Jobs.
+
The <stock.buffer>._generate_ddmrp_warnings method is automatically
+delayed when the context contains
+auto_delay_ddmrp_generate_ddmrp_warnings=True.
+
Table of contents
+
+
+
+
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.
+
+
+
+
+
+
+
+
This module is maintained by the OCA.
+

+
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/ddmrp project on GitHub.
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
+
+
+
+
+
diff --git a/ddmrp_warning_as_job/tests/__init__.py b/ddmrp_warning_as_job/tests/__init__.py
new file mode 100644
index 000000000..89479b42d
--- /dev/null
+++ b/ddmrp_warning_as_job/tests/__init__.py
@@ -0,0 +1 @@
+from . import test_ddmrp_warning_as_job
diff --git a/ddmrp_warning_as_job/tests/test_ddmrp_warning_as_job.py b/ddmrp_warning_as_job/tests/test_ddmrp_warning_as_job.py
new file mode 100644
index 000000000..084d8b2dc
--- /dev/null
+++ b/ddmrp_warning_as_job/tests/test_ddmrp_warning_as_job.py
@@ -0,0 +1,37 @@
+# Copyright 2024 ForgeFlow (https://www.camptocamp.com)
+# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
+
+from odoo.tests import tagged
+
+from odoo.addons.ddmrp.tests.common import TestDdmrpCommon
+from odoo.addons.queue_job.job import identity_exact
+from odoo.addons.queue_job.tests.common import mock_with_delay
+
+
+@tagged("post_install", "-at_install")
+class TestDdmrpWarningAsJob(TestDdmrpCommon):
+ def test_generate_ddmrp_warnings_delay_job(self):
+ context = dict(self.env.context, auto_delay_ddmrp_generate_ddmrp_warnings=True)
+ context.update(
+ {
+ "test_queue_job_no_delay": False,
+ }
+ )
+ buffer_a = self.buffer_a.with_context(**context)
+
+ with mock_with_delay() as (delayable_cls, delayable):
+ buffer_a._generate_ddmrp_warnings()
+
+ # check 'with_delay()' part:
+ self.assertEqual(delayable_cls.call_count, 1)
+ # arguments passed in 'with_delay()'
+ delay_args, delay_kwargs = delayable_cls.call_args
+ self.assertEqual(delay_args, (self.buffer_a,))
+ self.assertEqual(delay_kwargs.get("priority"), 15)
+ self.assertEqual(delay_kwargs.get("identity_key"), identity_exact)
+
+ # check what's passed to the job method '_generate_ddmrp_warnings'
+ self.assertEqual(delayable._generate_ddmrp_warnings.call_count, 1)
+ delay_args, delay_kwargs = delayable._generate_ddmrp_warnings.call_args
+ self.assertEqual(delay_args, ())
+ self.assertDictEqual(delay_kwargs, {})
From 57f1329959ea0ea2e160872e41e0b7aa8dfbeacd Mon Sep 17 00:00:00 2001
From: mymage
Date: Mon, 11 Nov 2024 11:09:02 +0000
Subject: [PATCH 2/6] Added translation using Weblate (Italian)
---
ddmrp_warning_as_job/i18n/it.po | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 ddmrp_warning_as_job/i18n/it.po
diff --git a/ddmrp_warning_as_job/i18n/it.po b/ddmrp_warning_as_job/i18n/it.po
new file mode 100644
index 000000000..7be082b23
--- /dev/null
+++ b/ddmrp_warning_as_job/i18n/it.po
@@ -0,0 +1,20 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * ddmrp_warning_as_job
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 17.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#. module: ddmrp_warning_as_job
+#: model:ir.model,name:ddmrp_warning_as_job.model_stock_buffer
+msgid "Stock Buffer"
+msgstr ""
From fc1855b282a8b556a4230fca3a8d574849bd3342 Mon Sep 17 00:00:00 2001
From: mymage
Date: Mon, 11 Nov 2024 11:09:08 +0000
Subject: [PATCH 3/6] Translated using Weblate (Italian)
Currently translated at 100.0% (1 of 1 strings)
Translation: ddmrp-17.0/ddmrp-17.0-ddmrp_warning_as_job
Translate-URL: https://translation.odoo-community.org/projects/ddmrp-17-0/ddmrp-17-0-ddmrp_warning_as_job/it/
---
ddmrp_warning_as_job/i18n/it.po | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ddmrp_warning_as_job/i18n/it.po b/ddmrp_warning_as_job/i18n/it.po
index 7be082b23..fa41a6cf2 100644
--- a/ddmrp_warning_as_job/i18n/it.po
+++ b/ddmrp_warning_as_job/i18n/it.po
@@ -6,15 +6,17 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2024-11-11 14:06+0000\n"
+"Last-Translator: mymage \n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 5.6.2\n"
#. module: ddmrp_warning_as_job
#: model:ir.model,name:ddmrp_warning_as_job.model_stock_buffer
msgid "Stock Buffer"
-msgstr ""
+msgstr "Buffer di materiale"
From 4302224bc9aeb56a8361de9cfc21874c91f138dc Mon Sep 17 00:00:00 2001
From: ThiagoMForgeFlow
Date: Wed, 5 Mar 2025 13:36:37 +0100
Subject: [PATCH 4/6] [MIG] ddmrp_warning_as_job: Migration to 18.0
---
ddmrp_warning_as_job/README.rst | 10 +++++-----
ddmrp_warning_as_job/__manifest__.py | 4 ++--
ddmrp_warning_as_job/static/description/index.html | 6 +++---
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/ddmrp_warning_as_job/README.rst b/ddmrp_warning_as_job/README.rst
index 8fd9c8038..50173f8e6 100644
--- a/ddmrp_warning_as_job/README.rst
+++ b/ddmrp_warning_as_job/README.rst
@@ -17,13 +17,13 @@ DDMRP Warning as job
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fddmrp-lightgray.png?logo=github
- :target: https://github.com/OCA/ddmrp/tree/17.0/ddmrp_warning_as_job
+ :target: https://github.com/OCA/ddmrp/tree/18.0/ddmrp_warning_as_job
:alt: OCA/ddmrp
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/ddmrp-17-0/ddmrp-17-0-ddmrp_warning_as_job
+ :target: https://translation.odoo-community.org/projects/ddmrp-18-0/ddmrp-18-0-ddmrp_warning_as_job
: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/ddmrp&target_branch=17.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/ddmrp&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -45,7 +45,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -75,6 +75,6 @@ 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/ddmrp `_ project on GitHub.
+This module is part of the `OCA/ddmrp `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/ddmrp_warning_as_job/__manifest__.py b/ddmrp_warning_as_job/__manifest__.py
index b6905ba9f..d8c5141e1 100644
--- a/ddmrp_warning_as_job/__manifest__.py
+++ b/ddmrp_warning_as_job/__manifest__.py
@@ -3,12 +3,12 @@
{
"name": "DDMRP Warning as job",
- "version": "17.0.1.0.0",
+ "version": "18.0.1.0.0",
"summary": "Run DDMRP Warning as jobs",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/ddmrp",
"category": "Warehouse Management",
- "depends": ["ddmrp_warning", "ddmrp_cron_actions_as_job", "queue_job"],
+ "depends": ["ddmrp_warning", "ddmrp_cron_actions_as_job"],
"data": ["data/queue_job_function_data.xml"],
"license": "LGPL-3",
"installable": True,
diff --git a/ddmrp_warning_as_job/static/description/index.html b/ddmrp_warning_as_job/static/description/index.html
index 0618d1a61..80476fa7e 100644
--- a/ddmrp_warning_as_job/static/description/index.html
+++ b/ddmrp_warning_as_job/static/description/index.html
@@ -368,7 +368,7 @@ DDMRP Warning as job
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c0be4c0f605d82c49833a1a3f246b7c85a9b0d22c6820ab5b051b087cd6d1951
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

DDMRP Warning calculations are now run with Queue Jobs.
The <stock.buffer>._generate_ddmrp_warnings method is automatically
delayed when the context contains
@@ -390,7 +390,7 @@
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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -412,7 +412,7 @@
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/ddmrp project on GitHub.
+
This module is part of the OCA/ddmrp project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
From 94e01fd1fae2689559620fe6e61bb242f5eb702a Mon Sep 17 00:00:00 2001
From: Don Kendall
Date: Mon, 15 Jun 2026 12:13:08 -0400
Subject: [PATCH 5/6] [MIG] ddmrp_warning_as_job: Migration to 19.0
Signed-off-by: Don Kendall
---
ddmrp_warning_as_job/README.rst | 18 ++++----
ddmrp_warning_as_job/__manifest__.py | 2 +-
ddmrp_warning_as_job/models/stock_buffer.py | 13 +++---
.../static/description/index.html | 41 +++++++++++--------
4 files changed, 45 insertions(+), 29 deletions(-)
diff --git a/ddmrp_warning_as_job/README.rst b/ddmrp_warning_as_job/README.rst
index 50173f8e6..9cc482d2a 100644
--- a/ddmrp_warning_as_job/README.rst
+++ b/ddmrp_warning_as_job/README.rst
@@ -1,3 +1,7 @@
+.. image:: https://odoo-community.org/readme-banner-image
+ :target: https://odoo-community.org/get-involved?utm_source=readme
+ :alt: Odoo Community Association
+
====================
DDMRP Warning as job
====================
@@ -7,23 +11,23 @@ DDMRP Warning as job
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:c0be4c0f605d82c49833a1a3f246b7c85a9b0d22c6820ab5b051b087cd6d1951
+ !! source digest: sha256:f4fd5dfb7590158816c019119a1932be3c25521fa8cafaa44d8e9df3ffede929
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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
+.. |badge2| image:: https://img.shields.io/badge/license-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%2Fddmrp-lightgray.png?logo=github
- :target: https://github.com/OCA/ddmrp/tree/18.0/ddmrp_warning_as_job
+ :target: https://github.com/OCA/ddmrp/tree/19.0/ddmrp_warning_as_job
:alt: OCA/ddmrp
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/ddmrp-18-0/ddmrp-18-0-ddmrp_warning_as_job
+ :target: https://translation.odoo-community.org/projects/ddmrp-19-0/ddmrp-19-0-ddmrp_warning_as_job
: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/ddmrp&target_branch=18.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/ddmrp&target_branch=19.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -45,7 +49,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -75,6 +79,6 @@ 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/ddmrp `_ project on GitHub.
+This module is part of the `OCA/ddmrp `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/ddmrp_warning_as_job/__manifest__.py b/ddmrp_warning_as_job/__manifest__.py
index d8c5141e1..6e4236450 100644
--- a/ddmrp_warning_as_job/__manifest__.py
+++ b/ddmrp_warning_as_job/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "DDMRP Warning as job",
- "version": "18.0.1.0.0",
+ "version": "19.0.1.0.0",
"summary": "Run DDMRP Warning as jobs",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/ddmrp",
diff --git a/ddmrp_warning_as_job/models/stock_buffer.py b/ddmrp_warning_as_job/models/stock_buffer.py
index ca15c2fa0..10b61f1df 100644
--- a/ddmrp_warning_as_job/models/stock_buffer.py
+++ b/ddmrp_warning_as_job/models/stock_buffer.py
@@ -1,6 +1,8 @@
# Copyright 2024 ForgeFlow (https://www.camptocamp.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
+import functools
+
from odoo import models
from odoo.addons.queue_job.job import identity_exact
@@ -17,12 +19,13 @@ def _generate_ddmrp_warnings_job_options(self):
}
def _register_hook(self):
- self._patch_method(
+ patched = self._patch_job_auto_delay(
"_generate_ddmrp_warnings",
- self._patch_job_auto_delay(
- "_generate_ddmrp_warnings",
- context_key="auto_delay_ddmrp_generate_ddmrp_warnings",
- ),
+ context_key="auto_delay_ddmrp_generate_ddmrp_warnings",
+ )
+ cls = type(self)
+ cls._generate_ddmrp_warnings = functools.update_wrapper(
+ patched, cls._generate_ddmrp_warnings
)
return super()._register_hook()
diff --git a/ddmrp_warning_as_job/static/description/index.html b/ddmrp_warning_as_job/static/description/index.html
index 80476fa7e..b36aae71f 100644
--- a/ddmrp_warning_as_job/static/description/index.html
+++ b/ddmrp_warning_as_job/static/description/index.html
@@ -3,15 +3,16 @@
-DDMRP Warning as job
+README.rst
-
-
DDMRP Warning as job
+
+
+
+
+
+
+
DDMRP Warning as job
-

+

DDMRP Warning calculations are now run with Queue Jobs.
The <stock.buffer>._generate_ddmrp_warnings method is automatically
delayed when the context contains
@@ -386,36 +392,39 @@
DDMRP Warning as job
-
+
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.
+
feedback.
Do not contact contributors directly about support or help with technical issues.
-
+
-
+
This module is maintained by the OCA.
-

+
+
+
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/ddmrp project on GitHub.
+
This module is part of the OCA/ddmrp project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
+