콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
6998 화면
blacklist = fields.Boolean(string="Blacklist")

in xml file


<button name="blacklist" type="object" class="oe_inline oe_stat_button" icon="fa-check">

<field name="blacklist" widget="boolean_button" options="{'terminology':{

'string_true': 'Blacklist',

'hover_true': 'Blacklist',

'string_false': 'Active',

'hover_false': 'Active'

}}"/>

</button>

Error is

 File "/odoo12c/odoo12c-server/odoo/api.py", line 749, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/odoo12c/odoo12c-server/odoo/api.py", line 733, in _call_kw_multi
    context, args, kwargs = split_context(method, args, kwargs)
  File "/odoo12c/odoo12c-server/odoo/api.py", line 295, in split_context
    pos = len(getargspec(method).args) - 1
  File "/usr/lib/python3.6/inspect.py", line 1078, in getargspec
    getfullargspec(func)
  File "/usr/lib/python3.6/inspect.py", line 1130, in getfullargspec
    raise TypeError('unsupported callable') from ex
TypeError: unsupported callable

아바타
취소
베스트 답변

Hello,

You can use below code :

<button name="blacklist_button_name" type="object" class="oe_stat_button" icon="fa-check-square">
<field name="blacklist" widget="boolean_button" options='{"terminology": {
"string_true": "Blacklist",
"hover_true": "Blacklist",
"string_false": "Active",
"hover_false": "Active"
}}'/>
</button>
아바타
취소
관련 게시물 답글 화면 활동
1
9월 21
3810
1
3월 19
8480
3
8월 22
2672
2
10월 20
4113
0
5월 20
2295