Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] product.template: name_search compatibility with product.product
In the rare places with a m2o field to product.template (e.g BoMs), it is necessary to be able to search on product codes, EAN, etc, the way it works on product.product. This is done by delegating the name_search to product.product and then returning the corresponding templates. This has a small penalty of executing name_get() twice, but is simpler and more robust for future changes. An alternative would have been to extract the name_search() method into a mixin and mix it on both product.product and product.template. However this would be more brittle and only work as long as the name_search implementation strictly uses fields that are present in both tables. OPW 626662
- Loading branch information