Skip to content

Commit

Permalink
💣 Hide 'Choose your packages' when packages are absent
Browse files Browse the repository at this point in the history
Signed-off-by: Vildan Safin <[email protected]>
  • Loading branch information
Enigma228322 committed May 26, 2020
1 parent 6dc1a72 commit 8f99928
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
4 changes: 0 additions & 4 deletions saas_apps/data/saas_apps_product_user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
<record id="product_user" model="product.template">
<field name="name">User</field>
<field name="price">10</field>
<<<<<<< HEAD
<field file="saas_apps/static/src/img/user.png" name="image" type="base64" />
=======
<field name="website_published">True</field>
<field file="saas_apps/static/src/img/user.png" name="image_1920" type="base64" />
>>>>>>> 1ea9415... :bomb: Now product.product 'website_published' field related to saas.line's 'allow_to_sell' field
</record>
</odoo>
24 changes: 0 additions & 24 deletions saas_apps/models/saas_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,7 @@ def refresh_lines(self):
'app_image': base_icon
})

<<<<<<< HEAD
@api.multi
=======
def delete_shit(self, app_name):
self.env['product.template'].search([('name', '=', app_name)]).unlink()

>>>>>>> 71a60ef... :bomb: Changed product.product model relation to product.template
def make_product(self, app):
prod_templ = self.env["product.template"]
ready_product = prod_templ.search([('name', '=', app.module_name)])
Expand All @@ -120,12 +114,8 @@ def make_product(self, app):
app.product_id += prod_templ.create({
'name': app.module_name,
'price': app.year_price,
<<<<<<< HEAD
'image': app.app_image
=======
'image_1920': app.app_image,
'website_published': True
>>>>>>> 1ea9415... :bomb: Now product.product 'website_published' field related to saas.line's 'allow_to_sell' field
})

def change_product_price(self, app, price):
Expand Down Expand Up @@ -167,15 +157,6 @@ def dependencies_info(self, root):
apps.append(leaf)
return apps

<<<<<<< HEAD
@api.multi
def change_allow_to_sell(self):
this_app = self.dependencies.search([('name', '=', self.name)])
for app in self.dependencies - this_app:
temp_app = self.search([('name', '=', app.name)])
if len(temp_app) > 0:
temp_app.allow_to_sell = True
=======
def change_allow_to_sell(self, vals, used_apps):
if not vals['allow_to_sell']:
vals['used'] = [self] + used_apps
Expand All @@ -189,7 +170,6 @@ def change_allow_to_sell(self, vals, used_apps):
temp_app = self.search([('name', '=', app.name)])
if len(temp_app) > 0:
temp_app.allow_to_sell = True
>>>>>>> 1ea9415... :bomb: Now product.product 'website_published' field related to saas.line's 'allow_to_sell' field

@api.multi
def write(self, vals):
Expand Down Expand Up @@ -281,12 +261,8 @@ def create(self, vals):
res.product_id += prod.create({
'name': res.name,
'price': res.year_price,
<<<<<<< HEAD
'image': res.package_image
=======
'image_1920': res.package_image,
'website_published': True
>>>>>>> 1ea9415... :bomb: Now product.product 'website_published' field related to saas.line's 'allow_to_sell' field
})
return res

Expand Down
2 changes: 1 addition & 1 deletion saas_apps/views/calculator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</t>
<!-- Packages -->
<div class="openerp_enterprise_pricing_step">
<t t-if="show_packages">
<t t-if="show_packages and packages">
<h3 class="mt16 mb16">Choose your Packages</h3>
<div class="openerp_enterprise_pricing_step_body mb24">
<div class="form-row">
Expand Down

0 comments on commit 8f99928

Please sign in to comment.