-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise-domain-advanced
42 lines (39 loc) · 1.74 KB
/
exercise-domain-advanced
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# HG changeset patch
# Parent 69d1f2d359eb8ef304a9d99f17790c78b35eda1a
Index: addons/openacademy/models.py
===================================================================
--- addons.orig/openacademy/models.py
+++ addons/openacademy/models.py
@@ -25,7 +25,8 @@
seats = fields.Integer(string="Number of seats")
instructor_id = fields.Many2one('res.partner', string="Instructor",
- domain=[('instructor', '=', True)])
+ domain=['|', ('instructor', '=', True),
+ ('category_id.name', 'ilike', "Teacher")])
course_id = fields.Many2one('openacademy.course',
ondelete='cascade', string="Course", required=True)
attendee_ids = fields.Many2many('res.partner', string="Attendees")
Index: addons/openacademy/views/partner.xml
===================================================================
--- addons.orig/openacademy/views/partner.xml
+++ addons/openacademy/views/partner.xml
@@ -29,4 +29,20 @@
parent="configuration_menu"
action="contact_list_action"/>
+ <record model="ir.actions.act_window" id="contact_cat_list_action">
+ <field name="name">Contact Tags</field>
+ <field name="res_model">res.partner.category</field>
+ <field name="view_mode">tree,form</field>
+ </record>
+ <menuitem id="contact_cat_menu" name="Contact Tags"
+ parent="configuration_menu"
+ action="contact_cat_list_action"/>
+
+ <record model="res.partner.category" id="teacher1">
+ <field name="name">Teacher / Level 1</field>
+ </record>
+ <record model="res.partner.category" id="teacher2">
+ <field name="name">Teacher / Level 2</field>
+ </record>
+
</odoo>