Skip to Content
Menu
This question has been flagged
5 Replies
5649 Views

below i have mentioned class, view and acl. please update the issue cause


class file:

class grievance_redressal(models.Model):
_name = 'grievance.redressal'

name = fields.Char('Name with Initial', size=64)

View:

<record id="view_grievance_redressal_form" model="ir.ui.view" >
<field name="name">grievance.redressal.form</field>
<field name="model">grievance.redressal</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Grievance Redressal" version="7.0">
<sheet>
<group>
<field name="name"/>
</group>
</sheet>
</form>
</field>
</record>

<record id="view_grievance_redressal_tree" model="ir.ui.view">
<field name="name">grievance.redressal.tree</field>
<field name="model">grievance.redressal</field>
<field name="arch" type="xml">
<tree string="Grievance Redressal">
<field name="name"/>
</tree>
</field>
</record>



<record id="action_grievance_redressal" model="ir.actions.act_window">
<field name="name">Grievance Redressal</field>
<field name="res_model">grievance.redressal</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
</record>



<menuitem action="action_grievance_redressal" id="grievance_redressal_menu" parent="operations" sequence="30"/>

ACL:

access_grievance_redressal_group_officer, access.grievance.redressal.group.officer, model_grievance.redressal, group_officer 1,0,0,0

if i've tried to add ACL for newly created model(grievance.redressal) in odoo. but is throws following error.

File "/home/user/Projects/test/test-server/openerp/service/server.py", line 885, in preload_registries
registry = RegistryManager.new(dbname, update_module=update_module)
File "/home/user/Projects/test/test-server/openerp/modules/registry.py", line 385, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/user/Projects/test/test-server/openerp/modules/loading.py", line 333, in load_modules
force, status, report, loaded_modules, update_module)
File "/home/user/Projects/test/test-server/openerp/modules/loading.py", line 237, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/home/user/Projects/test/test-server/openerp/modules/loading.py", line 156, in load_module_graph
_load_data(cr, module_name, idref, mode, kind='data')
File "/home/user/Projects/test/test-server/openerp/modules/loading.py", line 98, in _load_data
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
File "/home/user/Projects/test/test-server/openerp/tools/convert.py", line 846, in convert_file
convert_csv_import(cr, module, pathname, fp.read(), idref, mode, noupdate)
File "/home/user/Projects/test/test-server/openerp/tools/convert.py", line 914, in convert_csv_import
raise Exception(_('Module loading %s failed: file %s could not be processed:\n %s') % (module, fname, warning_msg))
Exception: Module loading test failed: file test/security/ir.model.access.csv could not be processed:
Line 1 : model+AF8-id
Avatar
Discard
Author

yes, i have already updated below mentioned acl header.

id, name, model_id:id, group_id:id, perm_read, perm_write, perm_create, perm_unlink

i' ve not experienced this kind of issues before. in my CSV file is almost having 4000 entries for different modules they are working fine

Not only the header, please see the below line also, seems you have a missed a coma anyway try with the below code

Author

thanks. that's correct i have missed comma after group_officer(group_id). but i have just listed ACL for other understanding purpose. currently i'm using libreoffice calc to edit CSV file, so there is no comma required as a separator. in this case every cell act as a seperator(,)

Best Answer

Hi,

Please update the CSV file by the following code,

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_grievance_redressal_group_officer,access.grievance.redressal.group.officer,model_grievance_redressal,group_officer,1,0,0,0


Thanks

Avatar
Discard
Author Best Answer

I have solved the issue. the problem is editing CSV in libreoffice is some time failed. when i edited CSV file in text editor is works fine. thanks

like acl in  above mentioned format

access_grievance_redressal_group_officer,access.grievance.redressal.group.officer,model_grievance_redressal,group_officer,1,0,0,0
Avatar
Discard
Related Posts Replies Views Activity
3
Jul 23
15019
0
Apr 23
1569
0
Apr 19
2212
2
Dec 18
6799
5
Aug 18
3088