From b44e26bc53f9f331701d1fe11cc42a76b2393030 Mon Sep 17 00:00:00 2001 From: Matias Peralta Date: Tue, 15 Oct 2024 11:26:03 -0300 Subject: [PATCH] [MIG] sale_exception: Migration to 18.0 --- sale_exception/README.rst | 10 +++++----- sale_exception/__manifest__.py | 2 +- sale_exception/data/sale_exception_data.xml | 2 -- sale_exception/models/sale_order_line.py | 13 ++++++------- sale_exception/static/description/index.html | 17 ++++++++++------- sale_exception/tests/test_sale_exception.py | 2 +- sale_exception/views/sale_view.xml | 8 ++++---- .../wizard/sale_exception_confirm_view.xml | 4 ++-- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sale_exception/README.rst b/sale_exception/README.rst index 3ef4f9f0aa5..055883078dd 100644 --- a/sale_exception/README.rst +++ b/sale_exception/README.rst @@ -17,13 +17,13 @@ Sale Exception :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github - :target: https://github.com/OCA/sale-workflow/tree/17.0/sale_exception + :target: https://github.com/OCA/sale-workflow/tree/18.0/sale_exception :alt: OCA/sale-workflow .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_exception + :target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_exception :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/sale-workflow&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -84,7 +84,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. @@ -127,6 +127,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/sale-workflow `_ project on GitHub. +This module is part of the `OCA/sale-workflow `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_exception/__manifest__.py b/sale_exception/__manifest__.py index da04e0db506..c7e98249a09 100644 --- a/sale_exception/__manifest__.py +++ b/sale_exception/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Sale Exception", "summary": "Custom exceptions on sale order", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "category": "Generic Modules/Sale", "author": "Akretion, " "Sodexis, " diff --git a/sale_exception/data/sale_exception_data.xml b/sale_exception/data/sale_exception_data.xml index cc17cd63349..98aa2a839d4 100644 --- a/sale_exception/data/sale_exception_data.xml +++ b/sale_exception/data/sale_exception_data.xml @@ -7,8 +7,6 @@ 20 minutes - -1 - code model.test_all_draft_orders() diff --git a/sale_exception/models/sale_order_line.py b/sale_exception/models/sale_order_line.py index 20dc90ec917..bf9f9ac1aba 100644 --- a/sale_exception/models/sale_order_line.py +++ b/sale_exception/models/sale_order_line.py @@ -37,12 +37,11 @@ def _compute_exceptions_summary(self): rec.exceptions_summary = False def _get_exception_summary(self): - return "
    %s
" % "".join( - [ - f"
  • {html.escape(e.name)}: {html.escape(e.description)}
  • " - for e in self.exception_ids - ] + items = "".join( + f"
  • {html.escape(e.name)}: {html.escape(e.description)}
  • " + for e in self.exception_ids ) + return f"
      {items}
    " def _get_main_records(self): return self.mapped("order_id") @@ -56,6 +55,6 @@ def _detect_exceptions(self, rule): # Thanks to the new flush of odoo 13.0, queries will be optimized # together at the end even if we update the exception_ids many times. # On previous versions, this could be unoptimized. - (self - records).exception_ids = [(3, rule.id)] - records.exception_ids = [(4, rule.id)] + (self - records).exception_ids = [fields.Command.delete(rule.id)] + records.exception_ids = [fields.Command.set(rule.id)] return records.mapped("order_id") diff --git a/sale_exception/static/description/index.html b/sale_exception/static/description/index.html index bf1f879935e..8f0a242a756 100644 --- a/sale_exception/static/description/index.html +++ b/sale_exception/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,7 +369,7 @@

    Sale Exception

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:02cf45502a42ed74a7de2eeb75f68950616d8d807656bff404181daeb39b6558 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

    +

    Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

    This module allows you attach several customizable exceptions to your sale order in a way that you can filter orders by exceptions type and fix them.

    @@ -427,7 +428,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.

    @@ -460,11 +461,13 @@

    Contributors

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    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/sale-workflow project on GitHub.

    +

    This module is part of the OCA/sale-workflow project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/sale_exception/tests/test_sale_exception.py b/sale_exception/tests/test_sale_exception.py index aeb402bcc70..cd3a979fcb6 100644 --- a/sale_exception/tests/test_sale_exception.py +++ b/sale_exception/tests/test_sale_exception.py @@ -133,7 +133,7 @@ def test_sale_order_exception(self): # Simulation the opening of the wizard sale_exception_confirm and # set ignore_exception to True so_except_confirm = self.sale_exception_confirm.with_context( - **{"active_id": so1.id, "active_ids": [so1.id], "active_model": so1._name} + active_id=so1.id, active_ids=so1.ids, active_model=so1._name ).create({"ignore": True}) so_except_confirm.action_confirm() self.assertTrue(so1.ignore_exception) diff --git a/sale_exception/views/sale_view.xml b/sale_exception/views/sale_view.xml index aea095d6b1c..7f3f2ada7c7 100644 --- a/sale_exception/views/sale_view.xml +++ b/sale_exception/views/sale_view.xml @@ -4,8 +4,8 @@ Sale Exception Rules exception.rule - tree,form - + list,form + [('model', 'in', ['sale.order', 'sale.order.line'])] @@ -64,10 +64,10 @@ - + - + is_exception_danger diff --git a/sale_exception/wizard/sale_exception_confirm_view.xml b/sale_exception/wizard/sale_exception_confirm_view.xml index cd480c0c491..95ea07b7033 100644 --- a/sale_exception/wizard/sale_exception_confirm_view.xml +++ b/sale_exception/wizard/sale_exception_confirm_view.xml @@ -8,10 +8,10 @@
    - + - +