Skip to content

Commit

Permalink
Merge b8195b8 into cd70130
Browse files Browse the repository at this point in the history
  • Loading branch information
Tardo committed Aug 23, 2019
2 parents cd70130 + b8195b8 commit 5b71093
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 389 deletions.
20 changes: 0 additions & 20 deletions website_apps_store/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,6 @@ def shop(self, page=0, category=None, search='', ppg=False, **post):
})
return res

@http.route(['/shop/change_attribute_version'], type='json',
auth="public", website=True)
def change_product_attribute_version(self, **kwargs):
product_id = kwargs.get('product_id', False)
product = request.env['product.product'].sudo().browse(product_id)
vals = {
'name_product': product.name,
'technical_name':
product.odoo_module_version_id.module_id.technical_name,
'license': product.app_license_id.name,
'license_url': product.app_license_id.website,
'author': ', '.join(
author.name for author in product.app_author_ids),
'website': product.app_website,
'repository': product.app_github_url,
'rst_html': product.app_description_rst_html,
'app_summary': product.app_summary,
}
return vals

def validate_recaptcha(self, captcha):
""" Function for validating Recaptcha """
captcha_obj = request.env['website.form.recaptcha']
Expand Down
28 changes: 28 additions & 0 deletions website_apps_store/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,31 @@ def get_version_info(self):
products = self.product_variant_ids.sorted(
lambda a: a.attribute_value_ids.sequence, reverse=True)
return products[0]

@api.multi
def _get_combination_info(self, combination=False, product_id=False,
add_qty=1, pricelist=False,
parent_combination=False, only_template=False):
vals = super()._get_combination_info(
combination=combination, product_id=product_id, add_qty=add_qty,
pricelist=pricelist, parent_combination=parent_combination,
only_template=only_template)
if not vals['product_id']:
return vals
product = self.env['product.product'].browse(vals['product_id'])
if product.odoo_module_id:
vals.update({
'is_odoo_module': True,
'name_product': product.name,
'technical_name':
product.odoo_module_version_id.module_id.technical_name,
'license': product.app_license_id.name,
'license_url': product.app_license_id.website,
'author': ', '.join(
author.name for author in product.app_author_ids),
'website': product.app_website,
'repository': product.app_github_url,
'rst_html': product.app_description_rst_html,
'app_summary': product.app_summary,
})
return vals
5 changes: 0 additions & 5 deletions website_apps_store/static/src/css/main.less

This file was deleted.

14 changes: 14 additions & 0 deletions website_apps_store/static/src/css/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.desc_rst > {
.document > .reference{
display: none;
}
}

.font_12 {
font-size: 12px;
}

.dropdown-scrollable {
max-height: 15rem;
overflow-y: auto;
}
6 changes: 0 additions & 6 deletions website_apps_store/static/src/css/style.css

This file was deleted.

143 changes: 69 additions & 74 deletions website_apps_store/static/src/js/website_apps_store_tour.js
Original file line number Diff line number Diff line change
@@ -1,106 +1,101 @@
odoo.define('website_apps_store.tour_custom', function (require) {
'use strict';
'use strict';

var Tour = require("web_tour.tour");
var base = require("web_editor.base");
var Tour = require("web_tour.tour");
var base = require("web_editor.base");

Tour.register('download_zip', {
name: "Download Zip File",
url: '/shop/page/2',
test: true,
wait_for: base.ready()
},[
{
content: "Shop",
trigger: ".oe_product_cart a:contains('Odoo Module 1')"
wait_for: base.ready(),
}, [
{
content: "Shop",
trigger: ".oe_product_cart a:contains('Odoo Module 1')",
},
{
content: "Select Version",
trigger: "input[type=radio]",
run: function () {
$('input[type=radio]:last').attr("checked", "checked");
},
{
content: "Select Version",
trigger: "input[type=radio]",
run: function(){
$('input[type=radio]:last').attr("checked", "checked");
}
},
{
content: "Download",
trigger: "button:contains(Download)"
}
]
);
},
{
content: "Download",
trigger: "button:contains(Download)",
},
]);

Tour.register('select_version_search', {
name: "Select Version",
url: '/shop',
test: true,
wait_for: base.ready()
},[
{
content: "Shop",
trigger: ".dropdown_version_by a.dropdown-toggle"
},
{
content: "Select Version",
trigger: ".dropdown_version_by .dropdown-menu a:contains('10.0')",
},
]
);
wait_for: base.ready(),
}, [
{
content: "Shop",
trigger: ".dropdown_version_by a.dropdown-toggle",
},
{
content: "Select Version",
trigger: ".dropdown_version_by .dropdown-menu a:contains('10.0')",
},
]);

Tour.register('select_category_search', {
name: "Select Category",
url: '/shop',
test: true,
wait_for: base.ready()
},[
{
content: "Shop",
trigger: ".dropdown_category_by a.dropdown-toggle"
},
{
content: "Select Category",
trigger: ".dropdown_category_by .dropdown-menu a:contains('Category1')",
},
]
);
wait_for: base.ready(),
}, [
{
content: "Shop",
trigger: ".dropdown_category_by a.dropdown-toggle",
},
{
content: "Select Category",
trigger:
".dropdown_category_by .dropdown-menu a:contains('Category1')",
},
]);

Tour.register('module_search', {
name: "Select Product(Module)",
url: '/shop',
test: true,
wait_for: base.ready()
},[
{
content: "Shop",
trigger: ".search-query",
run: function(){
$('.search-query').attr('value', 'Test');
}
},
{
content: "Search Button",
trigger: ".oe_search_button",
wait_for: base.ready(),
}, [
{
content: "Shop",
trigger: ".search-query",
run: function () {
$('.search-query').attr('value', 'Test');
},
]
);
},
{
content: "Search Button",
trigger: ".oe_search_button",
},
]);

Tour.register('technical_name_search', {
name: "Select Product(Module) by Technical Name",
url: '/shop',
test: true,
wait_for: base.ready()
},[
{
content: "Shop",
trigger: ".search-query",
run: function(){
$('.search-query').attr('value', 'odoo_module1');
}
wait_for: base.ready(),
}, [
{
content: "Shop",
trigger: ".search-query",
run: function () {
$('.search-query').attr('value', 'odoo_module1');
},
{
content: "Search Button",
trigger: ".oe_search_button",
},
]
);

},
{
content: "Search Button",
trigger: ".oe_search_button",
},
]);

});
Loading

0 comments on commit 5b71093

Please sign in to comment.