Skip to content

Commit 52b385f

Browse files
author
Divya Modi
committed
[FIX]changes as per suggested
1 parent 8cb53c3 commit 52b385f

File tree

7 files changed

+49
-233
lines changed

7 files changed

+49
-233
lines changed

apps_download/__manifest__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
'base',
1515
'website_sale_digital',
1616
'github_connector_odoo',
17-
'apps_product_creator'
17+
'apps_product_creator',
1818
],
1919
"summary": "Product Download for Appstore",
2020
"data": [
21-
'demo/product_template.xml',
21+
'demo/product_template_demo.xml',
2222
'views/product_template_view.xml',
2323
'data/cron_scheduler.xml'
2424
],

apps_download/models/product_product.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class ProductProduct(models.Model):
2222
'src_id', 'dest_id', string='Dependent Products'
2323
)
2424
module_path = fields.Char(
25-
related="odoo_module_version_id.repository_branch_id.local_path")
25+
related="odoo_module_version_id.repository_branch_id.local_path",
26+
readonly=True)
2627

2728
@api.constrains('dependent_product_ids')
2829
def check_dependent_recursion(self):

apps_product_creator/models/product_product.py

+42-41
Original file line numberDiff line numberDiff line change
@@ -99,50 +99,51 @@ def _manage_product_module(self, values):
9999
for version in versions:
100100
module_id = version.module_id
101101
mod_ver_ids = module_id.dependence_module_version_ids.ids
102-
if version.module_id.dependence_module_version_ids:
103-
dependency_modules = module_version.search([
104-
('id', 'in', mod_ver_ids),
105-
('repository_branch_id', '=',
106-
version.repository_branch_id.id)
102+
if not version.module_id.dependence_module_version_ids:
103+
continue
104+
dependency_modules = module_version.search([
105+
('id', 'in', mod_ver_ids),
106+
('repository_branch_id', '=',
107+
version.repository_branch_id.id)
108+
])
109+
product_ids = []
110+
for dep in dependency_modules:
111+
product_variant_data = product_variant.search([
112+
('name', '=', dep.name),
113+
('odoo_module_version_id.module_id', '=',
114+
dep.module_id.id),
115+
('attribute_value_ids.name', '=',
116+
dep.repository_branch_id.name),
107117
])
108-
product_ids = []
109-
for dep in dependency_modules:
110-
product_variant_data = product_variant.search([
111-
('name', '=', dep.name),
112-
('odoo_module_version_id.module_id', '=',
113-
dep.module_id.id),
114-
('attribute_value_ids.name', '=',
115-
dep.repository_branch_id.name),
116-
])
118+
if product_variant_data:
119+
for pro in product_variant_data:
120+
product_ids.append(pro.id)
121+
if not product_variant_data:
122+
product_data = dep.module_id._create_product()
123+
product_variant_data = \
124+
product_data.product_variant_ids.search([
125+
('attribute_value_ids.name', '=',
126+
dep.repository_branch_id.name),
127+
('odoo_module_version_id.module_id',
128+
'=', dep.module_id.id), ])
117129
if product_variant_data:
118-
for pro in product_variant_data:
119-
product_ids.append(pro.id)
120-
if not product_variant_data:
121-
product_data = dep.module_id._create_product()
122-
product_variant_data = \
123-
product_data.product_variant_ids.search([
124-
('attribute_value_ids.name', '=',
125-
dep.repository_branch_id.name),
126-
('odoo_module_version_id.module_id',
127-
'=', dep.module_id.id), ])
128-
if product_variant_data:
129-
product_ids.append(product_variant_data.id)
130-
values.update({
131-
'dependent_product_ids': [
132-
(6, 0, product_ids)
133-
] if product_ids else False,
134-
})
135-
else:
136-
values.update({
137-
'dependent_product_ids': [
138-
(6, 0, product_ids)
139-
] if product_ids else False,
140-
})
130+
product_ids.append(product_variant_data.id)
131+
values.update({
132+
'dependent_product_ids': [
133+
(6, 0, product_ids)
134+
] if product_ids else False,
135+
})
136+
else:
137+
values.update({
138+
'dependent_product_ids': [
139+
(6, 0, product_ids)
140+
] if product_ids else False,
141+
})
141142

142-
# If we don't have a result, the ID will be False
143-
values.update({
144-
'odoo_module_version_id': versions.id,
145-
})
143+
# If we don't have a result, the ID will be False
144+
values.update({
145+
'odoo_module_version_id': version.id,
146+
})
146147
return True
147148

148149
@api.model

website_apps_store/README.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
:target: https://www.gnu.org/licenses/agpl
33
:alt: License: AGPL-3
44

5-
=============================
5+
==================
66
Website Apps Store
7-
=============================
7+
==================
88

9-
Providing facility for display the module specific information in a standard Odoo
9+
Providing facility for displaying the module specific information in a standard Odoo
1010
e-commerce website (front-end) and download the zip file of the selected product.
1111

1212
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas

website_apps_store/i18n/es.po

-93
This file was deleted.

website_apps_store/i18n/fr.po

-93
This file was deleted.

0 commit comments

Comments
 (0)