!7613 添加功能

Merge pull request !7613 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2026-01-06 07:10:40 +00:00
committed by Gitee
7 changed files with 25 additions and 9 deletions
@@ -878,10 +878,7 @@ class VacationLeaveLine(models.Model):
if vals.get('update_type') == 'reduce' and vals.get('vacation_id'):
vacation_main = self.env['yuthon.vacation.reports'].browse(vals['vacation_id'])
deduct_amount = vals.get('update_lines', 0.0)
if not vacation_main or deduct_amount <= 0:
return super(VacationLeaveLine, self).create(vals)
deduct_amount = vals.get('update_lines', 0.0) / 8
if vacation_main:
used_this_year_new = vacation_main.used_this_year + deduct_amount
+1 -1
View File
@@ -244,7 +244,7 @@ class IssueLibrary(models.Model):
self.issue_approval_id = issue_approval_id
return {
"type": "ir.actions.act_window",
"name": "批量提交",
"name": "提交议题审批",
"res_model": "issue.approval",
"views": [[form_id, "form"]],
"res_id": issue_approval_id.id,
+3 -3
View File
@@ -45,9 +45,9 @@
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>-->
<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="is_party" groups="yuthon_salary.group_jtbb_user" string="党总支"/>
+16
View File
@@ -57,6 +57,7 @@ class YuthonOfficial(models.Model):
issue_library_ids = fields.One2many('issue.library', 'yuthon_official_id', string="议题关联")
work_end = fields.Boolean(string="结束")
official_state = fields.Selection([('to_do', '待转'), ('done', '已转')], string="状态")
sub_id = fields.Many2one('yuthon.sub.enterprises', string="文件处理流程")
def _get_default_name_title(self):
return self._description if self._description else self._name
@@ -64,6 +65,21 @@ class YuthonOfficial(models.Model):
name_title = fields.Char(default=_get_default_name_title)
self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])])
def end_approval(self):
self.write({'work_end': True})
if self.main_flats_id.name == '广州市天河投资集团有限公司':
process_id = self.env['yuthon.sub.enterprises'].search([('issuance_process_id', '=', self.id)])
if not process_id:
official_partner_id = self.env['official.partner'].search([('name', '=', '广州市天河投资集团有限公司')])
sub_id = self.env['yuthon.sub.enterprises'].create({
'name': '广州市天河投资集团有限公司文件处理',
'users_id': self.users_id.id,
'official_partner_id': official_partner_id.id,
'issuance_process_id': self.id,
})
self.write({'sub_id': sub_id.id})
@api.onchange('is_cold')
def onchange_is_cold(self):
if self.is_cold:
@@ -6,7 +6,7 @@ from odoo.exceptions import ValidationError, UserError
class YuthonSubEnterprises(models.Model):
_name = 'yuthon.sub.enterprises'
_description = '文件处理(子企业)'
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
_rec_name = 'name'
@@ -15,6 +15,7 @@ class YuthonSubEnterprises(models.Model):
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
issuance_process_id = fields.Many2one('yuthon.official', string="发文流程")
come_file_id = fields.Char(string="来文编号")
reason_application = fields.Text(string="事由")
official_partner_id = fields.Many2one('official.partner', string="来文单位")
@@ -81,6 +81,7 @@
<group col="2" string="拟稿信息">
<group>
<field name="users_id"/>
<field name="sub_id" invisible="not sub_id"/>
<field name="official_documents_ids" widget="preview_many2many"/>
</group>
<group>
@@ -45,6 +45,7 @@
<field name="come_file_id"/>
<field name="official_partner_id"/>
<field name="reason_application"/>
<field name="issuance_process_id" invisible="not issuance_process_id"/>
<field name="document_ids" widget="preview_many2many"/>
</group>
</sheet>