跳至内容
菜单
此问题已终结
2 回复
23827 查看

Hello,


I want to add condition to base.xml that if i'm view some model then show me this code.

So i add t-if but it don't work:

my code add to base.xml :


<t t-if="widget.model == 'hr.recruitment.agency.skills'"> 

<div class="row">
   <div class="col-md-6">
       <h2>Test</h2>
       <p>Test Test Test Test Test Test </p>
   </div>    
</div>
      </t>


in


<t t-name="ControlPanel">
    <div class="oe-control-panel">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-6 oe-cp-title">
                    <ol class="oe-view-title breadcrumb">
                    </ol>
                </div>
                <div class="oe-cp-search-view col-md-6" />
            </div>
            <div class="row">
                <div class="col-md-6 oe-button-column">
                    <div class="oe-cp-buttons"></div>
                    <div class="oe-cp-sidebar"></div>
     
                </div>
                <div class="col-md-6">
                    <div class="oe-search-options btn-group"/>
                    <div class="oe-right-toolbar">
                        <div class="oe-cp-pager"></div>
                        <div class="oe-cp-switch-buttons btn-group btn-group-sm"></div>
                    </div>
                </div>
    
            </div>
   
           <t t-if="widget.model == 'hr.recruitment.agency.skills'"> 

<div class="row">
   <div class="col-md-6">
       <h2>Test</h2>
       <p>Test Test Test Test Test Test </p>
   </div>    
</div>
      </t>  

        </div>
    </div>
</t>


but this depends <t t-if="widget.model == 'hr.recruitment.agency.skills'">

don't work.


Any idea ?



形象
丢弃
最佳答案

Hi,

because widget.model undefine.

use widget.field_manager.dataset._model.name

or other depending on version odoo

形象
丢弃
编写者

Hi Shurshilov,

Thx for answer but I do not understand it :(

Can you show me some sample ?

Best regards,

Lukasz

编写者 最佳答案

Hi Shurshilov,


Thx for answer but I do not understand it :(

Can you show me some sample ?


Best regards,

Lukasz


形象
丢弃

<t t-if="widget.field_manager.dataset._model.name == 'hr.recruitment.agency.skills'">

say the version of the ode, this may depend on the code

编写者

@Shurshilov I use Odoo9

编写者

to be more accurate it's 9.0c

use <t t-if="widget.field_manager.dataset._model.name == 'hr.recruitment.agency.skills'">

编写者

Unfortunettly it don't work.

Page stuck on load: http://scr.hu/0e1mq/x9n8w

hmm, screenshot console onload page pls


24.11.2017, 17:01, "LukaszK" <lukaszkaptur.glosema@gmail.com>:

Unfortunettly it don't work.

Page stuck on load: http://scr.hu/0e1mq/x9n8w

--
LukaszK


Sent by Odoo S.A. using Odoo.

编写者

Hi @Shurshilov

Sorry for not response i was on holiday without access to internet.

So, it stuck like that: https://scr.hu/0e1mq/x9n8w

I upload my whole base.xml: https://www.pastiebin.com/5a2e610da3f06

Can you look for that ?

编写者

Added line 174-177

相关帖文 回复 查看 活动
1
3月 15
17533
2
1月 24
14689
2
12月 19
2607
2
3月 15
8253
1
3月 15
7839