From 7d7e2a1cf46d96614abefd5ea0bc752adf5e339f Mon Sep 17 00:00:00 2001 From: Emilio Pascual Date: Thu, 4 Apr 2024 07:54:19 +0200 Subject: [PATCH] [IMP] delivery: disable only delivery carriers from external providers Only delivery carriers that can communicate with the outside should be deactivated. Every time a database is neutralized, all delivery carriers are deactivated. In staging or test databases this should not be the case, only delivery carriers with an external connection, i.e. delivery carriers with an external provider should be deactivated. Delivery carriers with fixed price or based on rules should not be deactivated with every neutralization. This way Odoo can continue to operate with shipping methods without prejudice to the users in neutralized databases. @moduon MT-5612 closes odoo/odoo#161182 X-original-commit: bdaeae0230fe0da7743f8cc4ed9dcb210b994540 Signed-off-by: Tiffany Chang (tic) --- addons/delivery/data/neutralize.sql | 9 ++++++--- addons/delivery_mondialrelay/data/neutralize.sql | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 addons/delivery_mondialrelay/data/neutralize.sql diff --git a/addons/delivery/data/neutralize.sql b/addons/delivery/data/neutralize.sql index 0aa2776e7eb..d8fedac97dd 100644 --- a/addons/delivery/data/neutralize.sql +++ b/addons/delivery/data/neutralize.sql @@ -1,4 +1,7 @@ --- disable delivery carriers +-- disable prod environment in all delivery carriers UPDATE delivery_carrier - SET prod_environment = false, - active = false; + SET prod_environment = false; +-- disable delivery carriers from external providers +UPDATE delivery_carrier + SET active = false + WHERE delivery_type NOT IN ('fixed', 'base_on_rule'); diff --git a/addons/delivery_mondialrelay/data/neutralize.sql b/addons/delivery_mondialrelay/data/neutralize.sql new file mode 100644 index 00000000000..5218e59e4a2 --- /dev/null +++ b/addons/delivery_mondialrelay/data/neutralize.sql @@ -0,0 +1,3 @@ +-- disable mondialrelay +UPDATE delivery_carrier +SET mondialrelay_brand = 'BDTEST ';