Skip to content

Conversation

livaios
Copy link
Contributor

@livaios livaios commented Mar 21, 2025

If prevent zero sale is active, prices should be hidden from the page

opw-4650460

See also: https://github.com/odoo/enterprise/pull/82082


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented Mar 21, 2025

Pull request status dashboard

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Mar 21, 2025
@livaios livaios marked this pull request as ready for review March 21, 2025 11:01
@livaios livaios force-pushed the 17.0-remove-price-prevent-zero-sale-liew branch from 80bf8b7 to b8f48e2 Compare March 21, 2025 13:37
@livaios livaios requested a review from Feyensv March 21, 2025 15:18
Copy link
Contributor

@Feyensv Feyensv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also remove the compare_list_price from the combination_info, as it'll be sent to the client even if it's not displayed, regardless of whether the section is there or not.

@livaios livaios force-pushed the 17.0-remove-price-prevent-zero-sale-liew branch from b8f48e2 to 66d45c0 Compare March 21, 2025 16:17
@livaios livaios requested a review from Feyensv March 24, 2025 11:54
@livaios livaios force-pushed the 17.0-remove-price-prevent-zero-sale-liew branch from 66d45c0 to 9b0fd81 Compare March 24, 2025 12:31
If prevent zero sale is active, prices should be hidden from the page

opw-4650460
@livaios livaios force-pushed the 17.0-remove-price-prevent-zero-sale-liew branch from 9b0fd81 to 8e18aaa Compare March 24, 2025 12:32
@livaios livaios requested a review from Feyensv March 24, 2025 12:33
Comment on lines +1321 to +1327
<div
t-if="not combination_info['prevent_zero_price_sale']"
itemprop="offers"
itemscope="itemscope"
itemtype="http://schema.org/Offer"
t-attf-class="product_price mt-2 mb-3 d-inline-block"
>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will also hide rental/subscription prices if the product sales price is 0 👀 (and the rental/sub prices aren't).
I believe we should update the overrides of _get_combination_info in website_sale_subscription and website_sale_renting to update prevent_zero_price_sale (it seems they never considered it at all :D).

Copy link
Contributor Author

@livaios livaios Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for website_sale_renting they hide the div anyways if its rental so there's no impact there

<xpath expr="//div[@itemprop='offers']" position="attributes">
        <attribute name="t-attf-class" separator=" " add="{{'o_hidden' if combination_info.get('is_rental') else ''}}"/>
</xpath>

I will add a check in website_sale_subscription so I can either leave website_sale_rental untouched or I can add the same check for consistency there as well what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, there is no issue with rental 👌
If it's not too complex, I'd say that the same check could be added in both modules to keep both logics similar.

Copy link
Contributor

@Feyensv Feyensv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robodoo delegate+

@livaios
Copy link
Contributor Author

livaios commented Mar 26, 2025

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 26, 2025
If prevent zero sale is active, prices should be hidden from the page

opw-4650460

closes #202867

Related: odoo/enterprise#82082
Signed-off-by: Lina Eweis (liew) <liew@odoo.com>
@robodoo robodoo closed this Mar 26, 2025
@fw-bot fw-bot deleted the 17.0-remove-price-prevent-zero-sale-liew branch April 2, 2025 11:24
@livaios
Copy link
Contributor Author

livaios commented Apr 2, 2025

Partially reverted in #204524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants