Skip to content

Commit

Permalink
💣 Deleted unnecessary method and added website_sale dependence
Browse files Browse the repository at this point in the history
  • Loading branch information
Enigma228322 committed May 8, 2020
1 parent 1a757b0 commit c571c0c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion saas_apps/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion saas_apps/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
11 changes: 0 additions & 11 deletions saas_apps/models/saas_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c571c0c

Please sign in to comment.