From 0bdfc5739bc6419373d2f5c24a58c8a0067db091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Fri, 20 Nov 2020 15:03:38 +0100 Subject: [PATCH 1/6] [MIG] init V14 repo - set module uninstallable - add new .dot file config for v14 --- README.md | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/README.md b/README.md index 69007fa806..4ddc34540f 100644 --- a/README.md +++ b/README.md @@ -15,17 +15,7 @@ TODO: add repo description. [//]: # (addons) -Unported addons ---------------- -addon | version | summary ---- | --- | --- -[base_export_async](base_export_async/) | 12.0.1.0.0 (unported) | Asynchronous export with job queue -[base_import_async](base_import_async/) | 13.0.2.0.0 (unported) | Import CSV files in the background -[queue_job](queue_job/) | 13.0.3.2.0 (unported) | Job Queue -[queue_job_cron](queue_job_cron/) | 13.0.2.1.0 (unported) | Scheduled Actions as Queue Jobs -[queue_job_subscribe](queue_job_subscribe/) | 13.0.1.0.0 (unported) | Control which users are subscribed to queue job notifications -[test_base_import_async](test_base_import_async/) | 13.0.1.0.0 (unported) | Test suite for base_import_async. Normally you don't need to install this. -[test_queue_job](test_queue_job/) | 13.0.2.1.0 (unported) | Queue Job Tests +This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools. [//]: # (end addons) From 0fd7f4c077f46f6ddd4a99885c8285dfbe7f48b8 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 20 Nov 2020 14:09:53 +0000 Subject: [PATCH 2/6] [UPD] addons table in README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ddc34540f..69007fa806 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,17 @@ TODO: add repo description. [//]: # (addons) -This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools. +Unported addons +--------------- +addon | version | summary +--- | --- | --- +[base_export_async](base_export_async/) | 12.0.1.0.0 (unported) | Asynchronous export with job queue +[base_import_async](base_import_async/) | 13.0.2.0.0 (unported) | Import CSV files in the background +[queue_job](queue_job/) | 13.0.3.2.0 (unported) | Job Queue +[queue_job_cron](queue_job_cron/) | 13.0.2.1.0 (unported) | Scheduled Actions as Queue Jobs +[queue_job_subscribe](queue_job_subscribe/) | 13.0.1.0.0 (unported) | Control which users are subscribed to queue job notifications +[test_base_import_async](test_base_import_async/) | 13.0.1.0.0 (unported) | Test suite for base_import_async. Normally you don't need to install this. +[test_queue_job](test_queue_job/) | 13.0.2.1.0 (unported) | Queue Job Tests [//]: # (end addons) From 085045052801211f782bf0497b245eefc9d33598 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Sat, 28 Nov 2020 09:56:09 -0500 Subject: [PATCH 3/6] [IMP] queue_job: black, isort, prettier --- .pre-commit-config.yaml | 1 - queue_job/job.py | 2 +- queue_job/models/base.py | 2 +- queue_job/models/queue_job.py | 9 +++++++-- setup/queue_job/odoo/addons/queue_job | 1 + setup/queue_job/setup.py | 6 ++++++ 6 files changed, 16 insertions(+), 5 deletions(-) create mode 120000 setup/queue_job/odoo/addons/queue_job create mode 100644 setup/queue_job/setup.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 39468209d6..a5cd155790 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,6 @@ exclude: | # NOT INSTALLABLE ADDONS ^base_export_async/| ^base_import_async/| - ^queue_job/| ^queue_job_cron/| ^queue_job_subscribe/| ^test_base_import_async/| diff --git a/queue_job/job.py b/queue_job/job.py index 568808c002..36c2645520 100644 --- a/queue_job/job.py +++ b/queue_job/job.py @@ -392,7 +392,7 @@ def __init__( channel=None, identity_key=None, ): - """ Create a Job + """Create a Job :param func: function to execute :type func: function diff --git a/queue_job/models/base.py b/queue_job/models/base.py index 3bb4d78361..961f266cf5 100644 --- a/queue_job/models/base.py +++ b/queue_job/models/base.py @@ -44,7 +44,7 @@ def with_delay( channel=None, identity_key=None, ): - """ Return a ``DelayableRecordset`` + """Return a ``DelayableRecordset`` The returned instance allows to enqueue any method of the recordset's Model. diff --git a/queue_job/models/queue_job.py b/queue_job/models/queue_job.py index 1da0eaf86d..a758f58df0 100644 --- a/queue_job/models/queue_job.py +++ b/queue_job/models/queue_job.py @@ -69,7 +69,9 @@ class QueueJob(models.Model): # actions), can be removed (replaced by "records") in 14.0 record_ids = JobSerialized(compute="_compute_record_ids", base_type=list) records = JobSerialized( - string="Record(s)", readonly=True, base_type=models.BaseModel, + string="Record(s)", + readonly=True, + base_type=models.BaseModel, ) args = JobSerialized(readonly=True, base_type=tuple) kwargs = JobSerialized(readonly=True, base_type=dict) @@ -522,7 +524,10 @@ def _default_channel(self): return self.env.ref("queue_job.channel_root") name = fields.Char( - compute="_compute_name", inverse="_inverse_name", index=True, store=True, + compute="_compute_name", + inverse="_inverse_name", + index=True, + store=True, ) # model and method should be required, but the required flag doesn't diff --git a/setup/queue_job/odoo/addons/queue_job b/setup/queue_job/odoo/addons/queue_job new file mode 120000 index 0000000000..ac796aaa1c --- /dev/null +++ b/setup/queue_job/odoo/addons/queue_job @@ -0,0 +1 @@ +../../../../queue_job \ No newline at end of file diff --git a/setup/queue_job/setup.py b/setup/queue_job/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/queue_job/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From a5a63c157d1e053b987d2a298ec3399b1c4384a5 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Sat, 28 Nov 2020 10:01:46 -0500 Subject: [PATCH 4/6] [MIG] queue_job: Migration to 14.0 --- queue_job/__manifest__.py | 4 ++-- queue_job/models/ir_model_fields.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index 0b1d16e56e..e488ca74f3 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Job Queue", - "version": "13.0.3.2.0", + "version": "14.0.1.0.0", "author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/queue/queue_job", "license": "LGPL-3", @@ -17,7 +17,7 @@ "data/queue_data.xml", "data/queue_job_function_data.xml", ], - "installable": False, + "installable": True, "development_status": "Mature", "maintainers": ["guewen"], "post_init_hook": "post_init_hook", diff --git a/queue_job/models/ir_model_fields.py b/queue_job/models/ir_model_fields.py index 30d48dc236..5e70c05726 100644 --- a/queue_job/models/ir_model_fields.py +++ b/queue_job/models/ir_model_fields.py @@ -7,4 +7,7 @@ class IrModelFields(models.Model): _inherit = "ir.model.fields" - ttype = fields.Selection(selection_add=[("job_serialized", "Job Serialized")]) + ttype = fields.Selection( + selection_add=[("job_serialized", "Job Serialized")], + ondelete={'job_serialized': 'cascade'}, + ) From eebabda077ea1d5e328936bcdfb9a9dd84d66110 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Sat, 28 Nov 2020 10:25:40 -0500 Subject: [PATCH 5/6] [IMP] : pre-commit applied --- queue_job/__manifest__.py | 2 +- queue_job/models/ir_model_fields.py | 2 +- queue_job/static/description/icon.svg | 238 ++++++++++++++------------ queue_job_cron/__manifest__.py | 2 +- queue_job_subscribe/__manifest__.py | 2 +- requirements.txt | 2 + 6 files changed, 131 insertions(+), 117 deletions(-) create mode 100644 requirements.txt diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index e488ca74f3..74e70419f7 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -5,7 +5,7 @@ "name": "Job Queue", "version": "14.0.1.0.0", "author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)", - "website": "https://github.com/OCA/queue/queue_job", + "website": "https://github.com/OCA/queue", "license": "LGPL-3", "category": "Generic Modules", "depends": ["mail"], diff --git a/queue_job/models/ir_model_fields.py b/queue_job/models/ir_model_fields.py index 5e70c05726..5a31fcdc5f 100644 --- a/queue_job/models/ir_model_fields.py +++ b/queue_job/models/ir_model_fields.py @@ -9,5 +9,5 @@ class IrModelFields(models.Model): ttype = fields.Selection( selection_add=[("job_serialized", "Job Serialized")], - ondelete={'job_serialized': 'cascade'}, + ondelete={"job_serialized": "cascade"}, ) diff --git a/queue_job/static/description/icon.svg b/queue_job/static/description/icon.svg index a5fbb71bb6..fd5da3366b 100644 --- a/queue_job/static/description/icon.svg +++ b/queue_job/static/description/icon.svg @@ -1,138 +1,150 @@ - + - - + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + id="svg2" + version="1.1" + inkscape:version="0.92.4 (f8dce91, 2019-08-02)" + width="60" + height="60" + viewBox="0 0 60 60" + sodipodi:docname="icon.svg" + inkscape:export-filename="./icon.png" + inkscape:export-xdpi="192" + inkscape:export-ydpi="192" +> + - + image/svg+xml - + - + + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1052" + id="namedview4" + showgrid="false" + inkscape:zoom="8" + inkscape:cx="20.921984" + inkscape:cy="9.7064211" + inkscape:window-x="1920" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" + showguides="true" + inkscape:guide-bbox="true" + > + position="4.140625,50.300781" + orientation="-0.70710678,0.70710678" + id="guide3348" + inkscape:locked="false" + /> + position="56.476562,43.945312" + orientation="-0.70710678,0.70710678" + id="guide3350" + inkscape:locked="false" + /> + position="0,41.75" + orientation="1,0" + id="guide3360" + inkscape:locked="false" + /> + position="60,60.074219" + orientation="1,0" + id="guide3362" + inkscape:locked="false" + /> + position="0.17578125,60" + orientation="0,1" + id="guide3364" + inkscape:locked="false" + /> + position="58.71196,-0.0055242717" + orientation="0,1" + id="guide3366" + inkscape:locked="false" + /> + position="15.558594,50.5" + orientation="-0.70710678,0.70710678" + id="guide3345" + inkscape:locked="false" + /> + position="56.101563,32.363281" + orientation="-0.70710678,0.70710678" + id="guide3347" + inkscape:locked="false" + /> + position="55.972656,21.027344" + orientation="-0.70710678,0.70710678" + id="guide3349" + inkscape:locked="false" + /> + position="55.863281,9.6914063" + orientation="-0.70710678,0.70710678" + id="guide3351" + inkscape:locked="false" + /> + style="opacity:1;fill:#e74c3c;fill-opacity:1" + id="rect4147" + width="60" + height="60" + x="0" + y="0" + ry="3.5" + /> + style="opacity:1;fill:#000000;fill-opacity:0.39215686" + d="M 4.1318557,9.7144566 0.0078125,13.824141 4.2297534e-4,57.5 c 0,0 0.66042738466,1.160638 1.24957702466,1.75 0.6775221,0.677766 1.6249999,0.750548 1.6249999,0.750548 l 43.2963011,0.0083 9.791208,-9.800508 -4.088791,-7.131947 4.086426,-4.114418 -4.058547,-7.106958 4.016339,-4.017997 -4.036551,-7.171615 4.058726,-4.069362 -40.612885,-6.8632798 -4.011838,4.0145788 z" + id="rect4171" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccscccccccccccc" + /> + id="g4169" + transform="matrix(0.3061173,0,0,0.3061173,-1.0360053,-1.0457906)" + style="fill:#ffffff;stroke:none" + /> + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:FontAwesome;-inkscape-font-specification:FontAwesome;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + x="3.8388314" + y="50.558071" + id="text3352" + > diff --git a/queue_job_cron/__manifest__.py b/queue_job_cron/__manifest__.py index 4379e830f6..24f7e3233f 100644 --- a/queue_job_cron/__manifest__.py +++ b/queue_job_cron/__manifest__.py @@ -5,7 +5,7 @@ "name": "Scheduled Actions as Queue Jobs", "version": "13.0.2.1.0", "author": "ACSONE SA/NV,Odoo Community Association (OCA)", - "website": "https://github.com/OCA/queue/tree/12.0/queue_job_cron", + "website": "https://github.com/OCA/queue", "license": "AGPL-3", "category": "Generic Modules", "depends": ["queue_job"], diff --git a/queue_job_subscribe/__manifest__.py b/queue_job_subscribe/__manifest__.py index 7223a50293..7b6453f193 100644 --- a/queue_job_subscribe/__manifest__.py +++ b/queue_job_subscribe/__manifest__.py @@ -4,7 +4,7 @@ "name": "Queue Job Subscribe", "version": "13.0.1.0.0", "author": "Acsone SA/NV, Odoo Community Association (OCA)", - "website": "https://github.com/OCA/queue_job", + "website": "https://github.com/OCA/queue", "summary": "Control which users are subscribed to queue job notifications", "license": "AGPL-3", "category": "Generic Modules", diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000..b4d39fb9e0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# generated from manifests external_dependencies +requests From d33efd26f7263bbd3c371edf29477ee6281f37df Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Sat, 28 Nov 2020 10:39:42 -0500 Subject: [PATCH 6/6] add access rules --- queue_job/security/ir.model.access.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/queue_job/security/ir.model.access.csv b/queue_job/security/ir.model.access.csv index e90eee9ae4..8c4b798c42 100644 --- a/queue_job/security/ir.model.access.csv +++ b/queue_job/security/ir.model.access.csv @@ -2,3 +2,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_queue_job_manager,queue job manager,queue_job.model_queue_job,queue_job.group_queue_job_manager,1,1,1,1 access_queue_job_function_manager,queue job functions manager,queue_job.model_queue_job_function,queue_job.group_queue_job_manager,1,1,1,1 access_queue_job_channel_manager,queue job channel manager,queue_job.model_queue_job_channel,queue_job.group_queue_job_manager,1,1,1,1 +access_queue_jobs_to_done,access_queue_jobs_to_done,model_queue_jobs_to_done,queue_job.group_queue_job_manager,1,1,1,1 +access_queue_requeue_job,access_queue_requeue_job,model_queue_requeue_job,queue_job.group_queue_job_manager,1,1,1,1