From 1e21b79febaec0198899d5dfe38c3f2d54fb163b Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Thu, 17 May 2018 14:41:24 -0700 Subject: [PATCH] [FIX] website_quote: install sale_payment together with website_quote Stable version of 65a589eb54a1421baa71074701bea2873a83c75f (reverted at 935043dda123a030130571a2a4bb45b2b13f145c) that doesn't cause the following errors: odoo.modules.graph: module website_quote: Unmet dependencies: sale_payment on existing databases without sale_payment installed. A downside of this approach is that sale_payment can be uninstalled without uninstalling website_quote. Adding an uninstall_hook to sale_payment could solve that, but it wouldn't warn the user website_quote would be removed in the "Uninstall module" wizard. Keeping in mind this is only a temporary hack for stable, keeping sale_payment installed in this case shouldn't cause any issues. opw-1847977 --- addons/website_quote/__init__.py | 9 +++++++++ addons/website_quote/__manifest__.py | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/addons/website_quote/__init__.py b/addons/website_quote/__init__.py index 7d34c7c054a..ea016ede098 100644 --- a/addons/website_quote/__init__.py +++ b/addons/website_quote/__init__.py @@ -3,3 +3,12 @@ from . import controllers from . import models + +from odoo.api import Environment, SUPERUSER_ID + +def _install_sale_payment(cr, registry): + env = Environment(cr, SUPERUSER_ID, {}) + env['ir.module.module'].search([ + ('name', '=', 'sale_payment'), + ('state', '=', 'uninstalled'), + ]).button_install() diff --git a/addons/website_quote/__manifest__.py b/addons/website_quote/__manifest__.py index e6a0a1c274f..74d1de6dfcd 100644 --- a/addons/website_quote/__manifest__.py +++ b/addons/website_quote/__manifest__.py @@ -24,4 +24,8 @@ ], 'qweb': ['static/src/xml/*.xml'], 'installable': True, + + # needed because dependencies can't be changed in a stable version + # TODO in master: add sale_payment to depends and remove this + 'post_init_hook': '_install_sale_payment', }