Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8753897

Browse files
committedNov 7, 2024·
[FIX] Module Awesome_Gallery setup creates error
=================== 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
1 parent b16e643 commit 8753897

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎awesome_gallery/models/ir_ui_view.py

+5
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ class View(models.Model):
66
_inherit = 'ir.ui.view'
77

88
type = fields.Selection(selection_add=[('gallery', "Awesome Gallery")])
9+
10+
def _get_view_info(self):
11+
infos = super()._get_view_info()
12+
infos['gallery'] = {'icon': 'fa fa-image'}
13+
return infos

‎awesome_gallery/views/views.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<record id="contacts.action_contacts" model="ir.actions.act_window">
55
<field name="name">Contacts</field>
66
<field name="res_model">res.partner</field>
7-
<field name="view_mode">kanban,tree,form,activity</field>
7+
<field name="view_mode">kanban,list,form,activity</field>
88
<field name="search_view_id" ref="base.view_res_partner_filter"/>
99
<field name="context">{'default_is_company': True}</field>
1010
<field name="help" type="html">

0 commit comments

Comments
 (0)
Please sign in to comment.