Skip to Content
Menu
This question has been flagged

Hi I'm new to Odoo and working on V11, I tried to inherit "hr_expense.hr_expense_form_view" and add a field called "new" into it. the "add" process seems done well (I can see the "new" field) but I got a TypeError: "'bool' object is not callable". Every time I click the Create button it shows up. Can somebody explain what happened and help me out, what I missed?

This is how I do the inheritance:

    <field name="model">hr.expense</field>

    <field name="inherit_id" ref="hr_expense.hr_expense_form_view"/>

    <field name="arch" type="xml">

        <xpath expr="//field[@name='date']" position="after">

            <field name="new" help="a new field after date field"/>

         </xpath>

     </field>

And this is my py file:

    class customize_expense(models.Model):

        _inherit = 'hr.expense'

        new = fields.Char()


Thanks a lot!

Avatar
Discard

Hello David, Can you please share the full error log here. Thank You

Author

For some reason I cant edit my question (403 error)

Anyway, this is my log information

Traceback (most recent call last):

File "C:\...\odoo\odoo\http.py", line 647, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "C:\...\odoo\odoo\http.py", line 307, in _handle_exception

raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

File "C:\...\odoo\odoo\tools\pycompat.py", line 87, in reraise

raise value

File "C:\...\odoo\odoo\http.py", line 689, in dispatch

result = self._call_function(**self.params)

File "C:\...\odoo\odoo\http.py", line 339, in _call_function

return checked_call(self.db, *args, **kwargs)

File "C:\...\odoo\odoo\service\model.py", line 97, in wrapper

return f(dbname, *args, **kwargs)

File "C:\...\odoo\odoo\http.py", line 332, in checked_call

result = self.endpoint(*a, **kw)

File "C:\...\odoo\odoo\http.py", line 933, in __call__

return self.method(*args, **kw)

File "C:\...\odoo\odoo\http.py", line 512, in response_wrap

response = f(*args, **kw)

File "C:\...\odoo\addons\web\controllers\main.py", line 930, in call_kw

return self._call_kw(model, method, args, kwargs)

File "C:\...\odoo\addons\web\controllers\main.py", line 922, in _call_kw

return call_kw(request.env[model], method, args, kwargs)

File "C:\...\odoo\odoo\api.py", line 689, in call_kw

return call_kw_multi(method, model, args, kwargs)

File "C:\...\odoo\odoo\api.py", line 680, in call_kw_multi

result = method(recs, *args, **kwargs)

File "C:\...\odoo\odoo\models.py", line 4973, in onchange

record = self.new(values)

TypeError: 'bool' object is not callable

Author

Anyone can help pls?

Related Posts Replies Views Activity
1
Aug 24
421
2
Nov 24
752
1
Oct 23
290
3
Oct 23
13197
2
Aug 23
1225