From c571c0c72d97f4eb7481d42fe8892c00a95e9c83 Mon Sep 17 00:00:00 2001 From: Vildan Safin Date: Fri, 8 May 2020 20:14:30 +0500 Subject: [PATCH] :bomb: Deleted unnecessary method and added website_sale dependence --- saas_apps/__manifest__.py | 2 +- saas_apps/controllers/main.py | 1 - saas_apps/models/saas_apps.py | 11 ----------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/saas_apps/__manifest__.py b/saas_apps/__manifest__.py index 41c54242f..aa5bd5a86 100644 --- a/saas_apps/__manifest__.py +++ b/saas_apps/__manifest__.py @@ -17,7 +17,7 @@ # "price": 9.00, # "currency": "EUR", - "depends": ['website', 'saas_public'], + "depends": ['website', 'saas_public', 'website_sale'], "external_dependencies": {"python": [], "bin": []}, "data": [ 'security/ir.model.access.csv', diff --git a/saas_apps/controllers/main.py b/saas_apps/controllers/main.py index 5128aee26..f7e88e989 100644 --- a/saas_apps/controllers/main.py +++ b/saas_apps/controllers/main.py @@ -15,7 +15,6 @@ class SaaSAppsController(Controller): def user_page(self, **kw): apps = request.env['saas.line'].sudo() packages = request.env['saas.template'].sudo() - apps.delete_app_duplicates() if not apps.search_count([]): apps.refresh_lines() return request.render('saas_apps.index', { diff --git a/saas_apps/models/saas_apps.py b/saas_apps/models/saas_apps.py index 1dad91965..7bcd04741 100644 --- a/saas_apps/models/saas_apps.py +++ b/saas_apps/models/saas_apps.py @@ -119,17 +119,6 @@ def make_product(self, app): 'image_1920': app.app_image }) - def delete_app_duplicates(self): - apps = self.search([('application', '=', True)]) - prod_templ = self.env["product.product"] - for app in apps: - products = prod_templ.search([('name', '=', app.module_name)]) - if products > 1: - for product in products - products[0]: - product.unlink() - for extra in app - app[0]: - extra.unlink() - def change_product_price(self, app, price): app.product_id.price = price