Conversation
20b5b39 to
011c5d7
Compare
|
@carlosdauden Can you take a look here? |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
011c5d7 to
85cb9a7
Compare
…tner when partner is duplicated TT48358
… to managers TT51064
…martbutton. Before this commit, the assortments which where applied to the partner using the partner domain, where not shown.
85cb9a7 to
ad5eae7
Compare
| def _compute_all_partner_ids(self): | ||
| """Summarize selected partners and partners from partner domain field""" | ||
| for ir_filter in self: | ||
| for ir_filter in self.sudo(): |
There was a problem hiding this comment.
Not sure whether we should use compte_sudo or add self.sudo?
IMO compute_sudo is better
There was a problem hiding this comment.
"I’ve updated the field to use compute_sudo=True instead of adding .sudo() inside the loop. Since we are performing a search() on res.partner based on a dynamic domain, compute_sudo ensures the computation is consistent and avoids potential AccessErrors for non-admin users, while also being more performant for the Odoo cache."
product_assortment/models/ir_rule.py
Outdated
| "tuple(self._compute_domain_context_values())", | ||
| ), | ||
| ) | ||
| def _compute_domain(self, model_name, mode="read"): |
There was a problem hiding this comment.
IMO, the proper place will be the search method of ir.filters
There was a problem hiding this comment.
Good catch! refactored it. moved this logic to the _search method of ir.filters instead. This keeps the restriction scoped to the model itself and avoids the overhead of the global rule engine
Co-authored-by: BizzAppDev <bizzappdev@users.noreply.github.com>
16624a6 to
8a0ebc7
Compare
8a0ebc7 to
9f799da
Compare
Leftover migration from #1904