تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4610 أدوات العرض

I want add the same attribute to all matched items of an xpath query inside a  inherited qweb report template.

My code only change the colour of "1. aaa" to red. (the first matched item)

I can use "/*[@class='test_class'][2]" for the second item, but this is not a solution there are to many items with "test_class" inside the inherited report.

 

<template id="test_report_document_raw">

     <h2 class="test_class">1. aaa</h2>

     <h2 class="test_class">2. bbb</h2>

     <h2 class="test_class">3. ccc</h2>

     ...

</template>


<template id="test_report_document" inherit_id="test.test_report_document_raw" primary="True">

     <xpath expr="//*[@class='test_class']" position="attributes">

          <attribute name="style">color: red;</attribute>

       </xpath>

</template

الصورة الرمزية
إهمال

odoo will take the first one only !

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
فبراير 24
6945
4
يوليو 19
8140
1
فبراير 18
9472
0
مايو 17
3753
0
مايو 16
2781