OCA / product-variant

GNU Affero General Public License v3.0
58 stars 264 forks source link

[13.0][bug] product_variant_configurator fails tests during build and causes error when creating variant #245

Closed matthew798 closed 2 years ago

matthew798 commented 2 years ago

Module

product_variant_configurator

Describe the bug

When installing the module on a dev branch on odoo.sh, the following errors occur during test:

02/03/2022 20:04:26 | ERROR | server | FAIL: TestSaleProductAttributeValueConfig.test_02_get_combination_info Traceback (most recent call last):   File "/home/odoo/src/odoo/addons/sale/tests/test_sale_product_attribute_value_config.py", line 281, in test_02_get_combination_info     self.assertEqual(res['display_name'], "Super Computer (8 GB, 1 To, Excluded)") AssertionError: 'Super Computer (256 GB, 8 GB, 1 To, Excluded)' != 'Super Computer (8 GB, 1 To, Excluded)' - Super Computer (256 GB, 8 GB, 1 To, Excluded) ?                 ^^^     ------ + Super Computer (8 GB, 1 To, Excluded) ?                 ^
-- | -- | -- | --
02/03/2022 20:04:30 | ERROR | server | Module sale: 1 failures, 0 errors

Furthermore, the following error occurs when trying to create a variant:

Odoo Server Error

Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/http.py", line 624, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/src/odoo/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/odoo/src/odoo/odoo/tools/pycompat.py", line 14, in reraise
    raise value
  File "/home/odoo/src/odoo/odoo/http.py", line 669, in dispatch
    result = self._call_function(**self.params)
  File "/home/odoo/src/odoo/odoo/http.py", line 350, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo/src/odoo/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/src/odoo/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/odoo/src/odoo/odoo/http.py", line 915, in __call__
    return self.method(*args, **kw)
  File "/home/odoo/src/odoo/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/src/odoo/addons/web/controllers/main.py", line 1342, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/src/odoo/addons/web/controllers/main.py", line 1334, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo/src/odoo/odoo/api.py", line 388, in call_kw
    result = _call_kw_model_create(method, model, args, kwargs)
  File "/home/odoo/src/odoo/odoo/api.py", line 368, in _call_kw_model_create
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-136>", line 2, in create
  File "/home/odoo/src/odoo/odoo/api.py", line 317, in _model_create_single
    return create(self, arg)
  File "/home/odoo/src/user/product_variant_configurator/models/product_product.py", line 160, in create
    for x in vals["product_attribute_ids"]
  File "/home/odoo/src/user/product_variant_configurator/models/product_product.py", line 160, in <listcomp>
    for x in vals["product_attribute_ids"]
KeyError: 'attribute_id'

The following modules are installed:

[mrp_flattened_bom_xlsx] [mrp_production_request] [product_multi_category] [purchase_request] [report_xlsx] [rma] [sale_order_line_date] [stock_available_unreserved] [web_one2many_kanban]

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. Create a fresh odoo installation
  2. Install the modules listed above
  3. Attempt to start the server
  4. Attempt to create a variant
github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.