OCA / operating-unit

Manage Operating Units in Odoo
GNU Affero General Public License v3.0
72 stars 237 forks source link

[12.0,14.0] product_operating_unit: change default behaviour of 'product.template'._get_default_category_id() #602

Closed rmorant closed 7 months ago

rmorant commented 1 year ago

Conflict with odoo-pim/product_attribute_set Detected when try to install product demo data and product_attribute_set addon is installed. The demo data is not set. An error like this are raised when other addon, like product_attribute_set, use this function.

File "/opt/odoo/addons/product_attribute_set/models/product.py", line 31, in _get_default_att_set
  [("id", "=", default_categ_id_id.id)]
  AttributeError: 'int' object has no attribute 'id'

addon: product_operating_unit.

Bug

In all versions 'product.template' default behaviour:

>>> env['product.template']._get_default_category_id()
product.category(1,)

When product_operating_unit addon is installed:

>>> env['product.template']._get_default_category_id()
2023-07-03 07:14:47,368 1 INFO o14demo odoo.addons.product_operating_unit.models.product_template: Main Operating Unit 
1

Was introduced in issue #248

Expected behavior The default recordset object should be returned from _get_default_category_id()

github-actions[bot] commented 8 months 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.