Skip to Content
Menu
This question has been flagged
1 Reply
1950 Views

the file code todo_access_rule.xml



<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">

<delete model="ir.rule"
search="[('id', 'in', ref('todo_app.todo_task_user_rule'))]" />

<record id="todo_task_per_user_rule" model="ir.rule">
<field name="name">ToDo Tasks only for owner</field>
<field name="model_id" ref="model_todo_task"/>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
<field name="domain_force">
['|',('user_id','in',[user.id,False]),
('message_follower_ids','in',[user.partner_id.id])
]
</field>
</record>

</data>
</openerp>


the following error is
2019-10-29 15:32:10,145 2137 INFO ? openerp: database hostname: localhost
2019-10-29 15:32:10,145 2137 INFO ? openerp: database port: 5432
2019-10-29 15:32:10,145 2137 INFO ? openerp: database user: odoo
2019-10-29 15:32:12,051 2137 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
2019-10-29 15:32:18,284 2137 INFO ? openerp.addons.bus.bus: Bus.loop listen imbus on db postgres
2019-10-29 15:32:20,019 2137 INFO ? openerp.addons.report.models.report: Will use the Wkhtmltopdf binary at /usr/bin/wkhtmltopdf
2019-10-29 15:32:20,799 2137 INFO ? openerp.http: HTTP Configuring static files
2019-10-29 15:32:20,813 2137 INFO test openerp.modules.loading: loading 1 modules...
2019-10-29 15:32:20,826 2137 INFO test openerp.modules.loading: 1 modules loaded in 0.01s, 0 queries
2019-10-29 15:32:21,028 2137 INFO test openerp.modules.loading: loading 32 modules...
2019-10-29 15:32:21,245 2137 INFO test openerp.modules.loading: 32 modules loaded in 0.22s, 0 queries
2019-10-29 15:32:21,846 2137 INFO test openerp.modules.loading: Modules loaded.
2019-10-29 15:32:21,848 2137 INFO test openerp.addons.base.ir.ir_http: Generating routing map
2019-10-29 15:32:22,059 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:32:22] "POST /calendar/notify HTTP/1.1" 200 -
2019-10-29 15:32:56,390 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:32:56] "POST /web/action/load HTTP/1.1" 200 -
2019-10-29 15:32:56,455 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:32:56] "POST /web/menu/load_needaction HTTP/1.1" 200 -
2019-10-29 15:32:56,521 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:32:56] "POST /web/dataset/call_kw/ir.module.module/fields_view_get HTTP/1.1" 200 -
2019-10-29 15:32:56,633 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:32:56] "POST /web/dataset/call_kw/ir.module.module/fields_get HTTP/1.1" 200 -
2019-10-29 15:32:56,658 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:32:56] "POST /web/dataset/call_kw/ir.module.module/fields_view_get HTTP/1.1" 200 -
2019-10-29 15:32:56,687 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:32:56] "POST /web/dataset/call_kw/ir.filters/get_filters HTTP/1.1" 200 -
2019-10-29 15:32:56,766 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:32:56] "POST /web/dataset/search_read HTTP/1.1" 200 -
2019-10-29 15:33:05,754 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:05] "POST /web/action/load HTTP/1.1" 200 -
2019-10-29 15:33:05,784 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:05] "POST /web/dataset/call_kw/base.module.upgrade/fields_view_get HTTP/1.1" 200 -
2019-10-29 15:33:05,828 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:05] "POST /web/dataset/call_kw/base.module.upgrade/default_get HTTP/1.1" 200 -
2019-10-29 15:33:05,845 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:05] "POST /web/dataset/call_kw/base.module.upgrade/onchange HTTP/1.1" 200 -
2019-10-29 15:33:07,231 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:07] "POST /web/dataset/call_kw/base.module.upgrade/create HTTP/1.1" 200 -
2019-10-29 15:33:07,248 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:07] "POST /web/dataset/call_kw/base.module.upgrade/search_read HTTP/1.1" 200 -
2019-10-29 15:33:07,290 2137 INFO test openerp.modules.loading: loading 1 modules...
2019-10-29 15:33:07,304 2137 INFO test openerp.modules.loading: 1 modules loaded in 0.01s, 0 queries
2019-10-29 15:33:07,676 2137 INFO test openerp.modules.loading: loading 32 modules...
2019-10-29 15:33:07,725 2137 INFO test openerp.modules.loading: 32 modules loaded in 0.05s, 0 queries
2019-10-29 15:33:08,300 2137 INFO test openerp.modules.loading: Modules loaded.
2019-10-29 15:33:08,302 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:08] "POST /web/dataset/call_button HTTP/1.1" 200 -
2019-10-29 15:33:08,319 2137 INFO test openerp.addons.base.ir.ir_http: Generating routing map
2019-10-29 15:33:08,363 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:08] "POST /web/menu/load_needaction HTTP/1.1" 200 -
2019-10-29 15:33:17,728 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:17] "POST /longpolling/poll HTTP/1.1" 200 -
2019-10-29 15:33:20,069 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:20] "POST /web/action/load HTTP/1.1" 200 -
2019-10-29 15:33:20,107 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:20] "POST /web/dataset/call_kw/base.module.update/fields_view_get HTTP/1.1" 200 -
2019-10-29 15:33:20,135 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:20] "POST /web/dataset/call_kw/base.module.update/default_get HTTP/1.1" 200 -
2019-10-29 15:33:20,149 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:20] "POST /web/dataset/call_kw/base.module.update/onchange HTTP/1.1" 200 -
2019-10-29 15:33:21,836 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:21] "POST /web/dataset/call_kw/base.module.update/create HTTP/1.1" 200 -
2019-10-29 15:33:21,849 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:21] "POST /web/dataset/call_kw/base.module.update/search_read HTTP/1.1" 200 -
2019-10-29 15:33:25,046 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:25] "POST /web/dataset/call_button HTTP/1.1" 200 -
2019-10-29 15:33:25,081 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:25] "POST /web/dataset/call_kw/base.module.update/search_read HTTP/1.1" 200 -
2019-10-29 15:33:25,094 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:25] "POST /web/menu/load_needaction HTTP/1.1" 200 -
2019-10-29 15:33:28,738 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:28] "POST /web/action/load HTTP/1.1" 200 -
2019-10-29 15:33:28,792 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:28] "POST /web/dataset/call_kw/ir.module.module/get_apps_server HTTP/1.1" 200 -
2019-10-29 15:33:39,618 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:39] "POST /web/webclient/version_info HTTP/1.1" 200 -
2019-10-29 15:33:39,689 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:39] "POST /web/dataset/call_kw/ir.module.module/search_read HTTP/1.1" 200 -
2019-10-29 15:33:46,191 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:46] "POST /web/action/load HTTP/1.1" 200 -
2019-10-29 15:33:46,238 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:46] "POST /web/dataset/call_kw/ir.module.module/fields_view_get HTTP/1.1" 200 -
2019-10-29 15:33:46,283 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:46] "POST /web/dataset/call_kw/ir.filters/get_filters HTTP/1.1" 200 -
2019-10-29 15:33:46,285 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:46] "POST /web/dataset/call_kw/ir.module.module/fields_get HTTP/1.1" 200 -
2019-10-29 15:33:46,298 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:46] "POST /web/dataset/call_kw/ir.module.module/fields_view_get HTTP/1.1" 200 -
2019-10-29 15:33:46,348 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:46] "POST /web/dataset/search_read HTTP/1.1" 200 -
2019-10-29 15:33:48,110 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:48] "POST /web/dataset/search_read HTTP/1.1" 200 -
2019-10-29 15:33:50,297 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:50] "POST /web/dataset/search_read HTTP/1.1" 200 -
2019-10-29 15:33:54,289 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:54] "POST /web/dataset/call_kw/ir.module.module/fields_view_get HTTP/1.1" 200 -
2019-10-29 15:33:54,395 2137 INFO ? werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:54] "GET /base/static/src/css/description.css HTTP/1.1" 200 -
2019-10-29 15:33:54,571 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:54] "POST /web/dataset/call_kw/ir.module.module/read HTTP/1.1" 200 -
2019-10-29 15:33:54,616 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:54] "POST /web/dataset/call_kw/ir.module.category/name_search HTTP/1.1" 200 -
2019-10-29 15:33:54,637 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:54] "POST /web/dataset/search_read HTTP/1.1" 200 -
2019-10-29 15:33:54,705 2137 INFO test werkzeug: 127.0.0.1 - - [29/Oct/2019 15:33:54] "POST /web/dataset/call_kw/ir.module.module.dependency/read HTTP/1.1" 200 -
2019-10-29 15:33:57,217 2137 INFO test openerp.modules.loading: loading 1 modules...
2019-10-29 15:33:57,227 2137 INFO test openerp.modules.loading: 1 modules loaded in 0.01s, 0 queries
2019-10-29 15:33:57,423 2137 INFO test openerp.modules.loading: loading 32 modules...
2019-10-29 15:33:57,738 2137 INFO test openerp.modules.module: module todo_user: creating or updating database tables
2019-10-29 15:33:57,777 2137 INFO test openerp.modules.loading: loading todo_user/views/todo_view.xml
2019-10-29 15:33:57,989 2137 INFO test openerp.modules.loading: loading todo_user/security/todo_access_rules.xml
2019-10-29 15:33:57,993 2137 WARNING test openerp.tools.convert: Skipping deletion for failed search `"[('id', 'in', ref('todo_app.todo_task_user_rule'))]"`
Traceback (most recent call last):
File "/home/odoo/odoo8/odoo/openerp/tools/convert.py", line 299, in _tag_delete
ids = self.pool[d_model].search(cr, self.uid, safe_eval(d_search, idref))
File "/home/odoo/odoo8/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/odoo/odoo8/odoo/openerp/models.py", line 1650, in search
return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
File "/home/odoo/odoo8/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/odoo/odoo8/odoo/openerp/models.py", line 4687, in _search
query = self._where_calc(cr, user, args, context=context)
File "/home/odoo/odoo8/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/odoo/odoo8/odoo/openerp/models.py", line 4500, in _where_calc
where_clause, where_params = e.to_sql()
File "/home/odoo/odoo8/odoo/openerp/osv/expression.py", line 1287, in to_sql
q, p = self.__leaf_to_sql(leaf)
File "/home/odoo/odoo8/odoo/openerp/osv/expression.py", line 1212, in __leaf_to_sql
raise ValueError("Invalid domain term %r" % (leaf,))
ValueError: Invalid domain term ('id', 'in', 31)

Avatar
Discard
Best Answer

Hello Jack,

In your domain Term operator 'in', will check the model "ir.rule"' record's id is present or not in list of right term, but the ref('todo_app.todo_task_user_rule') will return only integer not list.

by changing operator as '=' will resolve.

<delete model="ir.rule" search="[('id', '=', ref('todo_app.todo_task_user_rule'))]" />
Avatar
Discard
Author

thanks, it works