Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3352 มุมมอง

I want to change the save button icon from fa-cloud-upload to fa-save.

Found the original code in /web/static/src/views/form/form_status_indicator/form_status_indicator.xml

                    type="button"
                    class="o_form_button_save btn btn-light py-0"
                    t-att-disabled="props.isDisabled"
                    data-hotkey="s"
                    t-on-click.stop="save"
                    data-tooltip="Save manually"
                    aria-label="Save manually">
                   

               


I don't want to inherit by replace the whole block, to just change one line.

Is the i tag a attribute? I tried using name and string, both failed.

So is there a method to change just the  i class part

Thank you!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello youring,

Yes, It is possible. You just need to write xpath like below.

Please Find code in comment. 


Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

อวตาร
ละทิ้ง

Code :-
<xpath expr="//button[@@data-tooltip='Save manually']//i[hasclass('fa-cloud-upload')]" position="attributes">
<attribute name="class" remove="fa-cloud-upload"/>
<attribute name="class" add="fa-save" separator=" "/>
</xpath>

ผู้เขียน

Hi Jainesh, thanks for your quick answer. I changed as below, it worked!
<xpath expr="//button[hasclass('o_form_button_save')]/i" position="attributes">
<attribute name="class" remove="fa-cloud-upload" add="fa-save" separator=" "/>
</xpath>

คำตอบที่ดีที่สุด

Can you share complete xml code? How did you inherit the template? I am using the same code but cannot inherit the base template. Kindly help asap!! 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 24
8796
1
พ.ย. 24
3967
3
ต.ค. 24
1186
1
พ.ย. 23
1402
1
มี.ค. 15
6586