From c4a2b6718db137753c47329838e9333b48d0539d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Fri, 20 Nov 2020 15:39:01 +0100 Subject: [PATCH] [IMP] : black, isort, prettier --- .pre-commit-config.yaml | 2 - queue_job/__manifest__.py | 6 +- queue_job/job.py | 2 +- queue_job/models/base.py | 2 +- queue_job/models/queue_job.py | 9 +- queue_job/static/description/icon.svg | 238 +++++++++--------- queue_job_cron/__manifest__.py | 2 +- queue_job_subscribe/__manifest__.py | 2 +- requirements.txt | 2 + setup/queue_job/odoo/addons/queue_job | 1 + setup/queue_job/setup.py | 6 + .../test_queue_job/odoo/addons/test_queue_job | 1 + setup/test_queue_job/setup.py | 6 + test_queue_job/__manifest__.py | 4 +- test_queue_job/models/test_models.py | 4 +- test_queue_job/tests/test_job.py | 6 +- 16 files changed, 162 insertions(+), 131 deletions(-) create mode 100644 requirements.txt create mode 120000 setup/queue_job/odoo/addons/queue_job create mode 100644 setup/queue_job/setup.py create mode 120000 setup/test_queue_job/odoo/addons/test_queue_job create mode 100644 setup/test_queue_job/setup.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 39468209d6..3b2487c16b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,11 +3,9 @@ exclude: | # NOT INSTALLABLE ADDONS ^base_export_async/| ^base_import_async/| - ^queue_job/| ^queue_job_cron/| ^queue_job_subscribe/| ^test_base_import_async/| - ^test_queue_job/| # END NOT INSTALLABLE ADDONS # Files and folders generated by bots, to avoid loops ^setup/|/static/description/index\.html$| diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index 0b1d16e56e..74e70419f7 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -3,9 +3,9 @@ { "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", + "website": "https://github.com/OCA/queue", "license": "LGPL-3", "category": "Generic Modules", "depends": ["mail"], @@ -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/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/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 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, +) diff --git a/setup/test_queue_job/odoo/addons/test_queue_job b/setup/test_queue_job/odoo/addons/test_queue_job new file mode 120000 index 0000000000..0473d5583c --- /dev/null +++ b/setup/test_queue_job/odoo/addons/test_queue_job @@ -0,0 +1 @@ +../../../../test_queue_job \ No newline at end of file diff --git a/setup/test_queue_job/setup.py b/setup/test_queue_job/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/test_queue_job/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/test_queue_job/__manifest__.py b/test_queue_job/__manifest__.py index a09c89b07f..6b4dfa89e5 100644 --- a/test_queue_job/__manifest__.py +++ b/test_queue_job/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Queue Job Tests", - "version": "13.0.2.1.0", + "version": "14.0.1.0.0", "author": "Camptocamp,Odoo Community Association (OCA)", "license": "LGPL-3", "category": "Generic Modules", @@ -14,5 +14,5 @@ "data/queue_job_function_data.xml", "security/ir.model.access.csv", ], - "installable": False, + "installable": True, } diff --git a/test_queue_job/models/test_models.py b/test_queue_job/models/test_models.py index 36fdb1c6f9..9d5e4fc457 100644 --- a/test_queue_job/models/test_models.py +++ b/test_queue_job/models/test_models.py @@ -34,7 +34,7 @@ class TestQueueJob(models.Model): name = fields.Char() def testing_method(self, *args, **kwargs): - """ Method used for tests + """Method used for tests Return always the arguments and keyword arguments received """ @@ -79,7 +79,7 @@ def job_sub_channel(self): # TODO deprecated by :job-no-decorator: @property def dummy_property(self): - """ Return foo + """Return foo Only there to check that properties are compatible with the automatic registration of job methods diff --git a/test_queue_job/tests/test_job.py b/test_queue_job/tests/test_job.py index f9b679cc27..83222f1af8 100644 --- a/test_queue_job/tests/test_job.py +++ b/test_queue_job/tests/test_job.py @@ -327,7 +327,7 @@ class TestJobs(JobCommonCase): """ Test jobs on other methods or with different job configuration """ def test_description(self): - """ If no description is given to the job, it + """If no description is given to the job, it should be computed from the function """ # if a docstring is defined for the function @@ -610,8 +610,8 @@ def test_job_default_company_id(self): ) def test_job_no_company_id(self): - """ if we put an empty company_id in the context - jobs are created without company_id + """if we put an empty company_id in the context + jobs are created without company_id """ env = self.env(context={"company_id": None}) stored = self._create_job(env)