[19.0][ADD] website_sale_tax_selection: website sale tax display partner preference#1258
Open
yankinmax wants to merge 1 commit into
Open
[19.0][ADD] website_sale_tax_selection: website sale tax display partner preference#1258yankinmax wants to merge 1 commit into
yankinmax wants to merge 1 commit into
Conversation
Ricardoalso
reviewed
Jul 2, 2026
5fd0e89 to
bbbd2e0
Compare
Ricardoalso
reviewed
Jul 3, 2026
There was a problem hiding this comment.
This description needs to be updated. Stating it will visually disable the website_tax_inclusion_setting is IMHO crucial
Comment on lines
+17
to
+27
| @api.depends("company_id.account_fiscal_country_id") | ||
| @api.depends_context("uid") | ||
| def _compute_show_line_subtotals_tax_selection(self): | ||
| # OVERRIDE: apply the current website partner tax display preference, | ||
| # when set, on top of the standard website behavior. | ||
| partner = self._get_current_website_tax_selection_partner() | ||
| if partner_tax_selection := partner.website_show_line_subtotals_tax_selection: | ||
| for website in self: | ||
| website.show_line_subtotals_tax_selection = partner_tax_selection | ||
| else: | ||
| return super()._compute_show_line_subtotals_tax_selection() |
There was a problem hiding this comment.
This will never trigger if partner.website_show_line_subtotals_tax_selection gets updated during the session 🤔
I would add something like this write override in res.partner:
def write(self, vals):
result = super().write(vals)
if "website_show_line_subtotals_tax_selection" in vals:
# The website's non-stored compute reads this field through the
# current request/env user's partner, a path `@api.depends` can't
# express, so its cache is never auto-invalidated on this write.
self.env["website"].invalidate_model(
["show_line_subtotals_tax_selection"]
)
return result
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow partners to specify how prices are displayed on the e-commerce website: tax excluded, tax included, or standard website behavior when no preference is set.
The website tax display field is made non-stored so it can be computed dynamically from the current website user’s partner, with contact preferences taking precedence over commercial entity preferences.