Commit Graph

4 Commits

Author SHA1 Message Date
Pedro M. Baeza
bbd3e0a2cb [FIX] base_comment_template: Consider multi-company and partners
In a multi-company context, if you put a template with company_id set,
this template is trying to be assigned to any document, no matter which
company it belongs, as it runs in a sudo environment, or at least, you
can have several companies seen at the same time.

We add the company discriminant for avoiding this problem.

Furthermore, the previous code was adding a domain where the right
part may be `False` with the operator `in`, provoking an unexpected
behavior in the search.

This has been fixed stating directly the expected domain.

TT42591
2023-04-20 09:05:57 +02:00
Mihai Fekete
9931623c40 [14.0] [FIX] Fix base comment template rendering. 2022-05-17 16:55:58 +03:00
João Marques
fee0f18049 [FIX] base_comment_template: Filter domain correctly
1. Safe eval domain before checking if it is defined. This makes [] be "False" on the first check, and provides the proper use case for when the domain is empty
2. Use filtered_domain in record instead of a search in self. When on a compute, we are on a NewId context, so the search would always fail

TT29309
2021-05-25 09:04:26 +01:00
Víctor Martínez
19b7692ee8 [IMP] base_comment_template: Refactor code and convert to Many2Many 2021-05-17 08:05:14 +02:00