7月31日,对yuthon_official模块添加三个表单模型
This commit is contained in:
@@ -10,13 +10,16 @@
|
||||
'category': 'Human Resources/Attendances',
|
||||
'version': '0.1',
|
||||
'license': 'LGPL-3',
|
||||
'depends': ['mail', 'soong_workflow'],
|
||||
'depends': ['mail','hr'],
|
||||
'data': [
|
||||
'data/official_type_data.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/yuthon_official_views.xml',
|
||||
'views/official_partner_views.xml',
|
||||
'views/official_type_views.xml',
|
||||
'views/yuthon_official_labor_views.xml',
|
||||
'views/yuthon_offficial_party_views.xml',
|
||||
'views/yuthon_official_normal_views.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
|
||||
@@ -3,3 +3,6 @@
|
||||
from . import yuthon_official
|
||||
from . import official_partner
|
||||
from . import officical_type
|
||||
from . import yuthon_official_labor
|
||||
from . import yuthon_offficial_party
|
||||
from . import yuthon_official_normal
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, tools
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
|
||||
class YuthonOfficialParty(models.Model):
|
||||
_name = 'yuthon.official.party'
|
||||
_description = '党总支发文'
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char(string="名称")
|
||||
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('official_code'))
|
||||
official_type_id = fields.Many2one('official.type', string="公文种类")
|
||||
official_type = fields.Selection([('go', '发文'), ('come', '收文')], string="公文类型")
|
||||
reference_cold = fields.Integer(string="公文字号")
|
||||
major_event_category = fields.Integer(string="重大事项所属类别")
|
||||
# official_partner_id = fields.Many2one('official.partner', string="来文单位")
|
||||
remarks = fields.Char(string="备注事项")
|
||||
main_text = fields.Html(string='正文')
|
||||
# come_file_id = fields.Char(string="来文编号")
|
||||
# incoming_file_id = fields.Char(string="收文编号")
|
||||
main_flats = fields.Char(string="主送")
|
||||
copy_flats = fields.Char(string="抄送")
|
||||
servings_number = fields.Integer(string="份数")
|
||||
urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度")
|
||||
secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')],
|
||||
string="密级")
|
||||
date = fields.Datetime(string="日期", default=fields.Datetime.now)
|
||||
department_id = fields.Many2one('hr.department', string="申请人部门")
|
||||
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')],
|
||||
string="状态", default='drft')
|
||||
deadline = fields.Date(string="办理期限")
|
||||
red_suit = fields.Char(string="套红")
|
||||
@@ -6,7 +6,7 @@ from odoo.exceptions import ValidationError, UserError
|
||||
class YuthonOfficial(models.Model):
|
||||
_name = 'yuthon.official'
|
||||
_description = '收发文管理'
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char(string="名称")
|
||||
@@ -20,10 +20,14 @@ class YuthonOfficial(models.Model):
|
||||
remarks = fields.Char(string="备注事项")
|
||||
main_text = fields.Html(string='正文')
|
||||
come_file_id = fields.Char(string="来文编号")
|
||||
incoming_file_id = fields.Char(string="收文编号")
|
||||
main_flats = fields.Char(string="主送")
|
||||
copy_flats = fields.Char(string="抄送")
|
||||
servings_number = fields.Integer(string="份数")
|
||||
urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度")
|
||||
secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级")
|
||||
date = fields.Datetime(string="日期", default=fields.Datetime.now)
|
||||
department_id = fields.Many2one('hr.department', string="申请人部门")
|
||||
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态", default='drft')
|
||||
deadline = fields.Date(string="办理期限")
|
||||
red_suit = fields.Char(string="套红")
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, tools
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
|
||||
class YuthonOfficialLabor(models.Model):
|
||||
_name = 'yuthon.official.labor'
|
||||
_description = '工会发文'
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char(string="名称")
|
||||
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('official_code'))
|
||||
official_type_id = fields.Many2one('official.type', string="公文种类")
|
||||
official_type = fields.Selection([('go', '发文'), ('come', '收文')], string="公文类型")
|
||||
reference_cold = fields.Integer(string="公文字号")
|
||||
major_event_category = fields.Integer(string="重大事项所属类别")
|
||||
# official_partner_id = fields.Many2one('official.partner', string="来文单位")
|
||||
remarks = fields.Char(string="备注事项")
|
||||
main_text = fields.Html(string='正文')
|
||||
# come_file_id = fields.Char(string="来文编号")
|
||||
# incoming_file_id = fields.Char(string="收文编号")
|
||||
main_flats = fields.Char(string="主送")
|
||||
copy_flats = fields.Char(string="抄送")
|
||||
servings_number = fields.Integer(string="份数")
|
||||
# urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度")
|
||||
# secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')],
|
||||
# string="密级")
|
||||
date = fields.Datetime(string="日期", default=fields.Datetime.now)
|
||||
department_id = fields.Many2one('hr.department', string="申请人部门")
|
||||
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')],
|
||||
string="状态", default='drft')
|
||||
deadline = fields.Date(string="办理期限")
|
||||
red_suit = fields.Char(string="套红")
|
||||
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, tools
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
|
||||
class YuthonOfficialNormal(models.Model):
|
||||
_name = 'yuthon.official.normal'
|
||||
_description = '行政发文'
|
||||
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Char(string="名称")
|
||||
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('official_code'))
|
||||
official_type_id = fields.Many2one('official.type', string="公文种类")
|
||||
official_type = fields.Selection([('go', '发文'), ('come', '收文')], string="公文类型")
|
||||
reference_cold = fields.Integer(string="公文字号")
|
||||
major_event_category = fields.Integer(string="重大事项所属类别")
|
||||
remarks = fields.Char(string="备注事项")
|
||||
main_text = fields.Html(string='正文')
|
||||
main_flats = fields.Char(string="主送")
|
||||
copy_flats = fields.Char(string="抄送")
|
||||
servings_number = fields.Integer(string="份数")
|
||||
urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度")
|
||||
secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')],
|
||||
string="密级")
|
||||
date = fields.Datetime(string="日期", default=fields.Datetime.now)
|
||||
department_id = fields.Many2one('hr.department', string="申请人部门")
|
||||
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')],
|
||||
string="状态", default='drft')
|
||||
deadline = fields.Date(string="办理期限")
|
||||
red_suit = fields.Char(string="套红")
|
||||
@@ -1,4 +1,7 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_yuthon_official,yuthon_official,model_yuthon_official,base.group_user,1,1,1,1
|
||||
access_official_partner,official_partner,model_official_partner,base.group_user,1,1,1,1
|
||||
access_official_type,official_type,model_official_type,base.group_user,1,1,1,1
|
||||
access_official_type,official_type,model_official_type,base.group_user,1,1,1,1
|
||||
access_yuthon_official_labor,yuthon_official_labor,model_yuthon_official_labor,base.group_user,1,1,1,1
|
||||
access_yuthon_offficial_party,yuthon_offficial_party,model_yuthon_official_party,base.group_user,1,1,1,1
|
||||
access_yuthon_official_normal,yuthon_official_normal,model_yuthon_official_normal,base.group_user,1,1,1,1
|
||||
|
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="yuthon_offficial_party_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.official.party.tree</field>
|
||||
<field name="model">yuthon.official.party</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="department_id"/>
|
||||
<field name="date"/>
|
||||
<field name="statu"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="yuthon_offficial_party_form" model="ir.ui.view">
|
||||
<field name="name">yuthon.official.party.form</field>
|
||||
<field name="model">yuthon.official.party</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<field name="statu" widget="statusbar"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name"/>
|
||||
<h1>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="reference_cold"/>
|
||||
<field name="major_event_category"/>
|
||||
<field name="urgency"/>
|
||||
<field name="secret_level"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="department_id"/>
|
||||
<field name="main_flats"/>
|
||||
<field name="copy_flats"/>
|
||||
<field name="servings_number"/>
|
||||
<field name="deadline"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="main_text"/>
|
||||
<field name="remarks"/>
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="o_attachment_preview"/>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" groups="base.group_user"/>
|
||||
<field name="activity_ids"/>
|
||||
<field name="message_ids"/>
|
||||
<field name="red_suit"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="send_receive_messages_management_search" model="ir.ui.view">
|
||||
<field name="name">send.receive.messages.management.search</field>
|
||||
<field name="model">yuthon.official</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="考勤审批状态">
|
||||
<filter string="草稿" name="Drft " domain="[('statu', '=', 'drft')]"/>
|
||||
<filter string="执行中" name="Going " domain="[('statu', '=', 'going')]"/>
|
||||
<filter string="已取消" name="Cancel " domain="[('statu', '=', 'cancel')]"/>
|
||||
<filter string="已完成" name="Done " domain="[('statu', '=', 'done')]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="yuthon_offficial_party_action" model="ir.actions.act_window">
|
||||
<field name="name">党总支发文</field>
|
||||
<field name="res_model">yuthon.official.party</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="yuthon_offficial_party_menu"
|
||||
parent="official_management_menu"
|
||||
name="党总支发文"
|
||||
action="yuthon_offficial_party_action"
|
||||
sequence="20"/>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="yuthon_official_labor_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.official.labor.tree</field>
|
||||
<field name="model">yuthon.official.labor</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="department_id"/>
|
||||
<field name="date"/>
|
||||
<field name="statu"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="yuthon_official_labor_form" model="ir.ui.view">
|
||||
<field name="name">yuthon.official.labor.form</field>
|
||||
<field name="model">yuthon.official.labor</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<field name="statu" widget="statusbar"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name"/>
|
||||
<h1>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="reference_cold"/>
|
||||
<field name="major_event_category"/>
|
||||
<field name="date"/>
|
||||
<field name="deadline"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="department_id"/>
|
||||
<field name="main_flats"/>
|
||||
<field name="copy_flats"/>
|
||||
<field name="servings_number"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="main_text"/>
|
||||
<field name="remarks"/>
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="o_attachment_preview"/>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" groups="base.group_user"/>
|
||||
<field name="activity_ids"/>
|
||||
<field name="message_ids"/>
|
||||
<field name="red_suit"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="send_receive_messages_management_search" model="ir.ui.view">
|
||||
<field name="name">send.receive.messages.management.search</field>
|
||||
<field name="model">yuthon.official</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="考勤审批状态">
|
||||
<filter string="草稿" name="Drft " domain="[('statu', '=', 'drft')]"/>
|
||||
<filter string="执行中" name="Going " domain="[('statu', '=', 'going')]"/>
|
||||
<filter string="已取消" name="Cancel " domain="[('statu', '=', 'cancel')]"/>
|
||||
<filter string="已完成" name="Done " domain="[('statu', '=', 'done')]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="yuthon_official_labor_action" model="ir.actions.act_window">
|
||||
<field name="name">工会发文</field>
|
||||
<field name="res_model">yuthon.official.labor</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="yuthon_official_labor_menu"
|
||||
parent="official_management_menu"
|
||||
name="工会发文"
|
||||
action="yuthon_official_labor_action"
|
||||
sequence="10"/>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="yuthon_official_normal_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.official.normal.tree</field>
|
||||
<field name="model">yuthon.official.normal</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="department_id"/>
|
||||
<field name="date"/>
|
||||
<field name="statu"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="yuthon_official_normal_form" model="ir.ui.view">
|
||||
<field name="name">yuthon.official.normal.form</field>
|
||||
<field name="model">yuthon.official.normal</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<field name="statu" widget="statusbar"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name"/>
|
||||
<h1>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="reference_cold"/>
|
||||
<field name="major_event_category"/>
|
||||
<field name="urgency"/>
|
||||
<field name="secret_level"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="department_id"/>
|
||||
<field name="main_flats"/>
|
||||
<field name="copy_flats"/>
|
||||
<field name="servings_number"/>
|
||||
<field name="deadline"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="main_text"/>
|
||||
<field name="remarks"/>
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="o_attachment_preview"/>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" groups="base.group_user"/>
|
||||
<field name="activity_ids"/>
|
||||
<field name="message_ids"/>
|
||||
<field name="red_suit"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="send_receive_messages_management_search" model="ir.ui.view">
|
||||
<field name="name">send.receive.messages.management.search</field>
|
||||
<field name="model">yuthon.official</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="考勤审批状态">
|
||||
<filter string="草稿" name="Drft " domain="[('statu', '=', 'drft')]"/>
|
||||
<filter string="执行中" name="Going " domain="[('statu', '=', 'going')]"/>
|
||||
<filter string="已取消" name="Cancel " domain="[('statu', '=', 'cancel')]"/>
|
||||
<filter string="已完成" name="Done " domain="[('statu', '=', 'done')]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="yuthon_official_normal_action" model="ir.actions.act_window">
|
||||
<field name="name">行政发文</field>
|
||||
<field name="res_model">yuthon.official.normal</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
id="yuthon_official_normal_menu"
|
||||
parent="official_management_menu"
|
||||
name="行政发文"
|
||||
action="yuthon_official_normal_action"
|
||||
sequence="30"/>
|
||||
|
||||
</odoo>
|
||||
@@ -39,11 +39,14 @@
|
||||
<field name="urgency"/>
|
||||
<field name="secret_level"/>
|
||||
<field name="date"/>
|
||||
<field name="deadline"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="department_id"/>
|
||||
<field name="come_file_id"/>
|
||||
<field name="incoming_file_id"/>
|
||||
<field name="main_flats"/>
|
||||
<field name="copy_flats"/>
|
||||
<field name="servings_number"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -57,6 +60,7 @@
|
||||
<field name="message_follower_ids" groups="base.group_user"/>
|
||||
<field name="activity_ids"/>
|
||||
<field name="message_ids"/>
|
||||
<field name="red_suit"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user