upgrade-util icon indicating copy to clipboard operation
upgrade-util copied to clipboard

[IMP] util.remove_view : remove redundant t-calls

Open kmod-odoo opened this issue 1 year ago • 17 comments

While removing the view, removing the content having t-call in other views which  are calling to have the content of it.

As there are many specific fixes available for this [16776,15322,14413,13404,13325,12205,12335 etc..], it's better to handle  it in remove_view.

Before fix:

  • t-call with the same xml_id will remain in other views that are using it. So during access of that view, the system is raising an error "view not found."
<t name="Payment" t-name="website_sale.payment">
    <t t-call="website_sale.cart_summary"/>
</t>

After fix:

  • t-call will be removed, so no error will be raised.
<t name="Payment" t-name="website_sale.payment">
</t>

Traceback:

Error while render the template
ValueError: View 'website_sale.cart_summary' in website 1 not found
Template: website_sale.payment
Path: /t/t/div/div[1]/div/div[4]/div[1]/t
Node: <t t-call="website_sale.address_on_payment"/>

kmod-odoo avatar Jul 19 '24 12:07 kmod-odoo

Pull request status dashboard

robodoo avatar Jul 19 '24 12:07 robodoo

Thank you for your valuable input @diagnoza, @aj-fuentes and @KangOl. Changes have been done. Could you please confirm the changes?

kmod-odoo avatar Jul 29 '24 13:07 kmod-odoo

Note that t-call will also search for views whose key match. So we should also search for the key of the delete view (even if it hasn't any xmlid).

KangOl avatar Aug 05 '24 12:08 KangOl

Note that t-call will also search for views whose key match. So we should also search for the key of the delete view (even if it hasn't any xmlid).

Hello @KangOl, Changes were made. Could you please confirm them?

kmod-odoo avatar Aug 08 '24 09:08 kmod-odoo

upgradeci retry with always hr

KangOl avatar Aug 08 '24 14:08 KangOl

upgradeci retry with always hr

Hello @KangOl, matt is still failing due to accounting and other issues unrelated to this patch. Should I take any further action?

kmod-odoo avatar Aug 09 '24 09:08 kmod-odoo

Gentle reminder @KangOl

kmod-odoo avatar Aug 12 '24 09:08 kmod-odoo

upgradeci retry with always only hr

KangOl avatar Aug 12 '24 09:08 KangOl

`Thank you for your input, now all check seems green

kmod-odoo avatar Aug 12 '24 10:08 kmod-odoo

Can you please add a test?

KangOl avatar Aug 12 '24 11:08 KangOl

Hello @KangOl,

I have added unit test for remove_view. Could you please review it?

kmod-odoo avatar Aug 14 '24 10:08 kmod-odoo

Hello @KangOl, Just a gentle reminder to review this PR

kmod-odoo avatar Aug 20 '24 05:08 kmod-odoo

The key can be different from the xmlid. You need to handle the both.

KangOl avatar Aug 21 '24 13:08 KangOl

Hello @KangOl, Changes were made. Could you please confirm them?

kmod-odoo avatar Sep 04 '24 12:09 kmod-odoo

Hello @KangOl, Just a gentle reminder to review this PR

kmod-odoo avatar Sep 10 '24 05:09 kmod-odoo

Gentle reminder @KangOl

kmod-odoo avatar Sep 20 '24 13:09 kmod-odoo

Hello @KangOl Just a friendly reminder to review this PR cc: @aj-fuentes

kmod-odoo avatar Oct 10 '24 05:10 kmod-odoo

Hello @aj-fuentes, suggested changes done could you please have a look? thanks :)

kmod-odoo avatar Oct 14 '24 12:10 kmod-odoo

Thank you for your valuable input @aj-fuentes. Changes have been done. Could you please confirm the changes?

kmod-odoo avatar Oct 15 '24 12:10 kmod-odoo

Hello @KangOl, Just a gentle reminder to review this PR

kmod-odoo avatar Oct 22 '24 12:10 kmod-odoo

@KangOl Waiting for your final review as @aj-fuentes has approved this PR. Thanks!

kmod-odoo avatar Oct 28 '24 10:10 kmod-odoo

I would also adapt util.rename_xmlid to alter the t-call (we already change the key of the views).

KangOl avatar Oct 28 '24 12:10 KangOl

Hello @KangOl @aj-fuentes I have adapted the rename_xmlid method to handle t-call, t-value and t-name updates and added tests for it; could you please have a look? Thanks :)

kmod-odoo avatar Dec 02 '24 12:12 kmod-odoo

Hello @KangOl Just a gentle reminder to review this PR

kmod-odoo avatar Dec 10 '24 10:12 kmod-odoo

Hello @KangOl Just a friendly reminder to review this PR

cc: @aj-fuentes

kmod-odoo avatar Dec 19 '24 05:12 kmod-odoo

Hello @KangOl A gentle reminder, Could you please review this PR?

cc: @aj-fuentes

kmod-odoo avatar Jan 02 '25 11:01 kmod-odoo

Hello @KangOl, Just a friendly follow-up could you kindly review this PR?

cc: @aj-fuentes

kmod-odoo avatar Jan 06 '25 12:01 kmod-odoo

Hello @KangOl A gentle reminder, Could you please review this PR?

cc: @aj-fuentes

kmod-odoo avatar Jan 16 '25 12:01 kmod-odoo

Hello @aj-fuentes, Just a gentle reminder to have a look at this PR.

kmod-odoo avatar Jan 29 '25 09:01 kmod-odoo

The commits are out of sync. There is no point of having a commit only for the tests. Split it and move the corresponding test to each of the other two commits. I'm still hesitant on whether all commits can be squashed... IMO if we need to revert this we would probably want to revert it all. @KangOl wdyt?

aj-fuentes avatar Jan 29 '25 09:01 aj-fuentes