[FW][IMP] website_event_meet: improve meeting room model
SPECIFICATIONS
Slightly improve meeting room model
* set chat room as required. Meeting rooms without chat room make no sense;
* allow to translate room summary. As this is displayed in frontend having
it translated makes sense;
* improve label of reached participants, allowing notably to display it
nicely in backend;
LINKS
Coming from internal feedback while deploying online support
Task ID-2314778
PR #55887
X-original-commit 54bd8281cf94ddee77073cf5d6356d847d08d024
This commit is contained in:
@@ -19,7 +19,8 @@ class EventMeetingRoom(models.Model):
|
||||
is_published = fields.Boolean(copy=True) # make the inherited field copyable
|
||||
event_id = fields.Many2one("event.event", string="Event", required=True, ondelete="cascade")
|
||||
is_pinned = fields.Boolean("Is Pinned")
|
||||
summary = fields.Char("Summary")
|
||||
chat_room_id = fields.Many2one("chat.room", required=True, ondelete="restrict")
|
||||
summary = fields.Char("Summary", translate=True)
|
||||
target_audience = fields.Char("Audience", translate=True)
|
||||
|
||||
@api.depends('name', 'event_id.name')
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<field name="is_pinned"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="chat_room_id"/>
|
||||
<field name="chat_room_id" required="0"/>
|
||||
<field name="room_participant_count" readonly="1"/>
|
||||
<field name="room_max_capacity" widget="radio" options="{'horizontal': true}"/>
|
||||
<field name="room_lang_id" options="{'no_create': True}"/>
|
||||
|
||||
@@ -30,7 +30,7 @@ class ChatRoomMixin(models.AbstractModel):
|
||||
room_max_capacity = fields.Selection(string="Max capacity", related="chat_room_id.max_capacity", readonly=False, required=True)
|
||||
room_participant_count = fields.Integer("Participant count", related="chat_room_id.participant_count", readonly=False)
|
||||
room_last_activity = fields.Datetime("Last activity", related="chat_room_id.last_activity")
|
||||
room_max_participant_reached = fields.Integer("Max participant reached", related="chat_room_id.max_participant_reached")
|
||||
room_max_participant_reached = fields.Integer("Peak participants", related="chat_room_id.max_participant_reached")
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, values_list):
|
||||
|
||||
Reference in New Issue
Block a user