!2821 Merge branch 'dev' into dev_zhou
Merge pull request !2821 from 李鹏宇/dev_zhou
This commit is contained in:
@@ -195,3 +195,7 @@ class SoongWorkflowRecord(models.Model):
|
||||
for record in self:
|
||||
record.active = False
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="关联流程" invisible="not log_ids">
|
||||
<page string="关联流程">
|
||||
<field name="soong_record_ids" style="width:100%%; margin-top: 10px;">
|
||||
<tree edit="true" delete="true" editable="bottom">
|
||||
<field name="code"/>
|
||||
@@ -38,7 +38,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="关联项目" invisible="not log_ids">
|
||||
<page string="关联项目">
|
||||
<field name="project_ids" style="width:100%%; margin-top: 10px;">
|
||||
<tree editable="bottom">
|
||||
<field name="project_id"/>
|
||||
@@ -75,7 +75,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="关联流程" invisible="not log_ids">
|
||||
<page string="关联流程">
|
||||
<field name="soong_record_ids" style="width:100%%; margin-top: 10px;">
|
||||
<tree editable="bottom">
|
||||
<field name="workflow_record_id" domain="[('users_ids', 'in', uid)]"/>
|
||||
@@ -86,7 +86,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="关联项目" invisible="not log_ids">
|
||||
<page string="关联项目">
|
||||
<field name="project_ids" style="width:100%%; margin-top: 10px;">
|
||||
<tree editable="bottom">
|
||||
<field name="project_id"/>
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="soong_workflow_record_tree" model="ir.ui.view">
|
||||
<field name="name">soong.workflow.record.tree</field>
|
||||
<field name="model">soong.workflow.record</field>
|
||||
|
||||
@@ -337,7 +337,7 @@ class HolidaysRequestBatch(models.Model):
|
||||
default='normal')
|
||||
start_date = fields.Date(string="开始时间")
|
||||
end_date = fields.Date(string="结束时间")
|
||||
custom_document_ids = fields.Many2many(
|
||||
document_ids = fields.Many2many(
|
||||
string='文件',
|
||||
comodel_name='ir.attachment',
|
||||
relation='leave_custom_doc_rel',
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<field name="text"/>
|
||||
<field name="create_date" invisible="1"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="custom_document_ids" widget="preview_many2many" options="{'show_select_btn': false}"/>
|
||||
<field name="document_ids" widget="preview_many2many" options="{'show_select_btn': false}"/>
|
||||
<field name="holiday_allowance"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
'views/yuthon_trade_reimbursed.xml',
|
||||
'views/yuthon_message_approval_views.xml',
|
||||
'views/yuthon_trade_supportive.xml',
|
||||
'views/inherit_workflow_record_viwes.xml',
|
||||
'views/yuthon_none_views.xml',
|
||||
'views/yuthon_mutual_approval_views.xml',
|
||||
'views/yuthon_care_condolences_views.xml',
|
||||
|
||||
@@ -22,3 +22,4 @@ from . import yuthon_task_setting
|
||||
from . import trade_reward_approval
|
||||
from . import yuthon_seals_approval
|
||||
from . import yuthon_business_approval
|
||||
from . import inherit_workflow_record
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
import logging
|
||||
from datetime import datetime, date, time, timedelta
|
||||
|
||||
class InheritWorkflowRecord(models.Model):
|
||||
_inherit = "soong.workflow.record"
|
||||
|
||||
def put_seals(self):
|
||||
form_id = self.env.ref('yuthon_trade.view_yuthon_seals_approval_form').id
|
||||
document_list = []
|
||||
soong_workflow_list = []
|
||||
record_ids = self.env["soong.workflow.record"].browse \
|
||||
(self._context.get('active_ids', self._context.get('active_id')))
|
||||
for record in record_ids:
|
||||
# if record.approve_state != "end":
|
||||
# raise UserError("当前流程未结束,不可盖章")
|
||||
related_record = self.env[record.res_model].browse(record.res_id)
|
||||
soong_workflow_list.append((0, 0, {
|
||||
'workflow_record_id': record.id,
|
||||
}))
|
||||
if related_record.document_ids:
|
||||
document_list.extend(related_record.document_ids.ids)
|
||||
|
||||
return {
|
||||
"name": _("盖章审批"),
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": "yuthon.seals.approval",
|
||||
"views": [(form_id, "form")],
|
||||
"context": {
|
||||
'default_document_ids': [(6, 0, document_list)],
|
||||
'default_soong_record_ids': soong_workflow_list,
|
||||
} ,}
|
||||
|
||||
@@ -17,11 +17,9 @@ class YuthonSealsApproval(models.Model):
|
||||
document_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
|
||||
default='normal')
|
||||
type_stamp = fields.Selection([('official', '公章'), ('contract', '合同章'), ('seal', '法人章'),
|
||||
('salary', '财务章'), ('other', '其他')], string='用章类型', default='official')
|
||||
scope_chapter = fields.Selection([('thtz', '天河投资'), ('ttcj', '天投城建'),
|
||||
('thwg', '天河物管'), ('thlc', '天河粮储')], string='用章范围', default='thtz')
|
||||
approval_id = fields.Many2one('hr.department', string="发送单位")
|
||||
type_stamp_ids = fields.Many2many('seals.type.setting', string='用章类型')
|
||||
scope_chapter_id = fields.Many2one('seals.scope.setting', string='用章范围')
|
||||
approval_id = fields.Many2one('sending.unit.setting', string="发送单位")
|
||||
remake = fields.Text(string="用章意见")
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
work_end = fields.Boolean(string="结束")
|
||||
|
||||
@@ -12,4 +12,22 @@ class YuthonWorkSetting(models.Model):
|
||||
_name = 'yuthon.work.setting'
|
||||
_description = '节日类型配置'
|
||||
|
||||
name = fields.Char(string='名称')
|
||||
name = fields.Char(string='名称')
|
||||
|
||||
class SealsTypeSetting(models.Model):
|
||||
_name = 'seals.type.setting'
|
||||
_description = '用章类型'
|
||||
|
||||
name = fields.Char(string='名称')
|
||||
|
||||
class SealsScopeSetting(models.Model):
|
||||
_name = 'seals.scope.setting'
|
||||
_description = '用章范围'
|
||||
|
||||
name = fields.Char(string='名称')
|
||||
|
||||
class SendingUnitSetting(models.Model):
|
||||
_name = 'sending.unit.setting'
|
||||
_description = '发送单位'
|
||||
|
||||
name = fields.Char(string='名称')
|
||||
|
||||
@@ -28,5 +28,9 @@ access_yuthon_task_setting,yuthon_task_setting,model_yuthon_task_setting,base.gr
|
||||
access_yuthon_stack_position,yuthon_stack_position,model_yuthon_stack_position,base.group_user,1,1,1,1
|
||||
access_trade_reward_approval,trade_reward_approval,model_trade_reward_approval,base.group_user,1,1,1,1
|
||||
access_yuthon_reward_line,yuthon_reward_line,model_yuthon_reward_line,base.group_user,1,1,1,1
|
||||
access_seals_type_setting,seals_type_setting,model_seals_type_setting,base.group_user,1,1,1,1
|
||||
access_seals_scope_setting,seals_scope_setting,model_seals_scope_setting,base.group_user,1,1,1,1
|
||||
access_sending_unit_setting,sending_unit_setting,model_sending_unit_setting,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="inherit_workflow_record_tree" model="ir.ui.view">
|
||||
<field name="name">inherit.workflow.record.tree</field>
|
||||
<field name="model">soong.workflow.record</field>
|
||||
<field name="inherit_id" ref="soong_workflow.soong_workflow_record_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="inside">
|
||||
<header>
|
||||
<button name="put_seals" type="object" string="提交用章审批" class="oe_highlight"/>
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -39,8 +39,8 @@
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="users_id"/>
|
||||
<field name="type_stamp"/>
|
||||
<field name="scope_chapter"/>
|
||||
<field name="type_stamp_ids" widget="many2many_tags"/>
|
||||
<field name="scope_chapter_id"/>
|
||||
<field name="approval_id"/>
|
||||
<field name="remake"/>
|
||||
<field name="document_ids" widget="preview_many2many"/>
|
||||
|
||||
@@ -137,4 +137,19 @@
|
||||
parent="executive_trade_setting"
|
||||
action="view_yuthon_stack_position_action"
|
||||
sequence="40"/>
|
||||
<menuitem id="seals_type_setting_board"
|
||||
name="用章类型"
|
||||
parent="executive_trade_setting"
|
||||
action="view_seals_type_setting_action"
|
||||
sequence="50"/>
|
||||
<menuitem id="yuthon_seal_scope_board"
|
||||
name="用章范围"
|
||||
parent="executive_trade_setting"
|
||||
action="view_seals_scope_setting_action"
|
||||
sequence="60"/>
|
||||
<menuitem id="yuthon_sending_unit_board"
|
||||
name="发送单位"
|
||||
parent="executive_trade_setting"
|
||||
action="view_sending_unit_setting_action"
|
||||
sequence="70"/>
|
||||
</odoo>
|
||||
@@ -28,4 +28,46 @@
|
||||
<field name="res_model">yuthon.work.setting</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
<record id="view_seals_type_setting_tree" model="ir.ui.view">
|
||||
<field name="name">seals.type.setting.tree</field>
|
||||
<field name="model">seals.type.setting</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="用章类型" editable="bottom">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_seals_type_setting_action" model="ir.actions.act_window">
|
||||
<field name="name">用章类型</field>
|
||||
<field name="res_model">seals.type.setting</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
<record id="view_seals_scope_setting_tree" model="ir.ui.view">
|
||||
<field name="name">seals.scope.setting.tree</field>
|
||||
<field name="model">seals.scope.setting</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="用章范围" editable="bottom">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_seals_scope_setting_action" model="ir.actions.act_window">
|
||||
<field name="name">用章范围</field>
|
||||
<field name="res_model">seals.scope.setting</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
<record id="view_sending_unit_setting_tree" model="ir.ui.view">
|
||||
<field name="name">sending.unit.setting.tree</field>
|
||||
<field name="model">sending.unit.setting</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="发送单位" editable="bottom">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_sending_unit_setting_action" model="ir.actions.act_window">
|
||||
<field name="name">发送单位</field>
|
||||
<field name="res_model">sending.unit.setting</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user