From 3987020628846e2ff79e553b5cb944de91a87b14 Mon Sep 17 00:00:00 2001 From: oca-git-bot Date: Sat, 28 Oct 2023 00:02:23 +0200 Subject: [PATCH 1/8] [IMP] update dotfiles --- .copier-answers.yml | 6 ++---- .eslintrc.yml | 1 + .github/workflows/pre-commit.yml | 16 ++++++++++++++++ .github/workflows/test.yml | 6 +++--- .pre-commit-config.yaml | 18 ++++++++++++++++-- 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 0865beba3d..747fc5b01d 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,8 +1,7 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.14.2 +_commit: v1.17.2 _src_path: gh:oca/oca-addons-repo-template ci: GitHub -dependency_installation_mode: PIP generate_requirements_txt: true github_check_license: true github_ci_extra_env: {} @@ -11,6 +10,7 @@ github_enable_makepot: true github_enable_stale_action: true github_enforce_dev_status_compatibility: true include_wkhtmltopdf: false +odoo_test_flavor: Both odoo_version: 15.0 org_name: Odoo Community Association (OCA) org_slug: OCA @@ -19,6 +19,4 @@ repo_description: 'TODO: add repo description.' repo_name: field-service repo_slug: field-service repo_website: https://github.com/OCA/field-service -travis_apt_packages: [] -travis_apt_sources: [] diff --git a/.eslintrc.yml b/.eslintrc.yml index 9429bc688a..fed88d70d2 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -22,6 +22,7 @@ globals: odoo: readonly openerp: readonly owl: readonly + luxon: readonly # Styling is handled by Prettier, so we only need to enable AST rules; # see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 516b1c4096..2f527dc740 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,10 +13,17 @@ jobs: pre-commit: runs-on: ubuntu-22.04 steps: +<<<<<<< before updating - uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: python-version: '3.10' +======= + - uses: actions/checkout@v3 + - uses: actions/setup-python@v2 + with: + python-version: "3.11" +>>>>>>> after updating - name: Get python version run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - uses: actions/cache@v1 @@ -27,6 +34,15 @@ jobs: run: pip install pre-commit - name: Run pre-commit run: pre-commit run --all-files --show-diff-on-failure --color=always + env: + # Consider valid a PR that changes README fragments but doesn't + # change the README.rst file itself. It's not really a problem + # because the bot will update it anyway after merge. This way, we + # lower the barrier for functional contributors that want to fix the + # readme fragments, while still letting developers get README + # auto-generated (which also helps functionals when using runboat). + # DOCS https://pre-commit.com/#temporarily-disabling-hooks + SKIP: oca-gen-addon-readme - name: Check that all files generated by pre-commit are in git run: | newfiles="$(git ls-files --others --exclude-from=.gitignore)" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7fc809fb42..5c07e37d08 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest name: Detect unreleased dependencies steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | for reqfile in requirements.txt test-requirements.txt ; do if [ -f ${reqfile} ] ; then @@ -36,10 +36,10 @@ jobs: matrix: include: - container: ghcr.io/oca/oca-ci/py3.8-odoo15.0:latest - makepot: "true" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.8-ocb15.0:latest name: test with OCB + makepot: "true" services: postgres: image: postgres:9.6 @@ -50,7 +50,7 @@ jobs: ports: - 5432:5432 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: persist-credentials: false - name: Install addons and dependencies diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a2abffab23..f4e67f7206 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,8 @@ exclude: | /static/(src/)?lib/| # Repos using Sphinx to generate docs don't need prettying ^docs/_templates/.*\.html$| + # Don't bother non-technical authors with formatting issues in docs + readme/.*\.(rst|md)$| # You don't usually want a bot to modify your legal texts (LICENSE.*|COPYING.*) default_language_version: @@ -33,12 +35,24 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/oca/maintainer-tools - rev: dfba427ba03900b69e0a7f2c65890dc48921d36a + rev: 969238e47c07d0c40573acff81d170f63245d738 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons - id: oca-fix-manifest-website args: ["https://github.com/OCA/field-service"] + - id: oca-gen-addon-readme + args: + - --addons-dir=. + - --branch=15.0 + - --org-name=OCA + - --repo-name=field-service + - --if-source-changed + - repo: https://github.com/OCA/odoo-pre-commit-hooks + rev: v0.0.25 + hooks: + - id: oca-checks-odoo-module + - id: oca-checks-po - repo: https://github.com/myint/autoflake rev: v1.4 hooks: @@ -125,7 +139,7 @@ repos: name: flake8 additional_dependencies: ["flake8-bugbear==21.9.2"] - repo: https://github.com/OCA/pylint-odoo - rev: 7.0.2 + rev: 7.0.5 hooks: - id: pylint_odoo name: pylint with optional checks From 84c95fdc194681eeeb3ba848e228098a6e89937b Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 28 Oct 2023 01:37:27 +0000 Subject: [PATCH 2/8] [UPD] Update fieldservice.pot --- fieldservice/i18n/fieldservice.pot | 90 ------------------------------ 1 file changed, 90 deletions(-) diff --git a/fieldservice/i18n/fieldservice.pot b/fieldservice/i18n/fieldservice.pot index 602c4f1485..4fa27721a6 100644 --- a/fieldservice/i18n/fieldservice.pot +++ b/fieldservice/i18n/fieldservice.pot @@ -228,12 +228,6 @@ msgstr "" msgid "Add a description..." msgstr "" -#. module: fieldservice -#: model:ir.model.fields,field_description:fieldservice.field_fsm_location__additional_info -#: model:ir.model.fields,field_description:fieldservice.field_fsm_person__additional_info -msgid "Additional info" -msgstr "" - #. module: fieldservice #: model_terms:ir.ui.view,arch_db:fieldservice.fsm_location_form_view #: model_terms:ir.ui.view,arch_db:fieldservice.fsm_person_form @@ -427,18 +421,6 @@ msgstr "" msgid "Blacklist" msgstr "" -#. module: fieldservice -#: model:ir.model.fields,field_description:fieldservice.field_fsm_location__mobile_blacklisted -#: model:ir.model.fields,field_description:fieldservice.field_fsm_person__mobile_blacklisted -msgid "Blacklisted Phone Is Mobile" -msgstr "" - -#. module: fieldservice -#: model:ir.model.fields,field_description:fieldservice.field_fsm_location__phone_blacklisted -#: model:ir.model.fields,field_description:fieldservice.field_fsm_person__phone_blacklisted -msgid "Blacklisted Phone is Phone" -msgstr "" - #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__message_bounce #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__message_bounce @@ -656,12 +638,6 @@ msgstr "" msgid "Company Type" msgstr "" -#. module: fieldservice -#: model:ir.model.fields,field_description:fieldservice.field_fsm_location__partner_gid -#: model:ir.model.fields,field_description:fieldservice.field_fsm_person__partner_gid -msgid "Company database ID" -msgstr "" - #. module: fieldservice #: model:ir.model.fields,help:fieldservice.field_fsm_category__company_id msgid "Company related to this category" @@ -1270,14 +1246,6 @@ msgstr "" msgid "Field Service Workers" msgstr "" -#. module: fieldservice -#: model:ir.model.fields,help:fieldservice.field_fsm_location__phone_sanitized -#: model:ir.model.fields,help:fieldservice.field_fsm_person__phone_sanitized -msgid "" -"Field used to store sanitized phone number. Helps speeding up searches and " -"comparisons." -msgstr "" - #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__property_account_position_id #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__property_account_position_id @@ -1493,15 +1461,10 @@ msgstr "" #. module: fieldservice #: model:ir.model.fields,help:fieldservice.field_fsm_equipment__message_has_error -#: model:ir.model.fields,help:fieldservice.field_fsm_equipment__message_has_sms_error #: model:ir.model.fields,help:fieldservice.field_fsm_location__message_has_error -#: model:ir.model.fields,help:fieldservice.field_fsm_location__message_has_sms_error #: model:ir.model.fields,help:fieldservice.field_fsm_order__message_has_error -#: model:ir.model.fields,help:fieldservice.field_fsm_order__message_has_sms_error #: model:ir.model.fields,help:fieldservice.field_fsm_person__message_has_error -#: model:ir.model.fields,help:fieldservice.field_fsm_person__message_has_sms_error #: model:ir.model.fields,help:fieldservice.field_fsm_team__message_has_error -#: model:ir.model.fields,help:fieldservice.field_fsm_team__message_has_sms_error msgid "If checked, some messages have a delivery error." msgstr "" @@ -1521,14 +1484,6 @@ msgid "" "mailing anymore, from any list" msgstr "" -#. module: fieldservice -#: model:ir.model.fields,help:fieldservice.field_fsm_location__phone_sanitized_blacklisted -#: model:ir.model.fields,help:fieldservice.field_fsm_person__phone_sanitized_blacklisted -msgid "" -"If the sanitized phone number is on the blacklist, the contact won't receive" -" mass mailing sms anymore, from any list" -msgstr "" - #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__image_1920 #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__image_1920 @@ -1559,24 +1514,6 @@ msgstr "" msgid "Image 512" msgstr "" -#. module: fieldservice -#: model:ir.model.fields,help:fieldservice.field_fsm_location__mobile_blacklisted -#: model:ir.model.fields,help:fieldservice.field_fsm_person__mobile_blacklisted -msgid "" -"Indicates if a blacklisted sanitized phone number is a mobile number. Helps " -"distinguish which number is blacklisted when there is both a " -"mobile and phone field in a model." -msgstr "" - -#. module: fieldservice -#: model:ir.model.fields,help:fieldservice.field_fsm_location__phone_blacklisted -#: model:ir.model.fields,help:fieldservice.field_fsm_person__phone_blacklisted -msgid "" -"Indicates if a blacklisted sanitized phone number is a phone number. Helps " -"distinguish which number is blacklisted when there is both a " -"mobile and phone field in a model." -msgstr "" - #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__industry_id #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__industry_id @@ -2616,18 +2553,6 @@ msgstr "" msgid "Phone" msgstr "" -#. module: fieldservice -#: model:ir.model.fields,field_description:fieldservice.field_fsm_location__phone_sanitized_blacklisted -#: model:ir.model.fields,field_description:fieldservice.field_fsm_person__phone_sanitized_blacklisted -msgid "Phone Blacklisted" -msgstr "" - -#. module: fieldservice -#: model:ir.model.fields,field_description:fieldservice.field_fsm_location__phone_mobile_search -#: model:ir.model.fields,field_description:fieldservice.field_fsm_person__phone_mobile_search -msgid "Phone/Mobile" -msgstr "" - #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__plan_to_change_bike #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__plan_to_change_bike @@ -2843,15 +2768,6 @@ msgstr "" msgid "Routes" msgstr "" -#. module: fieldservice -#: model:ir.model.fields,field_description:fieldservice.field_fsm_equipment__message_has_sms_error -#: model:ir.model.fields,field_description:fieldservice.field_fsm_location__message_has_sms_error -#: model:ir.model.fields,field_description:fieldservice.field_fsm_order__message_has_sms_error -#: model:ir.model.fields,field_description:fieldservice.field_fsm_person__message_has_sms_error -#: model:ir.model.fields,field_description:fieldservice.field_fsm_team__message_has_sms_error -msgid "SMS Delivery error" -msgstr "" - #. module: fieldservice #: model:ir.model.fields,field_description:fieldservice.field_fsm_location__sale_order_count #: model:ir.model.fields,field_description:fieldservice.field_fsm_person__sale_order_count @@ -2882,12 +2798,6 @@ msgstr "" msgid "Salesperson" msgstr "" -#. module: fieldservice -#: model:ir.model.fields,field_description:fieldservice.field_fsm_location__phone_sanitized -#: model:ir.model.fields,field_description:fieldservice.field_fsm_person__phone_sanitized -msgid "Sanitized Number" -msgstr "" - #. module: fieldservice #: model_terms:ir.ui.view,arch_db:fieldservice.fsm_order_form msgid "Schedule Details" From 9b93b61c3a319c70d1ab63933e7bef07615ae551 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 28 Oct 2023 01:37:27 +0000 Subject: [PATCH 3/8] [UPD] Update fieldservice_change_management.pot --- .../i18n/fieldservice_change_management.pot | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fieldservice_change_management/i18n/fieldservice_change_management.pot b/fieldservice_change_management/i18n/fieldservice_change_management.pot index 98e4b9df97..64fd56d821 100644 --- a/fieldservice_change_management/i18n/fieldservice_change_management.pot +++ b/fieldservice_change_management/i18n/fieldservice_change_management.pot @@ -266,7 +266,6 @@ msgstr "" #. module: fieldservice_change_management #: model:ir.model.fields,help:fieldservice_change_management.field_change_log__message_has_error -#: model:ir.model.fields,help:fieldservice_change_management.field_change_log__message_has_sms_error msgid "If checked, some messages have a delivery error." msgstr "" @@ -424,11 +423,6 @@ msgstr "" msgid "Responsible User" msgstr "" -#. module: fieldservice_change_management -#: model:ir.model.fields,field_description:fieldservice_change_management.field_change_log__message_has_sms_error -msgid "SMS Delivery error" -msgstr "" - #. module: fieldservice_change_management #: model:ir.model.fields,help:fieldservice_change_management.field_change_log__stage_id msgid "Select the current stage of the Bandwidth Change." From aae1c80703c080192f80e163cbacc8a86907d01f Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 28 Oct 2023 01:37:31 +0000 Subject: [PATCH 4/8] [UPD] Update fieldservice_fleet.pot --- fieldservice_fleet/i18n/fieldservice_fleet.pot | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/fieldservice_fleet/i18n/fieldservice_fleet.pot b/fieldservice_fleet/i18n/fieldservice_fleet.pot index a808651c9f..f46fed96a1 100644 --- a/fieldservice_fleet/i18n/fieldservice_fleet.pot +++ b/fieldservice_fleet/i18n/fieldservice_fleet.pot @@ -89,6 +89,11 @@ msgstr "" msgid "CO2 Emissions" msgstr "" +#. module: fieldservice_fleet +#: model:ir.model.fields,field_description:fieldservice_fleet.field_fsm_vehicle__co2_standard +msgid "CO2 Standard" +msgstr "" + #. module: fieldservice_fleet #: model:ir.model.fields,help:fieldservice_fleet.field_fsm_vehicle__co2 msgid "CO2 emissions of the vehicle" @@ -109,11 +114,6 @@ msgstr "" msgid "Chassis Number" msgstr "" -#. module: fieldservice_fleet -#: model:ir.model.fields,field_description:fieldservice_fleet.field_fsm_vehicle__co2_standard -msgid "Co2 Standard" -msgstr "" - #. module: fieldservice_fleet #: model:ir.model.fields,field_description:fieldservice_fleet.field_fsm_vehicle__color msgid "Color" @@ -357,7 +357,6 @@ msgstr "" #. module: fieldservice_fleet #: model:ir.model.fields,help:fieldservice_fleet.field_fsm_vehicle__message_has_error -#: model:ir.model.fields,help:fieldservice_fleet.field_fsm_vehicle__message_has_sms_error msgid "If checked, some messages have a delivery error." msgstr "" @@ -592,11 +591,6 @@ msgstr "" msgid "Responsible User" msgstr "" -#. module: fieldservice_fleet -#: model:ir.model.fields,field_description:fieldservice_fleet.field_fsm_vehicle__message_has_sms_error -msgid "SMS Delivery error" -msgstr "" - #. module: fieldservice_fleet #: model:ir.model.fields,field_description:fieldservice_fleet.field_fsm_vehicle__seats msgid "Seats Number" From 55061d240441e386e8659bbdbb03f49df6b4e220 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 28 Oct 2023 01:37:33 +0000 Subject: [PATCH 5/8] [UPD] Update fieldservice_recurring.pot --- .../i18n/fieldservice_recurring.pot | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/fieldservice_recurring/i18n/fieldservice_recurring.pot b/fieldservice_recurring/i18n/fieldservice_recurring.pot index 2600f2e120..dc30a87db3 100644 --- a/fieldservice_recurring/i18n/fieldservice_recurring.pot +++ b/fieldservice_recurring/i18n/fieldservice_recurring.pot @@ -377,13 +377,9 @@ msgstr "" #. module: fieldservice_recurring #: model:ir.model.fields,help:fieldservice_recurring.field_fsm_frequency__message_has_error -#: model:ir.model.fields,help:fieldservice_recurring.field_fsm_frequency__message_has_sms_error #: model:ir.model.fields,help:fieldservice_recurring.field_fsm_frequency_set__message_has_error -#: model:ir.model.fields,help:fieldservice_recurring.field_fsm_frequency_set__message_has_sms_error #: model:ir.model.fields,help:fieldservice_recurring.field_fsm_recurring__message_has_error -#: model:ir.model.fields,help:fieldservice_recurring.field_fsm_recurring__message_has_sms_error #: model:ir.model.fields,help:fieldservice_recurring.field_fsm_recurring_template__message_has_error -#: model:ir.model.fields,help:fieldservice_recurring.field_fsm_recurring_template__message_has_sms_error msgid "If checked, some messages have a delivery error." msgstr "" @@ -687,14 +683,6 @@ msgstr "" msgid "Responsible User" msgstr "" -#. module: fieldservice_recurring -#: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_frequency__message_has_sms_error -#: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_frequency_set__message_has_sms_error -#: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring__message_has_sms_error -#: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_recurring_template__message_has_sms_error -msgid "SMS Delivery error" -msgstr "" - #. module: fieldservice_recurring #: model:ir.model.fields,field_description:fieldservice_recurring.field_fsm_frequency__sa msgid "Saturday" From 472e1b1c958ca432202b15f4b7e15e9815dbac33 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Sat, 28 Oct 2023 14:06:26 +0100 Subject: [PATCH 6/8] [REF] fieldservice_stock: pre-commit fixes --- fieldservice_stock/views/stock_picking.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice_stock/views/stock_picking.xml b/fieldservice_stock/views/stock_picking.xml index dc12a741bf..dab7e9b9ea 100644 --- a/fieldservice_stock/views/stock_picking.xml +++ b/fieldservice_stock/views/stock_picking.xml @@ -18,7 +18,7 @@ - stock.picking.fieldservice.stock.tree + stock.picking.fieldservice.stock.tree stock.picking From ff1f2130289b238cdbdf8f7052f413780f3490e3 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Sat, 28 Oct 2023 14:23:17 +0100 Subject: [PATCH 7/8] [REF] fieldservice_sale_recurring: pre-commit fixes --- .../models/sale_order_line.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/fieldservice_sale_recurring/models/sale_order_line.py b/fieldservice_sale_recurring/models/sale_order_line.py index fb6f930f47..463f414e6f 100644 --- a/fieldservice_sale_recurring/models/sale_order_line.py +++ b/fieldservice_sale_recurring/models/sale_order_line.py @@ -49,18 +49,29 @@ def _field_create_fsm_recurring(self): so_line.write({"fsm_recurring_id": fsm_recurring.id}) # post message on SO msg_body = _( - """Field Service recurring Created ({}): {} + """Field Service recurring Created (%(product)s): %(name)s """ - ).format(so_line.product_id.name, fsm_recurring.id, fsm_recurring.name) + ).format( + { + "product": so_line.product_id.name, + "id": fsm_recurring.id, + "name": fsm_recurring.name, + } + ) so_line.order_id.message_post(body=msg_body) # post message on fsm_recurring fsm_recurring_msg = _( """This recurring has been created from: {} ({}) + # data-oe-model=sale.order data-oe-id=%(order_id)s>%(order)s + (%(product)s) """ ).format( - so_line.order_id.id, so_line.order_id.name, so_line.product_id.name + { + "order_id": so_line.order_id.id, + "order": so_line.order_id.name, + "product": so_line.product_id.name, + } ) fsm_recurring.message_post(body=fsm_recurring_msg) result[so_line.id] = fsm_recurring From c1a74cdb56d8057c876874a9e803c45321397fc4 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 28 Oct 2023 17:15:38 +0000 Subject: [PATCH 8/8] [UPD] Update fieldservice_sale_recurring.pot --- .../i18n/fieldservice_sale_recurring.pot | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fieldservice_sale_recurring/i18n/fieldservice_sale_recurring.pot b/fieldservice_sale_recurring/i18n/fieldservice_sale_recurring.pot index 4556b37575..050fd1e279 100644 --- a/fieldservice_sale_recurring/i18n/fieldservice_sale_recurring.pot +++ b/fieldservice_sale_recurring/i18n/fieldservice_sale_recurring.pot @@ -66,8 +66,8 @@ msgstr "" #: code:addons/fieldservice_sale_recurring/models/sale_order_line.py:0 #, python-format msgid "" -"Field Service recurring Created ({}): {}\n" +"Field Service recurring Created (%(product)s): %(name)s\n" " " msgstr "" @@ -118,6 +118,7 @@ msgstr "" #, python-format msgid "" "This recurring has been created from: {} ({})\n" +" # data-oe-model=sale.order data-oe-id=%(order_id)s>%(order)s\n" +" (%(product)s)\n" " " msgstr ""