'Create Button is not showing up after following the Odoo Tutorial when creating a new module
I am in the process of learning to develop Odoo and started by following this tutorial https://www.odoo.com/documentation/15.0/developer/howtos/rdtraining/06_firstui.html . Currently I am stuck on chapter 6.
I created a estate_menus.xml file and a estate_property_views.xml file in the views folder. My code looks like that:
estate_property_views.xml
<?xml version="1.0"?>
<odoo>
<record id="estate_property_action" model="ir.actions.act_window">
<field name="name">Properties</field>
<field name="res_model">estate.property</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new property
</p>
</field>
</record>
</odoo>
#estate_menus.xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="estate_menu_root" name="Real Estate">
<menuitem id="estate_first_level_menu" name="Advertisements">
<menuitem id="estate_menu_action" action="estate_property_action"/>
</menuitem>
</menuitem>
</odoo>
This is my manifest file:
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'Estate',
'application': True,
'depends' : ['base'],
'data': [
'security/ir.model.access.csv',
'views/estate_property_views.xml',
'views/estate_menus.xml',
]
}
Everything looks fine except the Create button is missing and I have no idea why. Could you give me hint in which file I made a mistake? Thank you very much!
I tried the code above but the button is still missing.
Solution 1:[1]
In Chapter 5, you have created the access rights for your model and as per tutorial
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_test_model,access_test_model,model_test_model,base.group_user,1,0,0,0
You have given only read access to base.group_user
so you can modify your ir.model.access.csv
and you can give write and create and unlink access as below:
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_test_model,access_test_model,model_test_model,base.group_user,1,1,1,1
Solution 2:[2]
I have had the same problem. For the moment, I solved it by unifying both files.
Also try creating the estate_menus.xml
file with nothing inside, just:
<odoo></odoo>
and i have the same problem.
I'm still looking for the correct answer. Greetings
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Jeremy Caney |
Solution 2 |