Skip to Content
Menu
This question has been flagged
1 Reply
6161 Views
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

Avatar
Discard
Best Answer

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>
Avatar
Discard
Related Posts Replies Views Activity
1
Sep 21
2721
1
Mar 19
7337
3
Aug 22
2671
2
Oct 20
3062
0
May 20
1360