议题审批
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
'description': 'Experience the Ease of Booking Meeting Rooms with Real-Time Availability Display.',
|
||||
'category': 'Services/Room',
|
||||
'version': '1.0',
|
||||
'depends': ['mail', 'hr'],
|
||||
'depends': ['mail', 'hr', 'documents'],
|
||||
'data': [
|
||||
'views/room_booking_views.xml',
|
||||
'views/room_room_views.xml',
|
||||
|
||||
@@ -21,19 +21,43 @@ class RoomBooking(models.Model):
|
||||
office_id = fields.Many2one(related="room_id.office_id", string="Office", readonly=True, store=True)
|
||||
company_id = fields.Many2one(related="room_id.company_id", string="Company", readonly=True, store=True)
|
||||
# pengyuthon
|
||||
meeting_type = fields.Selection([('up', '线上'), ('down', '线下')], string="会议类型", required=True)
|
||||
room_users_id = fields.Many2many('res.users', string="会议参加人员")
|
||||
meeting_note = fields.Text(string="会议纪要")
|
||||
is_notice = fields.Boolean(string="是否发布通知", default=True)
|
||||
meeting_type = fields.Selection([('up', '线上'), ('down', '线下')], default='down', string="会议类型", required=True)
|
||||
room_users_ids = fields.Many2many('res.users', string="会议参加人员")
|
||||
meeting_party_note = fields.Text(string="党之委会议纪要")
|
||||
party_documents_ids = fields.Many2many('documents.document', string="党之委会议纪要文件")
|
||||
meeting_class_note = fields.Text(string="班子会议纪要")
|
||||
class_documents_ids = fields.Many2many('documents.document', string="班子会议纪要文件")
|
||||
meeting_boss_note = fields.Text(string="董事会议纪要")
|
||||
boss_documents_ids = fields.Many2many('documents.document', string="董事会议纪要文件")
|
||||
meeting_sing_ids = fields.One2many('room.meeting.sign', 'room_booking_id', string="签到详情")
|
||||
meeting_data = fields.Html(string="会议说明")
|
||||
|
||||
|
||||
def meet_notice(self):
|
||||
pass
|
||||
|
||||
def meet_change_notice(self):
|
||||
pass
|
||||
|
||||
if self.is_notice:
|
||||
for user in self.room_users_ids:
|
||||
self.env['room.meeting.sign'].create({
|
||||
'room_booking_id': self.id,
|
||||
'sign_user_id': user.id,
|
||||
'sign_user_name': user.name,
|
||||
'user_type': 'insiders',
|
||||
'sign_type': 'no',
|
||||
})
|
||||
self.env['project.task'].create({
|
||||
'name': '您有新的预定的会议' + self.name + "请知晓",
|
||||
'user_ids': [(4, user.id)],
|
||||
})
|
||||
event = self.env['calendar.event'].create({
|
||||
'name': self.name,
|
||||
'start': self.start_datetime,
|
||||
'stop': self.stop_datetime,
|
||||
})
|
||||
for partner in self.room_users_ids.employee_ids:
|
||||
self.env['calendar.attendee'].create({
|
||||
'event_id': event.id,
|
||||
'partner_id': partner.address_id.id,
|
||||
})
|
||||
# 企业用户发送通知
|
||||
def meeting_sign_in(self):
|
||||
pass
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class RoomMeetingSign(models.Model):
|
||||
_description = "会议签到"
|
||||
|
||||
room_booking_id = fields.Many2one('room.booking', string="会议")
|
||||
|
||||
sign_user_id = fields.Many2one('res.users', string="人员")
|
||||
sign_user_name = fields.Char(string="人员")
|
||||
user_type = fields.Selection([('insiders', '内部人员'), ('outsiders', '外部人员')], default='no', string="人员类型")
|
||||
sign_type = fields.Selection([('no', '未签到'), ('yes', '已签到')], default='no', string="签到状态")
|
||||
|
||||
@@ -49,11 +49,11 @@ class Room(models.Model):
|
||||
for room in self:
|
||||
room.bookings_count = bookings_count_by_room.get(room, 0)
|
||||
|
||||
@api.depends("office_id")
|
||||
def _compute_display_name(self):
|
||||
super()._compute_display_name()
|
||||
for room in self:
|
||||
room.display_name = f"{room.office_id.name} - {room.name}"
|
||||
# @api.depends("office_id")
|
||||
# def _compute_display_name(self):
|
||||
# super()._compute_display_name()
|
||||
# for room in self:
|
||||
# room.display_name = f"{room.office_id.name} - {room.name}"
|
||||
|
||||
@api.depends("room_booking_ids")
|
||||
def _compute_is_available(self):
|
||||
|
||||
+10
-10
@@ -7,15 +7,15 @@
|
||||
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="room_room_comp_rule" model="ir.rule">
|
||||
<field name="name">Room Room MC Rule</field>
|
||||
<field name="model_id" ref="model_room_room"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
||||
</record>
|
||||
<!-- <record id="room_room_comp_rule" model="ir.rule">-->
|
||||
<!-- <field name="name">Room Room MC Rule</field>-->
|
||||
<!-- <field name="model_id" ref="model_room_room"/>-->
|
||||
<!-- <field name="domain_force">[('company_id', 'in', company_ids)]</field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="room_office_comp_rule" model="ir.rule">
|
||||
<field name="name">Room Office MC Rule</field>
|
||||
<field name="model_id" ref="model_room_office"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
||||
</record>
|
||||
<!-- <record id="room_office_comp_rule" model="ir.rule">-->
|
||||
<!-- <field name="name">Room Office MC Rule</field>-->
|
||||
<!-- <field name="model_id" ref="model_room_office"/>-->
|
||||
<!-- <field name="domain_force">[('company_id', 'in', company_ids)]</field>-->
|
||||
<!-- </record>-->
|
||||
</odoo>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 9.2 KiB |
@@ -1 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723540042195" class="icon" viewBox="0 0 1160 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3773" xmlns:xlink="http://www.w3.org/1999/xlink" width="226.5625" height="200"><path d="M954.135893 0.273067H206.39744C92.5696 0.273067 0 93.02016 0 206.984533V485.512533a26.2144 26.2144 0 1 0 52.4288 0V206.984533c0-85.03296 69.05856-154.2144 153.96864-154.2144h747.779413c84.896427 0 153.954987 69.18144 153.954987 154.2144V485.512533a26.2144 26.2144 0 0 0 52.401493 0V206.984533C1160.533333 93.006507 1067.977387 0.273067 954.135893 0.273067z m-10.990933 730.221226a26.282667 26.282667 0 0 0 1.59744 37.082454 198.628693 198.628693 0 0 1 64.047787 145.85856 26.2144 26.2144 0 1 0 52.442453 0c0-69.932373-29.559467-137.216-81.05984-184.538454a26.2144 26.2144 0 0 0-37.02784 1.59744z m-587.257173-19.456c7.181653-4.396373 12.397227-11.79648 12.834133-20.834986a26.2144 26.2144 0 0 0-24.94464-27.470507 114.879147 114.879147 0 0 1-109.568-114.947413c0-50.95424 34.133333-96.41984 83.012267-110.646614a26.2144 26.2144 0 0 0 17.844906-32.52224 26.200747 26.200747 0 0 0-32.453973-17.885866c-71.133867 20.6848-120.832 86.87616-120.832 161.027413 0 55.7056 27.07456 105.171627 69.044907 135.65952a248.99584 248.99584 0 0 0-151.552 229.94944 26.2144 26.2144 0 1 0 52.4288 0A196.840107 196.840107 0 0 1 342.316373 715.844267c5.188267-0.109227 9.611947-2.102613 13.571414-4.819627z m502.00576-324.266666a26.187093 26.187093 0 0 0-32.494934 17.885866 26.241707 26.241707 0 0 0 17.831254 32.508587c48.892587 14.226773 83.012267 59.706027 83.012266 110.660267a114.879147 114.879147 0 0 1-109.554346 114.93376 26.241707 26.241707 0 0 0 1.2288 52.483413h1.2288a167.3216 167.3216 0 0 0 159.552853-167.417173c0.027307-74.17856-49.657173-140.41088-120.804693-161.068374zM580.266667 305.93024c-115.152213 0-208.786773 93.7984-208.786774 209.114453 0 74.615467 39.348907 140.055893 98.208427 177.07008-119.425707 45.001387-204.8 160.262827-204.8 295.417174 0 14.513493 11.71456 26.241707 26.2144 26.241706 14.472533 0 26.228053-11.75552 26.228053-26.241706 0-145.2032 117.978453-263.3728 262.9632-263.3728 115.152213 0 208.827733-93.812053 208.827734-209.155414-0.027307-115.3024-93.743787-209.073493-208.85504-209.073493z m0 365.745493c-86.248107 0-156.38528-70.260053-156.38528-156.63104 0-86.38464 70.137173-156.603733 156.38528-156.603733 86.248107 0 156.38528 70.260053 156.38528 156.603733 0 86.370987-70.137173 156.63104-156.38528 156.63104z m176.114346 84.650667a26.282667 26.282667 0 0 0 1.59744 37.082453 264.260267 264.260267 0 0 1 85.224107 194.123094c0 14.513493 11.71456 26.241707 26.2144 26.241706 14.472533 0 26.2144-11.75552 26.2144-26.241706a317.0304 317.0304 0 0 0-102.222507-232.81664 26.228053 26.228053 0 0 0-37.02784 1.59744z" fill="#9E9E9E" p-id="3774"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723602249003" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2933" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M798.326 124.18H225.674c-87.158 0-158.064 70.964-158.064 158.183v213.171a20.07 20.07 0 0 0 20.08 20.07 20.09 20.09 0 0 0 20.08-20.07V282.363c0-65.08 52.88-118.016 117.904-118.016h572.682c65.02 0 117.894 52.936 117.894 118.016v213.171a20.086 20.086 0 0 0 20.09 20.07 20.06 20.06 0 0 0 20.05-20.07V282.363c0-87.214-70.88-158.183-158.064-158.183z m-8.423 558.828a20.111 20.111 0 0 0 1.224 28.39 151.936 151.936 0 0 1 49.055 111.622 20.07 20.07 0 1 0 40.161 0 192.282 192.282 0 0 0-62.075-141.23 20.096 20.096 0 0 0-28.365 1.218z m-449.746-14.889c5.5-3.359 9.503-9.032 9.83-15.949a20.06 20.06 0 0 0-19.107-21.017 87.946 87.946 0 0 1-83.907-87.962c0-38.999 26.138-73.8 63.58-84.685a20.07 20.07 0 0 0 13.66-24.883c-3.087-10.634-14.253-16.799-24.857-13.69-54.466 15.83-92.549 66.493-92.549 123.232 0 42.64 20.751 80.492 52.88 103.829-68.578 29.158-116.066 96.758-116.066 175.97a20.08 20.08 0 1 0 40.161 0A150.682 150.682 0 0 1 329.764 671.82c3.983-0.082 7.368-1.613 10.393-3.702z m384.451-248.166c-10.609-3.139-21.801 3.026-24.883 13.69s3.026 21.801 13.66 24.889c37.443 10.88 63.58 45.686 63.58 84.674a87.951 87.951 0 0 1-83.912 87.972 20.086 20.086 0 1 0 0.948 40.156h0.947c68.52-3.25 122.173-59.52 122.173-128.117 0.031-56.77-38.016-107.464-92.513-123.264z m-212.613-61.855c-88.187 0-159.898 71.793-159.898 160.03 0 57.12 30.137 107.193 75.213 135.522-91.458 34.442-156.84 122.65-156.84 226.089a20.055 20.055 0 0 0 20.08 20.08 20.096 20.096 0 0 0 20.08-20.08c0-111.13 90.348-201.57 201.39-201.57 88.187 0 159.924-71.787 159.924-160.06-0.026-88.244-71.798-160.006-159.95-160.011z m0 279.91c-66.043 0-119.762-53.77-119.762-119.88 0-66.099 53.719-119.838 119.762-119.838 66.048 0 119.767 53.77 119.767 119.839 0 66.12-53.72 119.88-119.767 119.88z m134.876 64.773a20.106 20.106 0 0 0 1.224 28.39 202.173 202.173 0 0 1 65.264 148.573c0 11.11 8.976 20.07 20.086 20.07a20.08 20.08 0 0 0 20.076-20.07c0-67.548-28.55-132.49-78.295-178.181-8.11-7.475-20.829-6.953-28.355 1.218z" p-id="2934" fill="#d3a964"></path></svg>
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -23,21 +23,21 @@
|
||||
<field name="model">room.booking</field>
|
||||
<field name="arch" type="xml">
|
||||
<gantt js_class="room_booking_gantt"
|
||||
date_start="start_datetime"
|
||||
date_stop="stop_datetime"
|
||||
default_group_by="room_id"
|
||||
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day:half', 'year': 'day:full'}"
|
||||
default_scale="day"
|
||||
dynamic_range="1"
|
||||
color="organizer_id"
|
||||
string="Bookings"
|
||||
plan="0">
|
||||
date_start="start_datetime"
|
||||
date_stop="stop_datetime"
|
||||
default_group_by="room_id"
|
||||
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day:half', 'year': 'day:full'}"
|
||||
default_scale="day"
|
||||
dynamic_range="1"
|
||||
color="organizer_id"
|
||||
string="Bookings"
|
||||
plan="0">
|
||||
<templates>
|
||||
<div t-name="gantt-popover">
|
||||
<div class="o_gantt_popover">
|
||||
<ul class="ps-1 mb-0 list-unstyled">
|
||||
<li>
|
||||
<strong>Organizer: </strong>
|
||||
<strong>Organizer:</strong>
|
||||
<t t-out="organizer_id[1]"/>
|
||||
</li>
|
||||
<li class="o_gantt_popover_content_item mt-2">
|
||||
@@ -57,7 +57,8 @@
|
||||
<field name="name">room.booking.view.calendar</field>
|
||||
<field name="model">room.booking</field>
|
||||
<field name="arch" type="xml">
|
||||
<calendar date_start="start_datetime" date_stop="stop_datetime" color="room_id" quick_create="0" event_open_popup="1">
|
||||
<calendar date_start="start_datetime" date_stop="stop_datetime" color="room_id" quick_create="0"
|
||||
event_open_popup="1">
|
||||
<field name="room_id"/>
|
||||
</calendar>
|
||||
</field>
|
||||
@@ -93,11 +94,11 @@
|
||||
<div class="oe_kanban_content">
|
||||
<ul class="ps-1 mb-0 list-unstyled">
|
||||
<li>
|
||||
<strong>Room: </strong>
|
||||
<strong>Room:</strong>
|
||||
<field name="room_id"/>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Date: </strong>
|
||||
<strong>Date:</strong>
|
||||
<field name="start_datetime"/>
|
||||
<i class="fa fa-long-arrow-right mx-1" title="Until"/>
|
||||
<field name="stop_datetime"/>
|
||||
@@ -125,8 +126,8 @@
|
||||
<sheet>
|
||||
<header>
|
||||
<button name="meet_notice" string="会议通知" type="object" class="oe_highlight"/>
|
||||
<button name="meet_change_notice" string="会议变更通知" type="object" class="oe_highlight"/>
|
||||
<button name="meeting_sign_in" string="签到" type="object" class="oe_highlight"/>
|
||||
<button name="meeting_sign_in" string="签到" invisible="meeting_type != 'down'" type="object"
|
||||
class="oe_highlight"/>
|
||||
</header>
|
||||
<div class="oe_title mb-3">
|
||||
<label for="name"/>
|
||||
@@ -138,11 +139,14 @@
|
||||
<group>
|
||||
<field name="room_id"/>
|
||||
<field name="stop_datetime" invisible="1"/>
|
||||
<field name="start_datetime" string="Date" widget="daterange" options="{'end_date_field': 'stop_datetime'}"/>
|
||||
<field name="start_datetime" string="Date" widget="daterange"
|
||||
options="{'end_date_field': 'stop_datetime'}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="organizer_id" widget="many2one_avatar_user"/>
|
||||
<field name="room_users_id" widget="many2many_tags"/>
|
||||
<field name="room_users_ids" widget="many2many_tags"/>
|
||||
<field name="meeting_type"/>
|
||||
<field name="is_notice"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
@@ -150,14 +154,22 @@
|
||||
<field name="meeting_sing_ids">
|
||||
<tree>
|
||||
<field name="room_booking_id" column_invisible="1"/>
|
||||
<field name="sign_user_id"/>
|
||||
<field name="sign_user_id" column_invisible="1"/>
|
||||
<field name="sign_user_name"/>
|
||||
<field name="user_type"/>
|
||||
<field name="sign_type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page name="note" string="会议纪要">
|
||||
<field name="meeting_note"/>
|
||||
<group>
|
||||
<field name="meeting_party_note"/>
|
||||
<field name="party_documents_ids"/>
|
||||
<field name="meeting_class_note"/>
|
||||
<field name="class_documents_ids"/>
|
||||
<field name="meeting_boss_note"/>
|
||||
<field name="boss_documents_ids"/>
|
||||
</group>
|
||||
</page>
|
||||
<page name="meeting_html" string="会议说明">
|
||||
<field name="meeting_data" widget="tinymce"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, tools
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
|
||||
class IssueLibrary(models.Model):
|
||||
@@ -12,7 +12,8 @@ class IssueLibrary(models.Model):
|
||||
name = fields.Char(string='议题事项')
|
||||
code = fields.Char(string='编号', required=True, copy=False,
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('issue_library_code'))
|
||||
statu = fields.Selection([('will', '待上会'), ('done', '已上会'), ('cancel', '已取消')], default='will', string="议题状态")
|
||||
statu = fields.Selection([('draft', '草稿'), ('approval', '审批中'), ('done', '已通过'), ('stop', '已拒绝'),
|
||||
('will', '待上会'), ('done', '已上会'), ('cancel', '已取消')], default='draft', string="议题状态")
|
||||
is_party = fields.Boolean(string="党之委会")
|
||||
is_class = fields.Boolean(string="班子会")
|
||||
is_boss = fields.Boolean(string="董事会")
|
||||
@@ -25,5 +26,23 @@ class IssueLibrary(models.Model):
|
||||
def issue_cancel(self):
|
||||
self.write({"statu": "cancel"})
|
||||
|
||||
def all_meting_issue(self):
|
||||
self.write({"statu": "done"})
|
||||
def all_meeting_issue(self):
|
||||
for meet in self:
|
||||
if meet.statu == 'done':
|
||||
raise UserError('不可重复上会')
|
||||
meet.write({"statu": "done"})
|
||||
issue_active_ids = self.env["issue.library"].browse(self._context.get('active_ids', self._context.get('active_id')))
|
||||
issue_library_data = [(0, 0, {'name': issue.name}) for issue in issue_active_ids]
|
||||
form_id = self.env.ref("room.room_booking_view_form").id
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"name": "会议安排",
|
||||
"res_model": "room.booking",
|
||||
"target": 'new',
|
||||
"views": [[form_id, "form"]],
|
||||
"context": {
|
||||
'default_issue_room_booking_ids': issue_library_data,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -90,11 +90,11 @@
|
||||
</record>
|
||||
|
||||
<record id="all_meting_issue" model="ir.actions.server">
|
||||
<field name="name">上会</field>
|
||||
<field name="name">批量上会</field>
|
||||
<field name="model_id" ref="yuthon_issue.model_issue_library"/>
|
||||
<field name="binding_model_id" ref="yuthon_issue.model_issue_library"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">records.all_meting_issue()</field>
|
||||
<field name="code">action = model.all_meeting_issue()</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
|
||||
Reference in New Issue
Block a user