upgrade-util
upgrade-util copied to clipboard
[IMP] util.remove_view : remove redundant t-calls
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"/>
Thank you for your valuable input @diagnoza, @aj-fuentes and @KangOl. Changes have been done. Could you please confirm the changes?
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).
Note that
t-callwill also search for views whosekeymatch. So we should also search for thekeyof the delete view (even if it hasn't any xmlid).
Hello @KangOl, Changes were made. Could you please confirm them?
upgradeci retry with always hr
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?
Gentle reminder @KangOl
upgradeci retry with always only hr
`Thank you for your input, now all check seems green
Can you please add a test?
Hello @KangOl,
I have added unit test for remove_view. Could you please review it?
Hello @KangOl, Just a gentle reminder to review this PR
The key can be different from the xmlid. You need to handle the both.
Hello @KangOl, Changes were made. Could you please confirm them?
Hello @KangOl, Just a gentle reminder to review this PR
Gentle reminder @KangOl
Hello @KangOl Just a friendly reminder to review this PR cc: @aj-fuentes
Hello @aj-fuentes, suggested changes done could you please have a look? thanks :)
Thank you for your valuable input @aj-fuentes. Changes have been done. Could you please confirm the changes?
Hello @KangOl, Just a gentle reminder to review this PR
@KangOl Waiting for your final review as @aj-fuentes has approved this PR. Thanks!
I would also adapt util.rename_xmlid to alter the t-call (we already change the key of the views).
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 :)
Hello @KangOl Just a gentle reminder to review this PR
Hello @KangOl Just a friendly reminder to review this PR
cc: @aj-fuentes
Hello @KangOl A gentle reminder, Could you please review this PR?
cc: @aj-fuentes
Hello @KangOl, Just a friendly follow-up could you kindly review this PR?
cc: @aj-fuentes
Hello @KangOl A gentle reminder, Could you please review this PR?
cc: @aj-fuentes
Hello @aj-fuentes, Just a gentle reminder to have a look at this PR.
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?
