Coder Social home page Coder Social logo

product-variant's Issues

[11.0] Some inconsistencies in the views.

I'm looking and comparing the views and i found some problems with them:
vistasdelconfigurador

Description: when the user is looking in the PO or SO it wants to know what product and what attributes it has, that's why the description field in SO is the most adequate for a view. That field in PO shows the reference code, while users want to know more clear information.

Product Template: it can be showed too in the PO view, or in neither of the two.

Product: It can be shown in both, but while in PO is showed(it shows just for products that have previously set attribute values #125), it is blank in the SO.

I don't know what is the approach behind this differences but i think this changes could be good.

Migration to version 13.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-13.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[11.0] [product_variant] Error when starting inventory adjustment

module: product_variant_configurator
version: 11.0

Steps to reproduce
Create an inventory adjustment and click on 'Start Inventory'

Current behavior
Odoo Server Error:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/http.py", line 651, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/http.py", line 693, in dispatch
result = self._call_function(**self.params)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/http.py", line 342, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/http.py", line 335, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/http.py", line 937, in call
return self.method(*args, **kw)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/addons/web/controllers/main.py", line 938, in call_button
action = self._call_kw(model, method, args, {})
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/addons/web/controllers/main.py", line 926, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/api.py", line 680, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/addons/stock/models/stock_inventory.py", line 197, in action_start
vals.update({'line_ids': [(0, 0, line_values) for line_values in inventory._get_inventory_lines_values()]})
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/addons/stock/models/stock_inventory.py", line 260, in _get_inventory_lines_values
GROUP BY product_id, location_id, lot_id, package_id, partner_id """ % domain, args)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/sql_db.py", line 155, in wrapper
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/odoo-11.0+e.20181225-py3.5.egg/odoo/sql_db.py", line 232, in execute
res = self._obj.execute(query, params)
psycopg2.ProgrammingError: column reference "product_id" is ambiguous
LINE 4: ON product_product.id = product_id

Expected behavior
Inventory adjustment started

Migration to version 14.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-14.0

Modules to migrate

  • product_attribute_value_archive - By @mmequignon - #236
  • product_variant_configurator
  • product_variant_default_code - By @joao-p-marques - #189
  • product_variant_inactive - By @PierrickBrun - #196
  • purchase_order_variant_mgmt - By @sonhd91 - #234
  • purchase_variant_configurator
  • purchase_variant_configurator_on_confirm
  • sale_order_line_variant_description - By @SimoneVagile - #217
  • sale_variant_configurator

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[11.0] sale_variant_configurator: pricelist error

If pricelist discount_policy is equal to 'without_discount', and you search for a template in sale order line, then an error is raised because this line:

https://github.com/OCA/product-variant/blob/11.0/sale_variant_configurator/models/sale_order.py#L143

generate a list of tuples with a product.product recordset null, as product_id field is empty at this moment:

https://github.com/OCA/product-variant/blob/11.0/product_variant_configurator/models/pricelist.py#L21

To reproduce the error only have to change the discount_policy of the pricelist of the sale order and search for a template with variants in the sale order line.

The log I've got:

2019-06-26 16:49:49,911 25905 ERROR database odoo.sql_db: bad query: b"SELECT item.id FROM product_pricelist_item AS item LEFT JOIN product_category AS categ ON item.categ_id = categ.id WHERE (item.product_tmpl_id IS NULL OR item.product_tmpl_id = any(ARRAY[false]))AND (item.product_id IS NULL OR item.product_id = any(ARRAY[false]))AND (item.categ_id IS NULL OR item.categ_id = any('{}')) AND (item.pricelist_id = 1) AND (item.date_start IS NULL OR item.date_start<='2019-06-26 16:28:12') AND (item.date_end IS NULL OR item.date_end>='2019-06-26 16:28:12')ORDER BY item.applied_on, item.min_quantity desc, categ.parent_left desc"
ERROR: operator does not exist: integer = boolean
LINE 1: ...m.product_tmpl_id IS NULL OR item.product_tmpl_id = any(ARRA...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

2019-06-26 16:49:49,912 25905 ERROR database odoo.http: Exception during JSON request handling.
Traceback (most recent call last):
File "/home/cubells/Dades/git/odoo11/src/core/odoo/http.py", line 653, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/http.py", line 312, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/cubells/Dades/git/odoo11/src/core/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/home/cubells/Dades/git/odoo11/src/core/odoo/http.py", line 695, in dispatch
result = self._call_function(**self.params)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/http.py", line 344, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/http.py", line 337, in checked_call
result = self.endpoint(*a, **kw)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/http.py", line 939, in call
return self.method(*args, **kw)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/http.py", line 517, in response_wrap
response = f(*args, **kw)
File "/home/cubells/Dades/git/odoo11/src/core/addons/web/controllers/main.py", line 934, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/cubells/Dades/git/odoo11/src/core/addons/web/controllers/main.py", line 926, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/api.py", line 680, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/models.py", line 5222, in onchange
record._onchange_eval(name, field_onchange[name], result)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/models.py", line 5039, in _onchange_eval
method_res = method(self)
File "/home/cubells/Dades/git/odoo11/src/other-addons/sale_variant_configurator/models/sale_order.py", line 143, in product_uom_change
self._update_price_configurator()
File "/home/cubells/Dades/git/odoo11/src/other-addons/sale_variant_configurator/models/sale_order.py", line 123, in _update_price_configurator
self.price_extra + self._get_display_price(product_tmpl),
File "/home/cubells/Dades/git/odoo11/src/core/addons/sale/models/sale.py", line 1042, in _get_display_price
final_price, rule_id = self.order_id.pricelist_id.with_context(product_context).get_product_price_rule(self.product_id, self.product_uom_qty or 1.0, self.order_id.partner_id)
File "/home/cubells/Dades/git/odoo11/src/core/addons/product/models/product_pricelist.py", line 276, in get_product_price_rule
return self._compute_price_rule([(product, quantity, partner)], date=date, uom_id=uom_id)[product.id]
File "/home/cubells/Dades/git/odoo11/src/other-addons/product_variant_configurator/models/pricelist.py", line 21, in _compute_price_rule
products_qty_partner, date=date, uom_id=uom_id,
File "/home/cubells/Dades/git/odoo11/src/core/addons/product/models/product_pricelist.py", line 155, in _compute_price_rule
(prod_tmpl_ids, prod_ids, categ_ids, self.id, date, date))
File "/home/cubells/Dades/git/odoo11/src/core/odoo/sql_db.py", line 155, in wrapper
return f(self, *args, **kwargs)
File "/home/cubells/Dades/git/odoo11/src/core/odoo/sql_db.py", line 232, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedFunction: operator does not exist: integer = boolean
LINE 1: ...m.product_tmpl_id IS NULL OR item.product_tmpl_id = any(ARRA...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

Product Variant Sale Price do not work with tier prices on product variant sales tab

Our goal is manage sales tier prices at product variant level in product variant sales tab.

We tested product_variant_sale_price on Odoo 12CE, it works fine with tier prices based on variant level only when we set pricing to "Prices computed from formulas (discounts, margins, roundings)" in Sales / Configuration / Setting.

However we would prefer to be able to manage tier prices in the product variant sales tab. To do so we need to set Pricing to "Multiple prices per product (e.g. customer segments, currencies)" in Sales / Configuration / Setting. In this case tier prices are managed at product level not at product variant level.

When we add/change tier prices in product variant sales tab this updates prices to all product variants.

Thank you to share your suggestions

[11.0][sale_variant_configurator] Remose the user interface

Hi,

I'm seeing the current interface and i think it could be better:
deepin-screen-recorder_select area_20181204142559

It is not needed to handle all line product in the new view, it just requires having a select box to select the product and the product's attribute fields. Also, creating a new attribute value does not require a new form since the attribute must to be the current attribute and the other fields(sequence and attribute sequence) can be filled automatically.

What do you think about that?

product_variant_default_code: issue

Admin user who is having the "Product Default Code Behavior" group set a reference mask for a product template. Then another user without the "Product Default Code Behavior" security group make changes to any field other than attribute_line_ids, reference_mask, code_prefix etc can trigger the default_code generation using the default_reference_mask

[10.0] product_variant_default_code - product.template default_code empty

Odoo deletes the default_code when a product.template has more than 1 variant.

I think this would be better to have the default_code still present on a multiple variants template when using this module because the template has the code_prefix which is the template's default_code

That way, the code_prefix would be visible in the tree view instead of an empty column

Here is Odoo's code I would like to change:


@api.depends('product_variant_ids', 'product_variant_ids.default_code')
    def _compute_default_code(self):
        unique_variants = self.filtered(lambda template: len(template.product_variant_ids) == 1)
        for template in unique_variants:
            template.default_code = template.product_variant_ids.default_code
        for template in (self - unique_variants):
            # template.default_code = ''
            template.default_code = template.code_prefix

Any thoughts about this ?

Cannot add variant price in the vendor pricelists

[11.0][sale_variant_configurator] Product configured values dissapear after saving SO

Hi,
I'm testing this module and i have a rare bug with it:
deepin-screen-recorder_select area_20181129175100
As you can see, i did save the product configuration for the same product with different values, it is clear in the description column, but when I to try to confirm the SO it says that i must to define the attribute values, but why?
So, i review the product configurated values and they are empty. Why?

I did the same process with a from-zero new product without previous variants i hadn't any problem, what's happening here?

[11.0] Configurator does not show the product variant name correctly

Testing this module I found another issue:

deepin-screen-recorder_chromium_20181205154900
As you can see, if you put some default attribute values in the product variants the configurator will show the product variant name, and just with the first attribute's value, but if the product hasn't any previously set attribute value, I will just show the product template name.

It happens with all lines related to that product in PO and in SO.

Why?

[11.0][sale_variant_configurator] Key error when trying to choose a product template

Hello,

I'm working with this module in order to manage all size variants in an easy way, but I'm getting a bug.

I installed this module in a pre-existing database with all my product with their respective variants, no problems; i go to the sale module and i create a new sale, i try to choose a product as a product template and i get this:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 651, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 693, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 342, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 335, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 937, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 934, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 926, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 5099, in onchange
    record._onchange_eval(name, field_onchange[name], result)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4994, in _onchange_eval
    method_res = method(self)
  File "/var/lib/odoo/addons/11.0/product-variant/sale_variant_configurator/models/sale_order.py", line 52, in _onchange_product_tmpl_id_configurator
    self.order_id.partner_id.id)[self.order_id.pricelist_id.id]
KeyError: False

Why?

Odoo 11.0-20181126 (Community Edition)

[10.0][sale_variant_configurator]: Error inherit super

Hello, there are any errors with the last update in sale_variant_configurator.

return super(SaleOrder, self).create(vals)

res = super(SaleOrder, self)._onchange_product_tmpl_id_configurator()

res = super(SaleOrder, self).product_id_change()

The problem is that the instance is SaleOrder, and in this class the name is SaleOrderLine.

[10.0] product_variant_supplierinfo doesn't seem to work on product form

Step:
Modify a product form, add a supplier, select product's variant, fill all the field, save supplier info and product form. When re-opening, one can see that product's variant in the supplier info form is gone, the supplier infos looks set for the product template.
Opening the variant form, one can see that supplier infos are set as a variant template.

May be this is intended, in this case it' a UI problem : the select variant field shouldn't be available in the product supplier form.

[13.0} product_variant_configurator error when select product template in add product Variant

I just installed the module and I don't know if it's me doing something wrong, or if it's the module.

I have created a product template without creating the variants. When I go to the product variant, it lets me select the product template, but when I select it, I get the following error

I hope you can help me
Greetings

Error:
Odoo Server Error

Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/api.py", line 745, in get
value = self._data[field][record._ids[0]]
KeyError: <NewId 0x7f4f623ee9b0>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/fields.py", line 1002, in get
value = env.cache.get(record, self)
File "/opt/odoo13/odoo/odoo/api.py", line 751, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('product.product(<NewId 0x7f4f623ee9b0>,).website_url', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/api.py", line 745, in get
value = self._data[field][record._ids[0]]
KeyError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/fields.py", line 1002, in get
value = env.cache.get(record, self)
File "/opt/odoo13/odoo/odoo/api.py", line 751, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('product.template(,).website_url', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/odoo13/odoo/odoo/http.py", line 624, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo13/odoo/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/opt/odoo13/odoo/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/opt/odoo13/odoo/odoo/http.py", line 669, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo13/odoo/odoo/http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo13/odoo/odoo/http.py", line 915, in call
return self.method(*args, **kw)
File "/opt/odoo13/odoo/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1322, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1314, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo13/odoo/odoo/api.py", line 387, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo13/odoo/odoo/api.py", line 374, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo13/odoo/odoo/models.py", line 6124, in onchange
for name in nametree
File "/opt/odoo13/odoo/odoo/models.py", line 6125, in
if name not in done and snapshot0.has_changed(name)
File "/opt/odoo13/odoo/odoo/models.py", line 5992, in has_changed
return self[name] != record[name]
File "/opt/odoo13/odoo/odoo/models.py", line 5640, in getitem
return self._fields[key].get(self, type(self))
File "/opt/odoo13/odoo/odoo/fields.py", line 1026, in get
self.compute_value(recs)
File "/opt/odoo13/odoo/odoo/fields.py", line 1111, in compute_value
records._compute_field_value(self)
File "/opt/odoo13/odoo/odoo/models.py", line 3939, in _compute_field_value
getattr(self, field.compute)()
File "/opt/odoo13/odoo/addons/website_sale/models/product.py", line 418, in _compute_product_website_url
product.website_url = "%s#attr=%s" % (product.product_tmpl_id.website_url, attributes)
File "/opt/odoo13/odoo/odoo/fields.py", line 1026, in get
self.compute_value(recs)
File "/opt/odoo13/odoo/odoo/fields.py", line 1111, in compute_value
records._compute_field_value(self)
File "/opt/odoo13/odoo/odoo/models.py", line 3939, in _compute_field_value
getattr(self, field.compute)()
File "/opt/odoo13/odoo/addons/website_sale/models/product.py", line 379, in _compute_website_url
product.website_url = "/shop/product/%s" % slug(product)
File "/opt/odoo13/odoo/addons/http_routing/models/ir_http.py", line 91, in slug
raise ValueError("Cannot slug non-existent record %s" % value)
ValueError: Cannot slug non-existent record product.template(,)

[11.0][sale_variant_configurator] Configurator does not save attribute values for product

Hi,

I am geting other problem with the variant configurator:
deepin-screen-recorder_select area_20181204142559

When i create a new value for the attribute it is not saved related to the value, so, i cannot choose it again the next time, it forces us to create that value again, but it brings us other problem:
deepin-screen-recorder_select area_20181204145737

It is because of the value already exists:
noguardavalores

The idea is getting the current values in the product as much as possible.

How can we do it?

Product variant sale price on diferent units of measures

Conditions:
-The check of allow using different UOMs is marked.
-the module Product Variant Sale Price is installed.

If you select a product with units by default, but you change the UOM on the sale order to Dozens the price is multiplied by 144 instead of 12.

[10.0]sale_order_variant_mgmt | Adding/Deleting Attribute Values via table

First of all, a big thanks to OCA, Tecnativa and whoever participated in developing this Module :) It's brilliant

My request is for a user to have the ability to add/delete attributes to/from a Product template:

In the example i've used product CHEMISE with two Attributes: Color and Size and they have the following Attribute Values:
Color: C1 - C2 - C3
Size: 42 - 44 - 46 - 48

image

So by using a plus/minus button we could add or delete attributes on the fly! Or if removing the attribute values, at least adding extra ones will help.

Thanks.

Product Variant Configurator with restrictions.

I plan to work in new functionality to be able to rescrict atributes values.

For example, I habe a product with:

  • Attribute A, with posible values X, Y, Z
  • Attribute B. with posible values 1, 2, 3

But, :

  • if you set Attribute A= X, then Attribute B could be 1, 2
  • if you set Attribute A= Y, then Attribute B could be 1, 2, 3
  • if you set Attribute A= Z, then Attribute B could be 3

Restrictions must be configurated by product.

[11.0] product_variant_configurator: When activating sales message, the name in the sales order is False

Impacted versions: 11.0 e

Steps to reproduce:

  1. Activate the warning when Selling this Product
  2. create sale order with the product with demo user

Current behavior:

When activating sales message in the product, the name in the sales order is False with demo user

Expected behavior:

When activating the message for sale from the product, obtain the product name correctly in the sales order with any user

Video/Screenshot link (optional):

https://youtu.be/qshXIEjj6xg

[10.0] product_variant_configurator conflict with Inventory Adjustments

The product_id field https://github.com/OCA/product-variant/blob/10.0/product_variant_configurator/models/product_configurator.py#L31 and https://github.com/OCA/product-variant/blob/10.0/product_variant_configurator/models/product_product.py#L10 does conflict with adjustmen inventary:

ProgrammingError: column reference "product_id" is ambiguous
LINE 1: SELECT product_id, sum(qty) as product_qty, location_id, lot...

https://github.com/OCA/OCB/blob/10.0/addons/stock/models/stock_inventory.py#L266

Product Variants Pricing Not Displaying correctly at sales orders

module: product_variant_sale_price
version: 13.0

Steps to reproduce
add a product called sanitizers set sales price to 470
Create Variants size or volume and Classification (100ml Alcohol base, 100ml Gel Base, Gallon Gel Base, and Gallon Alcohol Base)
Create variants scent (Apple Mint and Strawberry)
Configure variants pricing based on size and classifications (eg. 100ml Gel Base with a value extra price of -420, and 100ml Alcohol Base with an value extra price of -435, and Gallon Gel Base with an value extra price of 80)
Update quantity 1 by 1.

  • ...

Current behavior
When doing sale invoice, and adding a product, if i select the sanitizer product and choose on the variants. specifically on 100ml Alcohol Base, the price that pops up in the invoice page is the price of the Sanitizer Alcohol base which is 35 and not 50. product variants prices a properly configured as stated above.

screenshots of the said problem is provided.

Variants Price not displaying correct price 1
Variants Price not displaying correct price 2
Variants Price not displaying correct price 3

Expected behavior

The product Sanitizer Gel Base Price should be 50 and not 35 which is the price of Sanitizer Alcohol Base.

[10.0] product_variant_template_data module

Further to #42 (comment) I started working at https://github.com/tafaRU/product-variant/tree/10.0-add-product_variant_template_data

Before to continue I'd like to be sure that I'm working properly, so that I share my Todo list as follows:

Todo List

I won't move https://github.com/OCA/product-variant/tree/8.0/product_variant_available_in_pos
as its data is more focused on point_of_sale.
While I have doubts about also moving https://github.com/OCA/product-variant/tree/8.0/product_variant_cost_price and https://github.com/OCA/product-variant/tree/8.0/product_variant_sale_price.

Your feedback are welcome!

[10.0] product_variant_supplierinfo JS crash in vendor pricelist

Enable Vendor Pricelist in Purchase, Go to Purchases / Purchase / Vendor Pricelist, try to add a variant. It raises the JS error below while accessing the variant selection.

Module works well through product variant view.

Error: KeyError: 'id'

http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1585
Retraçage :
getitem@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1585:161
getattr@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1586:64
getattribute@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1385:33
py.PY_getAttr@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1349:174
py.evaluate@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1452:8
py.evaluate@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1447:108
py.evaluate@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1449:96
py.eval@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1454:281
eval_domains/<@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1596:133
_.forEach@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:12:558
.mixin/</.prototype[name]@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:69:521
eval_domains@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1595:254
eval_domains/<@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1596:298
_.forEach@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:12:558
.mixin/</.prototype[name]@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:69:521
eval_domains@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1595:254
eval_domains/<@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1596:298
_.forEach@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:12:558
.mixin/</.prototype[name]@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:69:521
eval_domains@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1595:254
pyeval@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1609:24
eval_arg@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1612:61
ensure_evaluated@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1615:11
call@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1476:1
name_search@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:1751:1038
get_search_result@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:2214:25
source@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:2325:103
_search@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:1461:142
$.widget/</proxiedPrototype[prop]</<@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:1021:328
search@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:1461:8
$.widget/</proxiedPrototype[prop]</<@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:1021:328
$.widget.bridge/$.fn[name]/<@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:1026:13
each@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:370:758
each@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:358:636
$.widget.bridge/$.fn[name]@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:1023:248
render_editable/<@http://abimo:8069/web/content/13475-32770e5/web.assets_backend.js:2320:1041
dispatch@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:637:378
add/elemData.handle@http://abimo:8069/web/content/13433-04fa24e/web.assets_common.js:610:151

Migration to version 10.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-10.0

Modules to migrate

  • product_variant_available_in_pos
  • product_variant_cost_price - By @dcorio - #57
  • product_variant_csv_import
  • product_variant_multi - Removed as obsolete
  • product_variant_multi_advanced - Removed as obsolete
  • product_variant_configurator - By @chienandalu - #65
  • product_variant_supplierinfo - By @mourad-ehm - #50
  • product_variant_sale_price - By @dcorio - #56
  • product_variant_weight
  • purchase_variant_configurator - By @chienandalu - #66
  • purchase_variant_configurator_on_confirm - By @chienandalu - #67
  • sale_variant_configurator - By @chienandalu - #70
  • sale_stock_variant_configurator - By @chienandalu - #70
  • stock_picking_variant_mgmt - By @pedrobaeza - #84

[8.0] product_variant_cost_price computation fails with average cost_method

The costprice seems to be divided by number of variants..

Settings

  • Dutch accounting, anglo saxon accounting module installed
  • Product type set to Stockable,
  • Costing Method set to average cost,
  • Inventory Valuation: Realtime

Steps to reproduce:

  • Create One product (iMac)
  • Create Two variants (Quality New, Quality Refurbished)
  • Create one Purchase order, different prices for both products, one 100 euro, one 25 euro
  • Receive products

Result:
Costprice on the first product is 100 euro, this is expected.
Costprice on the second product is 12.50 euro, expected amount is 25 euro.

For an video, see https://www.youtube.com/watch?v=Xef1A3wxYKU

[10.0] Failed to write on multi record when product_default_variant_code is installed

@bealdav @PierrickBrun @Daniel-CA @chienandalu @gdgellatly @pedrobaeza

I have detected an issue with the module product_default_variant_code
Indeed the write on multi-record is broken.

If you take a look here : https://github.com/OCA/product-variant/blob/10.0/product_variant_default_code/models/product.py#L129 the code check "self.attribute_line_ids" or "self" can be a list of record.

I do not have the time to propose I fix right now. But maybe next week

Migration to version 11.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-11.0

Modules to migrate

  • product_variant_available_in_pos - By @SimoRubi - #102
  • product_variant_configurator - By @angelmoya - #100
  • product_variant_default_code - By @Daniel-CA - #91
  • product_variant_sale_price - By @SimoRubi - #103
  • product_variant_supplierinfo - Not needed anymore - Included in core
  • product_variant_template_data
  • purchase_order_variant_mgmt - By @javierjcf - #109
  • purchase_variant_configurator - By @ernestotejeda - #107
  • purchase_variant_configurator_on_confirm - By @ernestotejeda - #108
  • sale_order_line_variant_description
  • sale_order_variant_mgmt - By @pedrobaeza - #101
  • sale_variant_configurator - By @angelmoya - #105
  • sale_stock_variant_configurator Not needed anymore due to changes in core

[Question] Why is name_search used at Dimension type?

The name_search available at Product variant dimension type

class product_variant_dimension_type(orm.Model):
_name = "product.variant.dimension.type"

def name_search(self, cr, uid, name='', args=None, operator='ilike', context=None, limit=None):
    if not context.get('product_tmpl_id', False):
        args = None
    return super(product_variant_dimension_type,
                 self).name_search(cr, uid, '', args, 'ilike', None, None)

The name_search should have been

def name_search(self, cr, uid, name='', args=None, operator='ilike', context=None, limit=None):
    if not context.get('product_tmpl_id', False):
        args = None
    return super(product_variant_dimension_type,
                self).name_search(cr, uid, name=name, args=args, operator=operator, context=context, limit=limit)

Why is the parameter values cleared at the return statement of NAME_SEARCH method?

What is the reason to clear the DOMAIN or args in the name_search?
Is this done to handle some special case?

I had raised a question @ launchpad(https://answers.launchpad.net/openerp-product-variant/+question/253433). Since, the Management of the project has been moved to GitHub, I am resubmitting the question here.

[12.0][product_variant_sale_price] Bugs in the price calculation.

Good morning,
I found a bug, seven days ago, ith the unit of measure:
In a new DB, I have only installed sale_management and product_variant_sale_price modules, I have created a unit of measure "Three months" with factor_inv = 3.0.
The problem is that when I add a product in a sale.order.line, the calculation of price_unit is wrong.
The calculation is price = list_price * factor_inv, but if I install product_variant_sale_price this calculation is executed twice: price = (list_price * factor_inv)² .

This PR only remove the suspects lines of code: #164

Thanks a lot.

The following gif shows the problem.
2020-01-27

[10.0] Discusse on improving the user experience of product_variant_default_code

Hi I face to a UI issue with the module product_variant_default_code

When you try to create an new template, odoo will show you the "Internal Reference" see the capture
image

As the general information is the first tab the user will start here and fill the "Internal Reference" with the code he want to affect for this template.
Then the user will fill the information on the variant 'color, size'...

image

After saving the user expect to have the variant generated with the right code, but instead the code on the template have been remove !

image

In reality the code have been not remove because the user have filled the "internal_reference" (that we do not used in case of product.template with multiple variant) and now we are showing the "code_prefix". But in the point of view of the end user is very unuser-friendly.

I think we should always show the "code_prefix" then

  • when we create a template with multiple variant we will have no issue
  • when we create a template without variant we should copy the "code_prefix" inside the "internal_reference" of the product.product

In case we create a product.product directly (or we modify it) we should also update the code_prefix with the value of the "internal_reference"

Moreover when you are in the tree view of the product_template. We should show the prefix_code instead of the internal_reference in order to see the "code" of the template. And also filter on this field

The behavior I describe here was the existing behavior of the version 8 in product_code_builder https://github.com/OCA/product-attribute/tree/8.0/product_code_builder

What do you think?
@bealdav @pedrobaeza @Daniel-CA @gdgellatly @chienandalu @gurneyalex

Migration to version 12.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0

Modules to migrate

  • purchase_order_variant_mgmt - By @grindtildeath - #152
  • product_variant_available_in_pos
  • product_variant_configurator - By @ageficent - #146
  • product_variant_default_code - By @mikelarre #136
  • product_variant_sale_price - By @Yakulu - #130 By @cubells - #160
  • product_variant_specific_tax - By @alexeirivera87 - #225
  • purchase_variant_configurator
  • purchase_variant_configurator_on_confirm
  • sale_order_variant_mgmt - By @fuentes010 - #157
  • sale_variant_configurator - By @ageficent

10.0 sale order variant mgmt issue

Thanks for the effort for this amazing module.
Ive just noticed that the quantity total sum in the matrix doesnt calculate the accumulate of quantities between attribute values .
TOTAL SHOWING ZERO 0
Screenshot:
htps://ibb.co/gEdPBa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.