@@ -92,7 +92,6 @@
|
||||
<field name="employee_ids" widget="many2many_tags" options="{'no_create': True}" domain="[('department_id', 'in', department_ids)] if department_ids else [('company_id', '=', company_id)]"/>
|
||||
<field name="is_issues" invisible="is_issues == False"/>
|
||||
<field name="meal"/>
|
||||
<field name="documents_ids" widget="preview_many2many"/>
|
||||
<field name="details"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
</group>
|
||||
|
||||
@@ -6,7 +6,7 @@ from datetime import datetime, timedelta, date
|
||||
|
||||
class IssueLibrary(models.Model):
|
||||
_name = "issue.library"
|
||||
_description = '议题库'
|
||||
_description = '议题总库'
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_rec_name = 'name'
|
||||
|
||||
@@ -14,7 +14,7 @@ class IssueLibrary(models.Model):
|
||||
name_text = fields.Text(string='议题名称', compute='_compute_name', readonly=False)
|
||||
depart_opinions = fields.Text(string='部门意见')
|
||||
topic_content = fields.Text(string='事项背景')
|
||||
will_based = fields.Text(string='上会依据')
|
||||
will_based = fields.Text(string='上会依据', compute='_compute_will_based', readonly=False)
|
||||
deliberation_content = fields.Text(string='请示事项', default='建议同意')
|
||||
handling_situation = fields.Text(string='办理情况', help="(存在问题)")
|
||||
is_invisible_workflow = fields.Boolean(string="流程隐藏的判断")
|
||||
@@ -73,6 +73,34 @@ class IssueLibrary(models.Model):
|
||||
is_push_boss = fields.Boolean(string="董事推送")
|
||||
is_push_depart = fields.Boolean(string="部门推送")
|
||||
|
||||
@api.depends('issue_library_line_ids',
|
||||
'issue_library_line_ids.issue_approval_decision_id',
|
||||
'issue_library_line_ids.district_state_id',
|
||||
'issue_library_line_ids.district_government_id',
|
||||
'issue_library_line_ids.district_party_id')
|
||||
def _compute_will_based(self):
|
||||
for record in self:
|
||||
will_based_lines = []
|
||||
for idx, line in enumerate(record.issue_library_line_ids, start=1):
|
||||
decision_name = line.issue_approval_decision_id.specifics or ""
|
||||
district_state_name = line.district_state_id.name or ""
|
||||
district_government_name = line.district_government_id.name or ""
|
||||
district_party_name = line.district_party_id.name or ""
|
||||
field_parts = []
|
||||
if decision_name:
|
||||
field_parts.append(decision_name)
|
||||
if district_state_name:
|
||||
field_parts.append(f"区国资局({district_state_name})")
|
||||
if district_government_name:
|
||||
field_parts.append(f"区政府({district_government_name})")
|
||||
if district_party_name:
|
||||
field_parts.append(f"区委组织部({district_party_name})")
|
||||
if field_parts:
|
||||
line_content = f"{idx}.{','.join(field_parts)}"
|
||||
will_based_lines.append(line_content)
|
||||
|
||||
record.will_based = "\n".join(will_based_lines)
|
||||
|
||||
def correction(self):
|
||||
for rec in self:
|
||||
menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的议题')])
|
||||
@@ -99,13 +127,13 @@ class IssueLibrary(models.Model):
|
||||
def library_push(self):
|
||||
for rec in self:
|
||||
push_update_vals = {}
|
||||
if rec.is_party and rec.is_party_passed == 'reject' or not rec.is_party_passed:
|
||||
if rec.is_party and (rec.is_party_passed == 'reject' or not rec.is_party_passed):
|
||||
push_update_vals['is_push_party'] = True
|
||||
|
||||
elif rec.is_class and rec.is_class_passed == 'reject' or not rec.is_class_passed:
|
||||
elif rec.is_class and (rec.is_class_passed == 'reject' or not rec.is_class_passed):
|
||||
push_update_vals['is_push_class'] = True
|
||||
|
||||
elif rec.is_boss and rec.is_boss_passed == 'reject' or not rec.is_boss_passed:
|
||||
elif rec.is_boss and (rec.is_boss_passed == 'reject' or not rec.is_boss_passed):
|
||||
push_update_vals['is_push_boss'] = True
|
||||
|
||||
if push_update_vals:
|
||||
@@ -209,39 +237,45 @@ class IssueLibrary(models.Model):
|
||||
workflow_id.sudo().unlink()
|
||||
self.issue_approval_id.unlink()
|
||||
|
||||
|
||||
def all_issue_pull(self):
|
||||
issue_active_ids = self.env["issue.library"].browse(self._context.get('active_ids', self._context.get('active_id')))
|
||||
issue_active_ids = self.env["issue.library"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id'))
|
||||
)
|
||||
for i in issue_active_ids:
|
||||
if i.issue_state != 'draft':
|
||||
if i.issue_state not in ['draft', 'approval']:
|
||||
raise UserError("当前状态不允许提交")
|
||||
form_id = self.env.ref("yuthon_issue.issue_library_approval_form").id
|
||||
issue_decision_lines = []
|
||||
specifics_list = []
|
||||
if not issue_active_ids:
|
||||
issue_active_ids = self
|
||||
for issue_record in issue_active_ids:
|
||||
specifics_list.append(issue_record.name)
|
||||
issue_record.write({"issue_state": "approval"})
|
||||
issue_decision_lines.append((0, 0, {
|
||||
'issue_library_id': issue_record.id,
|
||||
'approval_decision_sequence': issue_record.approval_decision_sequence,
|
||||
'is_party': issue_record.is_party,
|
||||
'is_class': issue_record.is_class,
|
||||
'is_boss': issue_record.is_boss,
|
||||
'is_note': issue_record.is_note,
|
||||
'employee_id': issue_record.employee_id.id
|
||||
}))
|
||||
if len(specifics_list) > 1:
|
||||
name = ','.join(specifics_list)
|
||||
else:
|
||||
name = self.name
|
||||
|
||||
issue_approval_id = self.env['issue.approval'].create({
|
||||
'issue_approval_ids': issue_decision_lines,
|
||||
'name': name,
|
||||
})
|
||||
self.issue_approval_id = issue_approval_id
|
||||
existing_approval = self.env['issue.approval'].search([
|
||||
('issue_approval_ids.issue_library_id', 'in', issue_active_ids.ids),
|
||||
], limit=1)
|
||||
|
||||
specifics_list = [rec.name for rec in issue_active_ids]
|
||||
name = ','.join(specifics_list) if len(specifics_list) > 1 else (
|
||||
self.name or specifics_list[0] if specifics_list else "")
|
||||
|
||||
if existing_approval:
|
||||
issue_approval_id = existing_approval
|
||||
else:
|
||||
issue_decision_lines = []
|
||||
for issue_record in issue_active_ids:
|
||||
issue_record.write({"issue_state": "approval"})
|
||||
issue_decision_lines.append((0, 0, {
|
||||
'issue_library_id': issue_record.id,
|
||||
'approval_decision_sequence': issue_record.approval_decision_sequence,
|
||||
'is_party': issue_record.is_party,
|
||||
'is_class': issue_record.is_class,
|
||||
'is_boss': issue_record.is_boss,
|
||||
'is_note': issue_record.is_note,
|
||||
'employee_id': issue_record.employee_id.id
|
||||
}))
|
||||
|
||||
issue_approval_id = self.env['issue.approval'].create({
|
||||
'issue_approval_ids': issue_decision_lines,
|
||||
'name': name,
|
||||
})
|
||||
self.issue_approval_id = issue_approval_id
|
||||
|
||||
form_id = self.env.ref("yuthon_issue.issue_library_approval_form").id
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"name": "提交议题审批",
|
||||
@@ -255,7 +289,6 @@ class IssueLibrary(models.Model):
|
||||
}
|
||||
|
||||
def single_issue_pull(self):
|
||||
# 检查当前记录状态是否允许提交
|
||||
if self.issue_state != 'draft':
|
||||
raise UserError("当前状态不允许提交")
|
||||
|
||||
@@ -434,6 +467,7 @@ class IssueLibraryApprovalLine(models.Model):
|
||||
approval_date = fields.Datetime(string="创建日期")
|
||||
res_model = fields.Char(string="模型", compute='compute_issue_soong')
|
||||
res_id = fields.Char(string="id", compute='compute_issue_soong')
|
||||
department_id = fields.Many2one('hr.department', string='部门', compute='compute_issue_soong')
|
||||
|
||||
@api.depends('code')
|
||||
def compute_issue_soong(self):
|
||||
@@ -444,10 +478,17 @@ class IssueLibraryApprovalLine(models.Model):
|
||||
rec.res_model = workflow_record_id.res_model
|
||||
rec.res_id = workflow_record_id.res_id
|
||||
rec.workflow_name = workflow_record_id.name
|
||||
record_id = self.env[workflow_record_id.res_model].search([('id', '=', workflow_record_id.res_id)])
|
||||
if hasattr(record_id, 'user_id') and record_id.user_id:
|
||||
query_user_id = record_id.user_id
|
||||
elif hasattr(record_id, 'users_id') and record_id.users_id:
|
||||
query_user_id = record_id.users_id
|
||||
rec.department_id = query_user_id.employee_ids.department_id.id
|
||||
else:
|
||||
rec.approval_type = ''
|
||||
rec.res_model = ''
|
||||
rec.res_id = ''
|
||||
rec.department_id = ''
|
||||
rec.workflow_name = ''
|
||||
|
||||
def open_record(self):
|
||||
|
||||
@@ -8,12 +8,15 @@ class IssueMeetingMinutes(models.Model):
|
||||
_description = '会议纪要'
|
||||
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
|
||||
|
||||
name = fields.Char(string='名称')
|
||||
name = fields.Char(string='名称', compute='_compute_name')
|
||||
number_of_meetings = fields.Integer(string='会议次数')
|
||||
meeting_id = fields.Many2one('room.booking', string='会议名称', required=True)
|
||||
meeting_type_id = fields.Many2one('room.meeting.type', string="会议类型")
|
||||
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
|
||||
department_id = fields.Many2one(related='users_id.employee_ids.department_id', string="部门")
|
||||
company_id = fields.Many2one(related='users_id.employee_ids.company_id', string="公司")
|
||||
meeting_date = fields.Datetime(string="会议时间")
|
||||
user_id = fields.Many2one('res.users', string="记录人")
|
||||
room_users_ids = fields.Many2many('res.users', string="出席人员")
|
||||
host = fields.Many2one('hr.employee', string="主持人")
|
||||
code = fields.Char(string='编号', required=True, copy=False,
|
||||
@@ -31,17 +34,12 @@ class IssueMeetingMinutes(models.Model):
|
||||
|
||||
name_title = fields.Char(default=_get_default_name_title)
|
||||
|
||||
|
||||
computed_meeting_name = fields.Char(string='会议名称', compute='_compute_meeting_name')
|
||||
@api.depends('meeting_date', 'number_of_meetings', 'meeting_id.name')
|
||||
def _compute_meeting_name(self):
|
||||
for record in self:
|
||||
if record.meeting_date and record.meeting_id:
|
||||
year = record.meeting_date.year
|
||||
meeting_name = record.meeting_id.name
|
||||
record.computed_meeting_name = f"{meeting_name}【{year}】{record.number_of_meetings}号"
|
||||
else:
|
||||
record.computed_meeting_name = False
|
||||
@api.depends('number_of_meetings', 'meeting_id', 'meeting_type_id', 'meeting_date')
|
||||
def _compute_name(self):
|
||||
if self.number_of_meetings and self.meeting_id and self.meeting_type_id and self.meeting_date:
|
||||
self.name = self.number_of_meetings + ' ' + self.meeting_id.name + ' ' + self.meeting_type_id.name + ' ' + self.meeting_date
|
||||
else:
|
||||
self.name = ''
|
||||
|
||||
@api.constrains('meeting_id')
|
||||
def _check_meeting_id(self):
|
||||
@@ -49,6 +47,15 @@ class IssueMeetingMinutes(models.Model):
|
||||
if record.meeting_id:
|
||||
record.meeting_id.minutes_id = self.id
|
||||
|
||||
def open_record(self):
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": 'room.booking',
|
||||
"res_id": self.meeting_id.id,
|
||||
"name": '会议详情',
|
||||
"view_mode": "form",
|
||||
}
|
||||
|
||||
|
||||
class IssueMeetingMinutesLine(models.Model):
|
||||
_name = 'issue.meeting.minutes.line'
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<field name="name">issue.library.tree</field>
|
||||
<field name="model">issue.library</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="议题库"
|
||||
<tree string="议题总库"
|
||||
decoration-info="issue_state == 'will'"
|
||||
decoration-success="issue_state == 'done'"
|
||||
decoration-muted="issue_state == 'cancel'">
|
||||
@@ -77,11 +77,53 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_issue_library_department_tree" model="ir.ui.view">
|
||||
<field name="name">issue.library.tree</field>
|
||||
<field name="model">issue.library</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="部门议题库"
|
||||
decoration-info="issue_state == 'will'"
|
||||
decoration-success="issue_state == 'done'"
|
||||
decoration-muted="issue_state == 'cancel'">
|
||||
<header>
|
||||
<button name="all_issue_pull" string="提交议题审批" type="object"/>
|
||||
</header>
|
||||
<field name="name" column_invisible="1"/>
|
||||
<field name="name_text" class="list_width"/>
|
||||
<field name="department_id"/>
|
||||
<field name="is_party" groups="yuthon_salary.group_jtbb_user" string="党总支"/>
|
||||
<field name="is_party" groups="yuthon_salary.group_lc_user,yuthon_salary.group_wg_user" string="党支委会"/>
|
||||
<field name="party_char" />
|
||||
<field name="is_class"/>
|
||||
<field name="class_char"/>
|
||||
<field name="is_boss" groups="yuthon_salary.group_jtbb_user"/>
|
||||
<field name="boss_char"/>
|
||||
<field name="is_legal_trial"/>
|
||||
<field name="is_district_state"/>
|
||||
<field name="is_district_government"/>
|
||||
<field name="is_district_party"/>
|
||||
<field name="issue_state"/>
|
||||
<field name="code" column_invisible="1"/>
|
||||
<field name="company_id" column_invisible="1"/>
|
||||
<field name="creart_datetime" column_invisible="1"/>
|
||||
<field name="member_of_department" column_invisible="1"/>
|
||||
<field name="is_push_depart" column_invisible="1"/>
|
||||
<!-- <button name="single_issue_pull" string="提交" type="object" class="oe_highlight"/>-->
|
||||
<button name="library_push" string="推送" type="object" class="oe_highlight"/>
|
||||
<button name="revoke" string="撤销" type="object" class="oe_highlight" invisible="issue_state == 'draft'"/>
|
||||
<button name="issue_cancel" string="取消" type="object" class="oe_highlight"/>
|
||||
<button name="unlink" string="删除" type="object" class="oe_highlight"/>
|
||||
<button name="approval_details" string="审批详情" type="object" class="oe_highlight" invisible="issue_state == 'draft'"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_issue_library_form" model="ir.ui.view">
|
||||
<field name="name">issue.library.tree</field>
|
||||
<field name="model">issue.library</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="议题库" create="0">
|
||||
<form string="议题总库" create="0">
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
|
||||
invisible="urgency_level != 'normal'"/>
|
||||
@@ -181,6 +223,7 @@
|
||||
<field name="code"/>
|
||||
<field name="workflow_name"/>
|
||||
<field name="approval_type"/>
|
||||
<field name="department_id"/>
|
||||
<field name="approval_date"/>
|
||||
<button name="open_record" type="object" string="详情" class="btn-primary"/>
|
||||
</tree>
|
||||
@@ -239,7 +282,7 @@
|
||||
</record>
|
||||
|
||||
<record id="issue_library_action" model="ir.actions.act_window">
|
||||
<field name="name">议题库</field>
|
||||
<field name="name">议题总库</field>
|
||||
<field name="res_model">issue.library</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_issue_library_filter"/>
|
||||
@@ -354,6 +397,7 @@
|
||||
<field name="code"/>
|
||||
<field name="workflow_name"/>
|
||||
<field name="approval_type"/>
|
||||
<field name="department_id"/>
|
||||
<field name="approval_date"/>
|
||||
<button name="open_record" type="object" string="详情" class="btn-primary"/>
|
||||
</tree>
|
||||
@@ -508,6 +552,7 @@
|
||||
<field name="code"/>
|
||||
<field name="workflow_name"/>
|
||||
<field name="approval_type"/>
|
||||
<field name="department_id"/>
|
||||
<field name="approval_date"/>
|
||||
<button name="open_record" type="object" string="详情" class="btn-primary"/>
|
||||
</tree>
|
||||
@@ -652,6 +697,7 @@
|
||||
<field name="code"/>
|
||||
<field name="workflow_name"/>
|
||||
<field name="approval_type"/>
|
||||
<field name="department_id"/>
|
||||
<field name="approval_date"/>
|
||||
<button name="open_record" type="object" string="详情" class="btn-primary"/>
|
||||
</tree>
|
||||
@@ -698,6 +744,8 @@
|
||||
<field name="res_model">issue.library</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('member_of_department', '=', True), ('is_push_depart', '=', True)]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_issue.view_issue_library_department_tree')})]"/>
|
||||
</record>
|
||||
<record id="issue_library_my_action" model="ir.actions.act_window">
|
||||
<field name="name">我的议题</field>
|
||||
|
||||
@@ -42,15 +42,18 @@
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="meeting_id"/>
|
||||
<field name="users_id" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="is_back" invisible="1"/>
|
||||
<field name="meeting_id" invisible="1"/>
|
||||
<field name="host"/>
|
||||
<field name="room_users_ids" widget="many2many_tags"/>
|
||||
<field name="meeting_date"/>
|
||||
<field name="number_of_meetings"/>
|
||||
<field name="meeting_type_id"/>
|
||||
<field name="meeting_resolution"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="number_of_meetings" invisible="1"/>
|
||||
<button name="open_record" string="会议详情" type="object" class="btn btn-primary button_width"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
|
||||
@@ -5,7 +5,7 @@ from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
class IssueLibrary(models.Model):
|
||||
_inherit = "issue.library"
|
||||
_description = '议题库'
|
||||
_description = '议题总库'
|
||||
|
||||
relevancy_type = fields.Selection(selection_add=[('yuthon_official', '行政发文'),
|
||||
('yuthon_official_incoming_normal', '行政收文')],
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<button name="action_print_official"
|
||||
type="object"
|
||||
string="打印"
|
||||
class="btn-primary"/>
|
||||
class="btn-primary" invisible="not work_end"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="category_id" domain="[('parent_id', '=', False)]"/>
|
||||
<field name="pay_way"/>
|
||||
<field name="reason_text"/>
|
||||
<!-- <field name="reason_text"/>-->
|
||||
<!-- <field name="document_ids" widget="preview_many2many"/>-->
|
||||
<field name="is_back" invisible="1"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
<tree string="餐费" editable="bottom">
|
||||
<field name="select_year"/>
|
||||
<field name="select_time"/>
|
||||
<field name="employee_id" column_invisible="1"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="number_breakfasts"/>
|
||||
<field name="number_lunches"/>
|
||||
<field name="total_payment"/>
|
||||
<field name="company_id" column_invisible="1"/>
|
||||
<field name="toll_state"/>
|
||||
<button name="toll_confirm" string="确认已缴费" type="object" class="oe_highlight" invisibile="toll_state == 'done'"/>
|
||||
<button name="toll_confirm" string="确认已缴费" type="object" class="oe_highlight" confirm="注意:交完费了才点这个确认,是否确认?" invisible="toll_state == 'done'"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<field name="total_payment"/>
|
||||
<field name="company_id" column_invisible="1"/>
|
||||
<field name="toll_state"/>
|
||||
<button name="toll_confirm" string="确认已缴费" type="object" class="oe_highlight" invisibile="toll_state == 'done'"/>
|
||||
<button name="toll_confirm" string="确认已缴费" type="object" class="oe_highlight" confirm="注意:交完费了才点这个确认,是否确认?" invisible="toll_state == 'done'"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user