Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] website_sale: retain rental period on attribute #165068

Closed

Conversation

rupa-odoo
Copy link
Contributor

@rupa-odoo rupa-odoo commented May 10, 2024

version - 16.0

Steps:
-Install rental app.
-Activate the date picker from the web-editor.
-Add the start date and end date from that.
-Select some attribute of the product.

Issue:
-When any user adds the start date and end date from the date picker and
after that, the user adds the other attribute(filter) of the product, that s>

Cause:
-The selected rental period (start and end dates) is not persisted when the
page refreshes or updates due to attribute selection.

Fix:
Get the value of 'start_date' and 'end_date'.
Update the hidden input fields for 'start_date' and 'end_date' with the
values before applying the attribute changes.

opw-3774060

@robodoo
Copy link
Contributor

robodoo commented May 10, 2024

Pull request status dashboard.

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label May 10, 2024
@rupa-odoo rupa-odoo requested review from kcv-odoo, chevalierv and a team June 11, 2024 09:20
@Feyensv Feyensv requested review from a team and removed request for a team June 11, 2024 14:33
@Feyensv
Copy link
Contributor

Feyensv commented Jun 11, 2024

@rupa-odoo please ping the right team, we have dedicated github teams for sale, loyalty, delivery, ecommerce, sales connector & payment.

@chevalierv
Copy link
Contributor

Hello @rupa-odoo

I'll wait for @kcv-odoo's review before taking a look at this :)

Have a nice day!

Copy link
Contributor

@kcv-odoo kcv-odoo left a comment

Choose a reason for hiding this comment

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

The issue is related to rental and your fix is in website_sale. Is your issue really related to eCom not rental?

About commit message:
First verb of title should be in first form not second you are proposing a fix as an PR so
your title should be like this This commit will {commit_title}
Also cause and fix part should not like this:
Cause: Traceback or issue occur Fix: Fix the trace back or issue
Cause should explain cause of issue what is root of that issue why it occur and may be add cause related commit or PR and Fix should explain your choices why your fix is best fix and why you did what you did this will save time of reviewer of PR also if someone look at your fix after some time they can easily understand it by reading commit message 🙂

Hope this helps 🙏

@rupa-odoo rupa-odoo force-pushed the 16.0-ecommerce-rental-period-filter-rupa branch from 536a178 to 7ae96d3 Compare June 19, 2024 06:45
@rupa-odoo
Copy link
Contributor Author

Note:
Hello @kcv-odoo 👋
I had moved my changes to the enterprise in website_sale_renting module
and here is this pr of that : https://github.com/odoo/enterprise/pull/64962

@rupa-odoo rupa-odoo closed this Jun 19, 2024
@rupa-odoo rupa-odoo deleted the 16.0-ecommerce-rental-period-filter-rupa branch June 19, 2024 07:08
@rupa-odoo rupa-odoo restored the 16.0-ecommerce-rental-period-filter-rupa branch June 21, 2024 06:41
@rupa-odoo rupa-odoo reopened this Jun 21, 2024
@rupa-odoo rupa-odoo force-pushed the 16.0-ecommerce-rental-period-filter-rupa branch from 7ae96d3 to 3e37429 Compare June 21, 2024 06:52
@rupa-odoo rupa-odoo changed the title [FIX] website_sale: fixed rental period doesn't work with filter [FIX] website_sale_renting: retain rental period on attribute Jun 21, 2024
@rupa-odoo rupa-odoo force-pushed the 16.0-ecommerce-rental-period-filter-rupa branch 2 times, most recently from 83b495d to db1b239 Compare June 21, 2024 07:02
@rupa-odoo rupa-odoo requested a review from kcv-odoo June 21, 2024 08:28
@rupa-odoo rupa-odoo changed the title [FIX] website_sale_renting: retain rental period on attribute [FIX] website_sale: retain rental period on attribute Jun 21, 2024
@rupa-odoo rupa-odoo force-pushed the 16.0-ecommerce-rental-period-filter-rupa branch from db1b239 to 9d903a6 Compare June 21, 2024 08:36
@rupa-odoo
Copy link
Contributor Author

rupa-odoo commented Jun 21, 2024

Note :
This fix will only work for the stable version.
If we want to fix for the master we should
-> We need to make a change in '_onChangeAttribute'.
-> Update the hidden input fields for 'start_date' and 'end_date' with the values before applying the attribute changes.

Copy link
Contributor

@kcv-odoo kcv-odoo left a comment

Choose a reason for hiding this comment

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

LGTM for stable

Copy link
Contributor

@chevalierv chevalierv left a comment

Choose a reason for hiding this comment

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

Hello @rupa-odoo

Thanks for your work on this fix!

Those changes should be done in website_sale_renting, as it only concerns renting period in a filter only available when website_sale_renting is installed. Could you adapt your changes?

Have a nice day!

Comment on lines 812 to 813
<input type="hidden" name="start_date" t-att-value="start_date"/>
<input type="hidden" name="end_date" t-att-value="end_date"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't solve the issue for existing clients as templates are only updated at upgrade. It will work for new customers though

@rupa-odoo rupa-odoo force-pushed the 16.0-ecommerce-rental-period-filter-rupa branch from 9d903a6 to 987c83f Compare July 3, 2024 12:27
@rupa-odoo
Copy link
Contributor Author

Hello @rupa-odoo

Thanks for your work on this fix!

Those changes should be done in website_sale_renting, as it only concerns renting period in a filter only available when website_sale_renting is installed. Could you adapt your changes?

Have a nice day!

Yes, Done the changes 👍
Thankyou

@rupa-odoo rupa-odoo requested a review from chevalierv July 3, 2024 12:31
@rupa-odoo rupa-odoo closed this Jul 3, 2024
@rupa-odoo rupa-odoo deleted the 16.0-ecommerce-rental-period-filter-rupa branch July 3, 2024 16:29
@kcv-odoo
Copy link
Contributor

kcv-odoo commented Jul 4, 2024

Hello @chevalierv 👋

I thought doing solution here in website_sale would be better because if we want to do it in website_sale_renting then we need upgrade exception because we need to add new template overriding this one.
I told @rupa-odoo to keep your solution only for stable and Improve it in forward port of master this way we don't need an upgrade exception 🤔

Or is it okay to ask for upgrade exception? 🤔

@chevalierv
Copy link
Contributor

Hello @kcv-odoo

Why do you think this would need an upgrade exception? IMO, we shouldn't do a bad fix to avoid exceptions, a good reason would be that the impact on the client is different (like with this ugly fix, clients don't need to upgrade the module to apply the fix)

@rupa-odoo rupa-odoo restored the 16.0-ecommerce-rental-period-filter-rupa branch July 5, 2024 08:52
@rupa-odoo rupa-odoo reopened this Jul 5, 2024
version - 16.0

Steps:
-Install rental app.
-Activate the date picker from the web-editor.
-Add the start date and end date from that.
-Select some attribute of the product.

Issue:
-When any user adds the start date and end date from the date picker and
after that, the user adds the other attribute(filter) of the product, that s>

Cause:
-The selected rental period (start and end dates) is not persisted when the
 page refreshes or updates due to attribute selection.

Fix:
Get the value of 'start_date' and 'end_date'.
Update the hidden input fields for 'start_date' and 'end_date' with the
values before applying the attribute changes.

opw-3774060
@rupa-odoo rupa-odoo force-pushed the 16.0-ecommerce-rental-period-filter-rupa branch from 987c83f to 42f51e2 Compare July 5, 2024 09:15
@chevalierv chevalierv marked this pull request as ready for review July 25, 2024 15:34
@chevalierv
Copy link
Contributor

@robodoo r+

@robodoo
Copy link
Contributor

robodoo commented Jul 25, 2024

@rupa-odoo @chevalierv 'ci/template' failed on this reviewed PR.

robodoo pushed a commit that referenced this pull request Jul 25, 2024
version - 16.0

Steps:
-Install rental app.
-Activate the date picker from the web-editor.
-Add the start date and end date from that.
-Select some attribute of the product.

Issue:
-When any user adds the start date and end date from the date picker and
after that, the user adds the other attribute(filter) of the product, that s>

Cause:
-The selected rental period (start and end dates) is not persisted when the
 page refreshes or updates due to attribute selection.

Fix:
Get the value of 'start_date' and 'end_date'.
Update the hidden input fields for 'start_date' and 'end_date' with the
values before applying the attribute changes.

opw-3774060

closes #165068

Related: odoo/enterprise#64962
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
@robodoo robodoo closed this Jul 25, 2024
@fw-bot fw-bot deleted the 16.0-ecommerce-rental-period-filter-rupa branch August 8, 2024 23:47
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.

6 participants