Skip to content

Commit

Permalink
Merge PR #67 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Aug 23, 2019
2 parents cd70130 + bb59e3c commit 485c510
Show file tree
Hide file tree
Showing 11 changed files with 311 additions and 393 deletions.
2 changes: 1 addition & 1 deletion website_apps_store/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Website Apps Store",
"version": "12.0.1.0.1",
"version": "12.0.1.1.0",
'author': 'Odoo Community Association (OCA), BizzAppDev',
"website": "https://github.com/OCA/apps-store",
"license": "AGPL-3",
Expand Down
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
6 changes: 3 additions & 3 deletions website_apps_store/i18n/website_apps_store.pot
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ msgstr ""

#. module: website_apps_store
#: model_terms:ir.ui.view,arch_db:website_apps_store.category_display
msgid "Category :"
msgid "Category:"
msgstr ""

#. module: website_apps_store
Expand Down Expand Up @@ -103,7 +103,7 @@ msgstr ""

#. module: website_apps_store
#: model_terms:ir.ui.view,arch_db:website_apps_store.maturity_display
msgid "Maturity :"
msgid "Maturity:"
msgstr ""

#. module: website_apps_store
Expand Down Expand Up @@ -139,6 +139,6 @@ msgstr ""

#. module: website_apps_store
#: model_terms:ir.ui.view,arch_db:website_apps_store.version_display
msgid "Version :"
msgid "Version:"
msgstr ""

38 changes: 38 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,41 @@ 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

@api.multi
def _get_first_possible_combination(self, parent_combination=None,
necessary_values=None):
"""Override method to load last version first in app store"""
values = list(self._get_possible_combinations(
parent_combination, necessary_values))
if not any(values):
return self.env['product.template.attribute.value']
return values[-1]
5 changes: 0 additions & 5 deletions website_apps_store/static/src/css/main.less

This file was deleted.

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

.font_12 {
font-size: 12px;
}

.dropdown-scrollable {
max-height: 15rem;
overflow-y: auto;
}

#product_details .col-form-label {
padding-top: 0;
padding-bottom: 0;
}
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 485c510

Please sign in to comment.