2017-09-25 97 views
2

我與boolean_button部件如何更改boolean_button術語?

<button name="toggle_enable" type="object" class="oe_stat_button" icon="fa-unlink"> 
    <field name="enabled" widget="boolean_button" options='{"terminology": "active"}'/> 
</button> 

我試圖術語改爲定義按鈕導出/不導出,但我還沒有成功。有人能告訴我是否可以定義一個新術語?

回答

2

在Odoo V10,你可以做如下:

<div class="oe_button_box" name="button_box"> 
    <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-check-square" > 
     <field name="active" widget="boolean_button" options='{"terminology": { 
      "string_true": "Production Environment", 
      "hover_true": "Switch to test environment", 
      "string_false": "Test Environment", 
      "hover_false": "Switch to production environment" 
     }}'/> 
    </button> 
</div> 

但在Odoo V9,默認情況下它是不存在的。