Skip to content

Commit

Permalink
[FIX] Module Awesome_Gallery setup creates error
Browse files Browse the repository at this point in the history
===================
Steps to Reproduce:
===================

1. Checkout the origin/18.0 branch for the tutorial repo and install the Awesome_Gallery module.
2. Try to reconnect, you get and error with following traceback: `... File "/home/odoo/work/odoo/addons/web/models/ir_ui_view.py", line 14, in <dictcomp> 'icon': _view_info[type_]['icon'], KeyError: 'gallery' `
3. Try applying the first step of solution 6.1 from the origin/18.0-solutions branch. The error persists and you cannot do the tutorial.

==================
After this commit:
==================

The module can be installed without errors, and you can proceed with the tutorial without issues.
Note: The 18.0-solutions branch should be updated with the new v18 tutorial, which now focuses on the Contact app instead of the Awesome_Tshirt app.

task-xxxx
  • Loading branch information
CorentinVermeulen committed Nov 7, 2024
1 parent b16e643 commit 8753897
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions awesome_gallery/models/ir_ui_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ class View(models.Model):
_inherit = 'ir.ui.view'

type = fields.Selection(selection_add=[('gallery', "Awesome Gallery")])

def _get_view_info(self):
infos = super()._get_view_info()
infos['gallery'] = {'icon': 'fa fa-image'}
return infos
2 changes: 1 addition & 1 deletion awesome_gallery/views/views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<record id="contacts.action_contacts" model="ir.actions.act_window">
<field name="name">Contacts</field>
<field name="res_model">res.partner</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="view_mode">kanban,list,form,activity</field>
<field name="search_view_id" ref="base.view_res_partner_filter"/>
<field name="context">{'default_is_company': True}</field>
<field name="help" type="html">
Expand Down

0 comments on commit 8753897

Please sign in to comment.