diff --git a/product_configurator/__manifest__.py b/product_configurator/__manifest__.py
index be9a0a6c..4f75285a 100755
--- a/product_configurator/__manifest__.py
+++ b/product_configurator/__manifest__.py
@@ -1,23 +1,9 @@
# -*- coding: utf-8 -*-
-
{
'name': 'Product Configurator Base',
- 'version': '1.0',
+ 'version': '10.0.1.0.0',
'category': 'Generic Modules/Base',
'summary': 'Base for product configuration interface modules',
- 'description': """
- Base module offering configurable template products as a
- set of instructions for configuration wizards/forms.
-
- Features offered include:
-
- - Inhibition of automatically created variants
- - Extension of attribute lines to offer required, custom and multiple
- selection
- - Configuration / Compatibility rules between attributes
- - Images for intermediate and final configurations
- - Set of helper methods required for any Odoo configuration module
- """,
'author': 'Pledra',
'license': 'AGPL-3',
'website': 'http://www.pledra.com/',
diff --git a/product_configurator/data/menu_configurable_product.xml b/product_configurator/data/menu_configurable_product.xml
index 53922331..5cec1056 100644
--- a/product_configurator/data/menu_configurable_product.xml
+++ b/product_configurator/data/menu_configurable_product.xml
@@ -86,4 +86,4 @@
parent="menu_product_configurable" sequence="50"/>
-
\ No newline at end of file
+
diff --git a/product_configurator/data/product_attribute.xml b/product_configurator/data/product_attribute.xml
index e3e5707a..f3539926 100644
--- a/product_configurator/data/product_attribute.xml
+++ b/product_configurator/data/product_attribute.xml
@@ -14,4 +14,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator/demo/config_image_ids.xml b/product_configurator/demo/config_image_ids.xml
index 44be9338..374c6e54 100644
--- a/product_configurator/demo/config_image_ids.xml
+++ b/product_configurator/demo/config_image_ids.xml
@@ -88,4 +88,4 @@
])]"/>
-
\ No newline at end of file
+
diff --git a/product_configurator/demo/product_attribute.xml b/product_configurator/demo/product_attribute.xml
index 82c50d5c..5e833da0 100644
--- a/product_configurator/demo/product_attribute.xml
+++ b/product_configurator/demo/product_attribute.xml
@@ -339,4 +339,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator/demo/product_config_domain.xml b/product_configurator/demo/product_config_domain.xml
index 944a9b65..0d57a7f6 100644
--- a/product_configurator/demo/product_config_domain.xml
+++ b/product_configurator/demo/product_config_domain.xml
@@ -67,4 +67,4 @@
ref('product_attribute_value_220d_xdrive')])]"/>
-
\ No newline at end of file
+
diff --git a/product_configurator/demo/product_config_lines.xml b/product_configurator/demo/product_config_lines.xml
index fc7be2e7..84d54ff1 100644
--- a/product_configurator/demo/product_config_lines.xml
+++ b/product_configurator/demo/product_config_lines.xml
@@ -44,4 +44,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator/demo/product_config_step.xml b/product_configurator/demo/product_config_step.xml
index 7e289458..82f56054 100644
--- a/product_configurator/demo/product_config_step.xml
+++ b/product_configurator/demo/product_config_step.xml
@@ -3,9 +3,9 @@
-
- Engine
-
+
+ Engine
+
Body
@@ -19,9 +19,9 @@
Interior
-
+
@@ -63,4 +63,4 @@
ref('product_attribute_line_2_series_options')])]"/>
-
\ No newline at end of file
+
diff --git a/product_configurator/demo/product_template.xml b/product_configurator/demo/product_template.xml
index d0eeb905..c7289431 100644
--- a/product_configurator/demo/product_template.xml
+++ b/product_configurator/demo/product_template.xml
@@ -1,19 +1,19 @@
-
+
BMW
-
- 2 Series
-
- product
-
+
+ 2 Series
+
+ product
+
-
-
+
+
Sport Line
@@ -169,4 +169,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator/models/account.py b/product_configurator/models/account.py
index 63de3ff9..7d8d2a60 100644
--- a/product_configurator/models/account.py
+++ b/product_configurator/models/account.py
@@ -3,7 +3,7 @@
from odoo import models, fields
-class account_invoice_line(models.Model):
+class AccountInvoiceLine(models.Model):
_inherit = 'account.invoice.line'
product_id = fields.Many2one(domain=[('config_ok', '=', False)])
diff --git a/product_configurator/models/product_attribute.py b/product_configurator/models/product_attribute.py
index 07875133..26d90445 100644
--- a/product_configurator/models/product_attribute.py
+++ b/product_configurator/models/product_attribute.py
@@ -237,7 +237,7 @@ class ProductAttributeValueCustom(models.Model):
@api.multi
@api.depends('attribute_id', 'attribute_id.uom_id')
- def compute_val_name(self):
+ def _compute_val_name(self):
for attr_val_custom in self:
uom = attr_val_custom.attribute_id.uom_id.name
attr_val_custom.name = '%s%s' % (attr_val_custom.value, uom or '')
@@ -247,7 +247,7 @@ def compute_val_name(self):
name = fields.Char(
string='Name',
readonly=True,
- compute="compute_val_name",
+ compute="_compute_val_name",
store=True,
)
product_id = fields.Many2one(
diff --git a/product_configurator/models/product_config.py b/product_configurator/models/product_config.py
index 3ee966df..cafef6d1 100644
--- a/product_configurator/models/product_config.py
+++ b/product_configurator/models/product_config.py
@@ -174,8 +174,9 @@ def check_value_attributes(self):
value_attributes = line.value_ids.mapped('attribute_id')
if value_attributes != line.attribute_line_id.attribute_id:
raise ValidationError(
- "Values must belong to the attribute of the corresponding "
- "attribute_line set on the configuration line"
+ _("Values must belong to the attribute of the "
+ "corresponding attribute_line set on the configuration "
+ "line")
)
@@ -273,7 +274,7 @@ class ProductConfigSession(models.Model):
@api.multi
@api.depends('value_ids')
- def _get_cfg_price(self):
+ def _compute_cfg_price(self):
for session in self:
custom_vals = session._get_custom_vals_dict()
price = session.product_tmpl_id.get_cfg_price(
@@ -316,7 +317,7 @@ def _get_custom_vals_dict(self):
string='Custom Values'
)
price = fields.Float(
- compute='_get_cfg_price',
+ compute='_compute_cfg_price',
string='Price',
store=True,
)
diff --git a/product_configurator/security/configurator_security.xml b/product_configurator/security/configurator_security.xml
index 45a0abec..4dfc6b22 100644
--- a/product_configurator/security/configurator_security.xml
+++ b/product_configurator/security/configurator_security.xml
@@ -2,9 +2,9 @@
-
- Product Configurator
-
+
+ Product Configurator
+
Products
@@ -14,4 +14,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator/views/assets.xml b/product_configurator/views/assets.xml
index e5e69eb7..1b028352 100644
--- a/product_configurator/views/assets.xml
+++ b/product_configurator/views/assets.xml
@@ -7,4 +7,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator/views/product_attribute_view.xml b/product_configurator/views/product_attribute_view.xml
index d88164a5..7d658c79 100644
--- a/product_configurator/views/product_attribute_view.xml
+++ b/product_configurator/views/product_attribute_view.xml
@@ -102,4 +102,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator/views/product_config_view.xml b/product_configurator/views/product_config_view.xml
index 33c154ed..d80dd608 100644
--- a/product_configurator/views/product_config_view.xml
+++ b/product_configurator/views/product_config_view.xml
@@ -145,4 +145,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator/views/product_view.xml b/product_configurator/views/product_view.xml
index 144b5c9f..1519dece 100644
--- a/product_configurator/views/product_view.xml
+++ b/product_configurator/views/product_view.xml
@@ -124,4 +124,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator/views/sale_view.xml b/product_configurator/views/sale_view.xml
index d28455b6..c946c31a 100644
--- a/product_configurator/views/sale_view.xml
+++ b/product_configurator/views/sale_view.xml
@@ -1,26 +1,26 @@
-
- product.configurator.sale.order.line.form.view
- sale.order
-
-
+
+ product.configurator.sale.order.line.form.view
+ sale.order
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
\ No newline at end of file
+
diff --git a/product_configurator_mrp/__manifest__.py b/product_configurator_mrp/__manifest__.py
index ee2f7200..e2006252 100755
--- a/product_configurator_mrp/__manifest__.py
+++ b/product_configurator_mrp/__manifest__.py
@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
{
'name': 'Product Configurator Manufacturing',
- 'version': '1.0',
+ 'version': '10.0.1.0.0',
'category': 'Manufacturing',
'summary': 'BOM Support for configurable products',
- 'description': """Add boms to configured products""",
'author': 'Pledra',
'license': 'AGPL-3',
'website': 'http://www.pledra.com/',
diff --git a/product_configurator_mrp/security/configurator_security.xml b/product_configurator_mrp/security/configurator_security.xml
index b1625eaa..e934e3d5 100644
--- a/product_configurator_mrp/security/configurator_security.xml
+++ b/product_configurator_mrp/security/configurator_security.xml
@@ -8,4 +8,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator_wizard/__manifest__.py b/product_configurator_wizard/__manifest__.py
index 95b12b20..0252ae89 100755
--- a/product_configurator_wizard/__manifest__.py
+++ b/product_configurator_wizard/__manifest__.py
@@ -1,17 +1,9 @@
# -*- coding: utf-8 -*-
{
'name': 'Product Configurator Wizard',
- 'version': '1.0',
+ 'version': '10.0.1.0.0',
'category': 'Generic Modules/Base',
'summary': 'Back-end Product Configurator',
- 'description': """
- This module provides a backend configuration wizard for generating
- products directly from any Odoo standard model such as Sale Order,
- Production Order etc.
-
- The view is dynamically generated using the information provided
- on the configurable template.
- """,
'author': 'Pledra',
'license': 'AGPL-3',
'website': 'http://www.pledra.com/',
diff --git a/product_configurator_wizard/views/assets.xml b/product_configurator_wizard/views/assets.xml
index e880dd4c..8437b3c9 100644
--- a/product_configurator_wizard/views/assets.xml
+++ b/product_configurator_wizard/views/assets.xml
@@ -7,4 +7,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator_wizard/views/sale_view.xml b/product_configurator_wizard/views/sale_view.xml
index b853d2a9..40485226 100644
--- a/product_configurator_wizard/views/sale_view.xml
+++ b/product_configurator_wizard/views/sale_view.xml
@@ -46,4 +46,4 @@
-
\ No newline at end of file
+
diff --git a/product_configurator_wizard/wizard/product_configurator.py b/product_configurator_wizard/wizard/product_configurator.py
index c6811e77..ab01a944 100644
--- a/product_configurator_wizard/wizard/product_configurator.py
+++ b/product_configurator_wizard/wizard/product_configurator.py
@@ -28,7 +28,7 @@ class ProductConfigurator(models.TransientModel):
@api.multi
@api.depends('product_tmpl_id', 'value_ids', 'custom_value_ids')
- def _get_cfg_image(self):
+ def _compute_cfg_image(self):
# TODO: Update when allowing custom values to influence image
product_tmpl = self.product_tmpl_id.with_context(bin_size=False)
img_obj = product_tmpl.get_config_image_obj(self.value_ids.ids)
@@ -222,7 +222,7 @@ def onchange(self, values, field_name, field_onchange):
help='Set only when re-configuring a existing variant'
)
product_img = fields.Binary(
- compute='_get_cfg_image',
+ compute='_compute_cfg_image',
readonly=True
)
state = FreeSelection(
@@ -439,17 +439,18 @@ def add_dynamic_fields(self, res, dynamic_fields, wiz):
dependencies = config_lines.filtered(
lambda cl: cl.attribute_line_id == attr_line)
- """ If a attribute field depends on another field from the same
- configuration step then we must use attrs to enable/disable the
- required and readonly depending on the value entered in the
- dependee
- """
+ # If an attribute field depends on another field from the same
+ # configuration step then we must use attrs to enable/disable the
+ # required and readonly depending on the value entered in the
+ # dependee
+
if attr_line.value_ids <= dependencies.mapped('value_ids'):
attr_depends = {}
domain_lines = dependencies.mapped('domain_id.domain_line_ids')
for domain_line in domain_lines:
attr_id = domain_line.attribute_id.id
attr_field = self.field_prefix + str(attr_id)
+ attr_lines = wiz.product_tmpl_id.attribute_line_ids
# If the fields it depends on are not in the config step
if config_steps and str(attr_line.id) != wiz.state:
continue
@@ -459,7 +460,7 @@ def add_dynamic_fields(self, res, dynamic_fields, wiz):
attr_depends[attr_field] |= set(
domain_line.value_ids.ids)
elif domain_line.condition == 'not in':
- val_ids = wiz.product_tmpl_id.attribute_line_ids.filtered(
+ val_ids = attr_lines.filtered(
lambda l: l.id == attr_id).value_ids
val_ids = val_ids - domain_line.value_ids
attr_depends[attr_field] |= set(val_ids.ids)
@@ -787,8 +788,8 @@ def action_previous_step(self):
return wizard_action
def _extra_line_values(self, so, product, new=True):
- """ Hook to allow custom line values to be put on the newly created or edited lines.
- """
+ """ Hook to allow custom line values to be put on the newly
+ created or edited lines."""
vals = {}
if new:
vals.update({'name': product.display_name})
@@ -803,16 +804,18 @@ def action_config_done(self):
}
if self.product_id:
- remove_cv_links = map(lambda cv: (2, cv), self.product_id.value_custom_ids.ids)
- new_cv_links = self.product_id.product_tmpl_id.encode_custom_values(custom_vals)
+ product_tmpl = self.product_id.product_tmpl_id
+ remove_cv_links = map(
+ lambda cv: (2, cv), self.product_id.value_custom_ids.ids)
+ new_cv_links = product_tmpl.encode_custom_values(custom_vals)
self.product_id.write({
'attribute_value_ids': [(6, 0, self.value_ids.ids)],
'value_custom_ids': remove_cv_links + new_cv_links,
})
if self.order_line_id:
- self.order_line_id.write(self._extra_line_values(self.order_line_id.order_id,
- self.product_id,
- new=False))
+ order_line_vals = self._extra_line_values(
+ self.order_line_id.order_id, self.product_id, new=False)
+ self.order_line_id.write(order_line_vals)
self.unlink()
return
#
diff --git a/product_configurator_wizard/wizard/product_configurator_view.xml b/product_configurator_wizard/wizard/product_configurator_view.xml
index 0bf43433..88580774 100644
--- a/product_configurator_wizard/wizard/product_configurator_view.xml
+++ b/product_configurator_wizard/wizard/product_configurator_view.xml
@@ -36,4 +36,4 @@
-
\ No newline at end of file
+
diff --git a/website_product_configurator/__manifest__.py b/website_product_configurator/__manifest__.py
index 85a904c2..184a7da0 100644
--- a/website_product_configurator/__manifest__.py
+++ b/website_product_configurator/__manifest__.py
@@ -1,12 +1,8 @@
# -*- coding: utf-8 -*-
{
'name': "Website Product Configurator",
- 'version': '1.0',
+ 'version': '10.0.1.0.0',
'summary': """Configure products in e-shop""",
- 'description': """
- A frontend version of the product configurator enabling
- users to generate configured product variants from the e-shop
- """,
'author': "Pledra",
'license': 'AGPL-3',
'website': 'http://www.pledra.com/',
diff --git a/website_product_configurator/controllers/main.py b/website_product_configurator/controllers/main.py
index e6050706..b972352d 100644
--- a/website_product_configurator/controllers/main.py
+++ b/website_product_configurator/controllers/main.py
@@ -102,7 +102,7 @@ def get_json_config(self, product_tmpl, json_code, config_step=None):
cfg_tmpl_url + '/value_onchange',
cfg_step_url + '/value_onchange'
], type='json', auth='public', website=True)
- def value_onchange(self, product_tmpl, config_step=None, cfg_vals=[]):
+ def value_onchange(self, product_tmpl, config_step=None, cfg_vals=None):
""" Check attribute domain restrictions on each value change and
combine the form data sent from the frontend with the stored
configured in the session
@@ -113,6 +113,9 @@ def value_onchange(self, product_tmpl, config_step=None, cfg_vals=[]):
:returns: list of available ids for all options in the form
"""
+ if not cfg_vals:
+ cfg_vals = []
+
vals = {
'value_ids': [],
}
@@ -199,7 +202,7 @@ def select_template(self, **kw):
template_obj = request.env['product.template']
templates = template_obj.search([('config_ok', '=', True)])
- template_name = 'website_product_configurator.product_configurator_list'
+ tmpl_ext_id = 'website_product_configurator.product_configurator_list'
style_obj = request.env['product.style']
styles = style_obj.search([])
@@ -215,7 +218,7 @@ def select_template(self, **kw):
'style_in_product': lambda style, product: style.id in [
s.id for s in product.website_style_ids],
}
- return request.render(template_name, values)
+ return request.render(tmpl_ext_id, values)
def parse_upload_file(self, field_name, multi=False):
""" Parse uploaded file from request.files """
@@ -260,8 +263,8 @@ def parse_config_post(self, product_tmpl):
custom_val = self.parse_upload_file(
custom_field_name, line.multi)
else:
- custom_type = eval(custom_type) if custom_type in [
- 'float', 'int'] else None
+ class_mapper = {'int': int, 'float': float}
+ custom_type = class_mapper.get(custom_type, None)
# For numerical values force datatype
custom_val = post.get(custom_field_name, type=custom_type)
config_code.update({
diff --git a/website_product_configurator_mrp/__manifest__.py b/website_product_configurator_mrp/__manifest__.py
index 8b4fd16a..bc4c8379 100755
--- a/website_product_configurator_mrp/__manifest__.py
+++ b/website_product_configurator_mrp/__manifest__.py
@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
{
'name': 'Website Configurator Manufacturing',
- 'version': '1.0',
+ 'version': '10.0.1.0.0',
'category': 'Website',
'summary': 'Website integration of MRP',
- 'description': """Adds MRP logic to configurable products in frontend""",
'author': 'Pledra',
'license': 'AGPL-3',
'website': 'http://www.pledra.com/',
diff --git a/website_product_configurator_mrp/controllers/main.py b/website_product_configurator_mrp/controllers/main.py
index 1e996fbb..4ed35858 100644
--- a/website_product_configurator_mrp/controllers/main.py
+++ b/website_product_configurator_mrp/controllers/main.py
@@ -11,8 +11,7 @@ class WebsiteProductConfigMrp(WebsiteProductConfig):
def cart_update(self, product, post):
if post.get('assembly') == 'kit':
- attr_products = product.attribute_value_ids.mapped(
- 'product_id')
+ attr_products = product.attribute_value_ids.mapped('product_id')
for product in attr_products:
request.website.sale_get_order(force_create=1)._cart_update(
product_id=int(product.id),
@@ -20,7 +19,7 @@ def cart_update(self, product, post):
)
else:
request.website.sale_get_order(force_create=1)._cart_update(
- product_id=int(product.id),
- add_qty=float(post.get('add_qty')),
- )
+ product_id=int(product.id),
+ add_qty=float(post.get('add_qty')),
+ )
return request.redirect("/shop/cart")