Skip to Content
Menu
This question has been flagged
2 Replies
2040 Views

Here's the error message:

Odoo Server Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 677, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 333, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 326, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 935, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 506, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 885, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 877, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 687, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 672, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 1594, in name_search
    return self._name_search(name, args, operator, limit=limit)
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 1607, in _name_search
    ids = self._search(args, limit=limit, access_rights_uid=access_rights_uid)
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 4215, in _search
    query = self._where_calc(args)
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 4014, in _where_calc
    e = expression.expression(domain, self)
  File "/usr/lib/python2.7/dist-packages/odoo/osv/expression.py", line 640, in __init__
    self.expression = distribute_not(normalize_domain(domain))
  File "/usr/lib/python2.7/dist-packages/odoo/osv/expression.py", line 204, in normalize_domain
    assert expected == 0, 'This domain is syntactically not correct: %s' % (domain)
AssertionError: This domain is syntactically not correct: [('active', '=', 1), u'|', u'name']

I wanna add a pickup list column which listed Project Name in Journal entry line (for record project relate cost as reference).

Here's what I do:

  1. Add custom field x_project_name
    Type: many2one
    Model: Journal Item
    Object Relation: project.project

  2. add the bold line  in "Form View" of "account.move.form" as below:
    <notebook>
                            <page string="Journal Items">
                                <field name="line_ids" widget="one2many_list" context="{'line_ids': line_ids, 'journal_id': journal_id }">
                                    <tree editable="bottom" string="Journal Items">
                                        <field name="account_id" domain="[('company_id', '=', parent.company_id), ('deprecated', '=', alse)]"/>
                                        <field name="partner_id" domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"/>
                                        <field name="name"/>
                                        <field name="x_dept_name" domain="['|', ('parent_id', '=', False), ('name', '=', True)]"/>
                                        <field name="x_project_name" domain="['|', ('name', '=', True))]"/>
                                        <field name="x_dept"/>
                                        <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
                                        <field name="amount_currency" groups="base.group_multi_currency"/>
                                        <field name="company_currency_id" invisible="1"/>
                                        <field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency"/>
                                        <field name="debit" sum="Total Debit"/>
                                        <field name="credit" sum="Total Credit"/>
                                        <field name="date_maturity" required="0"/>
                                    </tree>
                                </field>
                                <field name="narration" colspan="4" placeholder="Add an internal note..." nolabel="1" height="50"/>
                            </page>
    </notebook>

Can anyone tell me where did I make mistake?

Avatar
Discard

try changing this domain <field name="x_project_name" domain="['|', ('name', '=', True))]"/> to domain="[('name', '=', True)]"/>

Author

Hi Mohammed,

After changing line to "<field name="x_project_name" domain="['|', ('name', '=', True))]"/>", I got error message as below:

Odoo Server Error

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 640, in _handle_exception

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

File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 677, in dispatch

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

File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 333, in _call_function

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

File "/usr/lib/python2.7/dist-packages/odoo/service/model.py", line 101, in wrapper

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

File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 326, in checked_call

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

File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 935, in __call__

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

File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 506, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 885, in call_kw

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

File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 877, in _call_kw

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

File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 687, in call_kw

return call_kw_model(method, model, args, kwargs)

File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 672, in call_kw_model

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

File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 1594, in name_search

return self._name_search(name, args, operator, limit=limit)

File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 1607, in _name_search

ids = self._search(args, limit=limit, access_rights_uid=access_rights_uid)

File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 4215, in _search

query = self._where_calc(args)

File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 4014, in _where_calc

e = expression.expression(domain, self)

File "/usr/lib/python2.7/dist-packages/odoo/osv/expression.py", line 640, in __init__

self.expression = distribute_not(normalize_domain(domain))

File "/usr/lib/python2.7/dist-packages/odoo/osv/expression.py", line 204, in normalize_domain

assert expected == 0, 'This domain is syntactically not correct: %s' % (domain)

AssertionError: This domain is syntactically not correct: [('active', '=', 1), u'|', [u'name', u'=', True]]

Author Best Answer

Hi Mohammed,

After changing line to "<field name="x_project_name" domain="['|', ('name', '=', True))]"/>", I got error message as below:

Odoo Server Error

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 677, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 333, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 326, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 935, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 506, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 885, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 877, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 687, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 672, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 1594, in name_search
    return self._name_search(name, args, operator, limit=limit)
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 1607, in _name_search
    ids = self._search(args, limit=limit, access_rights_uid=access_rights_uid)
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 4215, in _search
    query = self._where_calc(args)
  File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 4014, in _where_calc
    e = expression.expression(domain, self)
  File "/usr/lib/python2.7/dist-packages/odoo/osv/expression.py", line 640, in __init__
    self.expression = distribute_not(normalize_domain(domain))
  File "/usr/lib/python2.7/dist-packages/odoo/osv/expression.py", line 204, in normalize_domain
    assert expected == 0, 'This domain is syntactically not correct: %s' % (domain)
AssertionError: This domain is syntactically not correct: [('active', '=', 1), u'|', [u'name', u'=', True]]
Avatar
Discard