From ca3cd34c78ad3cc3239d5d174f8c1e56c1734f19 Mon Sep 17 00:00:00 2001 From: Eduard Brahas Date: Wed, 4 Sep 2024 17:18:50 +0200 Subject: [PATCH 1/2] [FIX]sale_coupon_delivery_auto_refresh: set context only for coupons --- sale_coupon_delivery_auto_refresh/README.rst | 1 + .../models/sale_order.py | 4 +--- .../readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 14 ++++++++----- .../test_sale_coupon_delivery_auto_refresh.py | 21 ++++++++----------- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/sale_coupon_delivery_auto_refresh/README.rst b/sale_coupon_delivery_auto_refresh/README.rst index 733e58fbe..8798ac798 100644 --- a/sale_coupon_delivery_auto_refresh/README.rst +++ b/sale_coupon_delivery_auto_refresh/README.rst @@ -84,6 +84,7 @@ Contributors ~~~~~~~~~~~~ * Ooops404 + * Eduard Brahas * Cetmix Maintainers diff --git a/sale_coupon_delivery_auto_refresh/models/sale_order.py b/sale_coupon_delivery_auto_refresh/models/sale_order.py index 70ab796c5..63b3335bf 100644 --- a/sale_coupon_delivery_auto_refresh/models/sale_order.py +++ b/sale_coupon_delivery_auto_refresh/models/sale_order.py @@ -9,9 +9,7 @@ def _auto_refresh_delivery(self): Override to change context value to refresh coupons after creation delivery line """ - self = self.with_context( - skip_auto_refresh_coupons=False, auto_refresh_delivery=True - ) + self = self.with_context(skip_auto_refresh_coupons=False) return super(SaleOrder, self)._auto_refresh_delivery() def _create_delivery_line(self, carrier, price_unit): diff --git a/sale_coupon_delivery_auto_refresh/readme/CONTRIBUTORS.rst b/sale_coupon_delivery_auto_refresh/readme/CONTRIBUTORS.rst index a3385a623..5d2b7adc9 100644 --- a/sale_coupon_delivery_auto_refresh/readme/CONTRIBUTORS.rst +++ b/sale_coupon_delivery_auto_refresh/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Ooops404 + * Eduard Brahas * Cetmix diff --git a/sale_coupon_delivery_auto_refresh/static/description/index.html b/sale_coupon_delivery_auto_refresh/static/description/index.html index 1ec84312e..c71dad06f 100644 --- a/sale_coupon_delivery_auto_refresh/static/description/index.html +++ b/sale_coupon_delivery_auto_refresh/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 { @@ -429,14 +430,17 @@

Authors

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.

diff --git a/sale_coupon_delivery_auto_refresh/tests/test_sale_coupon_delivery_auto_refresh.py b/sale_coupon_delivery_auto_refresh/tests/test_sale_coupon_delivery_auto_refresh.py index 7a9ea83d7..1c5b96924 100644 --- a/sale_coupon_delivery_auto_refresh/tests/test_sale_coupon_delivery_auto_refresh.py +++ b/sale_coupon_delivery_auto_refresh/tests/test_sale_coupon_delivery_auto_refresh.py @@ -29,18 +29,15 @@ def setUpClass(cls): "property_product_pricelist": pricelist.id, } ) - cls.env["ir.config_parameter"].sudo().set_param( - "delivery_auto_refresh.set_default_carrier", 1 - ) - cls.env["ir.config_parameter"].sudo().set_param( - "delivery_auto_refresh.auto_void_delivery_line", 1 - ) - cls.env["ir.config_parameter"].sudo().set_param( - "delivery_auto_refresh.refresh_after_picking", 1 - ) - cls.env["ir.config_parameter"].sudo().set_param( - "delivery_auto_refresh.auto_add_delivery_line", 1 - ) + cls.env["res.config.settings"].create( + { + "sale_auto_assign_carrier_on_create": True, + "sale_auto_add_delivery_line": True, + "sale_refresh_delivery_after_picking": True, + "sale_auto_void_delivery_line": True, + } + ).execute() + coupon_program_form = Form( cls.env["coupon.program"], view="sale_coupon.sale_coupon_program_view_promo_program_form", From 77b5b0032c41b6a51cd8a76970984c63008fdcf4 Mon Sep 17 00:00:00 2001 From: Eduard Brahas Date: Mon, 9 Sep 2024 11:17:55 +0200 Subject: [PATCH 2/2] [DON'T MERGE] test-requirements.txt --- test-requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test-requirements.txt diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..f76e67d6a --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ + odoo14-addon-delivery_auto_refresh @ git+https://github.com/OCA/delivery-carrier.git@refs/pull/849/head#subdirectory=setup/delivery_auto_refresh