Skip to content

Commit

Permalink
[ADD] e_t_s_book: book providers
Browse files Browse the repository at this point in the history
  • Loading branch information
remytms committed Sep 18, 2024
1 parent 5a31671 commit 5b66b1b
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 4 deletions.
1 change: 1 addition & 0 deletions event_track_speaker_book/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from . import event_track
from . import event_track_speaker
from . import event_track_speaker_book
from . import event_track_speaker_book_provider
4 changes: 4 additions & 0 deletions event_track_speaker_book/models/event_track_speaker_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class EventTrackSpeakerBook(models.Model):
editor_id = fields.Many2one(comodel_name="res.partner", string="Editor")
user_id = fields.Many2one("res.users", string="Referent")
speaker_ids = fields.Many2many("event.track.speaker", string="Speakers")
provider_id = fields.Many2one(
"event.track.speaker.book.provider",
string="Provider",
)
status = fields.Selection(
selection=[
("asked", "Asked"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from odoo import fields, models


class EventTrackSpeakerBookProvider(models.Model):
_name = "event.track.speaker.book.provider"
_description = "Track Speaker Book Provider"

name = fields.Char()
2 changes: 2 additions & 0 deletions event_track_speaker_book/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_event_track_speaker_book_registration,event.track.speaker.book.user,event_track_speaker_book.model_event_track_speaker_book,event.group_event_registration_desk,1,0,0,0
access_event_track_speaker_book_user,event.track.speaker.book.user,event_track_speaker_book.model_event_track_speaker_book,event.group_event_user,1,1,1,1
access_event_track_speaker_book_provider_registration,event.track.speaker.book.provider.user,event_track_speaker_book.model_event_track_speaker_book_provider,event.group_event_registration_desk,1,0,0,0
access_event_track_speaker_book_provider_user,event.track.speaker.book.provider.user,event_track_speaker_book.model_event_track_speaker_book_provider,event.group_event_user,1,1,1,1
32 changes: 32 additions & 0 deletions event_track_speaker_book/views/event_track_speaker_book.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="view_event_track_speaker_book_tree" model="ir.ui.view">
<field name="name">event.track.speaker.book.tree</field>
<field name="model">event.track.speaker.book</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="author_ids" widget="many2many_tags" />
<field name="editor_id" />
<field name="user_id" />
<field name="speaker_ids" widget="many2many_tags" />
<field name="provider_id" />
<field name="status" />
</tree>
</field>
</record>

<record model="ir.ui.view" id="view_event_track_speaker_book_form">
<field name="name">event.track.speaker.book.form</field>
<field name="model">event.track.speaker.book</field>
Expand All @@ -30,6 +37,7 @@
<field name="editor_id" />
<field name="user_id" />
<field name="speaker_ids" widget="many2many_tags" />
<field name="provider_id" />
</group>
</group>
</sheet>
Expand All @@ -45,9 +53,33 @@
</field>
</record>

<record id="view_event_track_speaker_book_search" model="ir.ui.view">
<field name="name">event.track.speaker.book.search</field>
<field name="model">event.track.speaker.book</field>
<field name="arch" type="xml">
<search>
<field name="name" />
<field name="author_ids" />
<field name="editor_id" />
<field name="user_id" />
<field name="speaker_ids" />
<field name="provider_id" />
<separator />
<group expand="0" name="group_by" string="Group By">
<filter
name="provider_id"
string="Provider"
context="{'group_by' : 'provider_id'}"
/>
</group>
</search>
</field>
</record>

<record model="ir.actions.act_window" id="action_event_speaker_from_event">
<field name="res_model">event.track.speaker</field>
<field name="name">Event Speakers Books</field>
<field name="view_mode">tree,form,activity</field>
</record>

</odoo>
24 changes: 20 additions & 4 deletions event_track_speaker_book/views/menuitems.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
<?xml version="1.0" ?>
<odoo>
<record model="ir.actions.act_window" id="action_event_speakers">

<record model="ir.actions.act_window" id="action_event_track_speaker_book">
<field name="name">Books</field>
<field name="res_model">event.track.speaker.book</field>
<field name="view_mode">tree,form</field>
</record>

<record model="ir.actions.act_window" id="action_event_track_speaker_book_provider">
<field name="name">Book Providers</field>
<field name="res_model">event.track.speaker.book.provider</field>
<field name="view_mode">tree,form</field>
</record>

<menuitem
id="menu_event_speaker"
id="menu_event_track_speaker_book"
name="Track Speakers Books"
sequence="40"
action="action_event_speakers"
action="action_event_track_speaker_book"
parent="event.menu_event_configuration"
groups="base.group_no_one"
/>

<menuitem
id="menu_event_track_speaker_book_provider"
name="Track Speakers Book Providers"
action="action_event_track_speaker_book_provider"
parent="event.menu_event_configuration"
groups="base.group_no_one"
/>

</odoo>

0 comments on commit 5b66b1b

Please sign in to comment.