@@ -113,6 +113,13 @@ class SoongWorkflowNode(models.Model):
|
||||
},)]
|
||||
else:
|
||||
val["button_ids"] = [
|
||||
(0, 0, {
|
||||
"name": _("上议题"),
|
||||
"workflow_id": val['workflow_id'],
|
||||
"sequence":-1,
|
||||
"action_type": "code",
|
||||
"code": "obj.action_meeting()"
|
||||
}),
|
||||
(0, 0, {
|
||||
"name": _("转交"),
|
||||
"workflow_id": val['workflow_id'],
|
||||
@@ -151,6 +158,7 @@ class SoongWorkflowNode(models.Model):
|
||||
"action_type": "code",
|
||||
"has_comment": True,
|
||||
},)]
|
||||
|
||||
return super().create(values)
|
||||
|
||||
@api.depends("bg_color", "label_color", "use_custom_colors", "flow_start", "flow_end")
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
'security/ir.model.access.csv',
|
||||
# 'security/approval_attendance.xml',
|
||||
'data/attendance_code_data.xml',
|
||||
'data/attendance_data.xml',
|
||||
'views/inherit_hr_employee_views.xml',
|
||||
'views/hr_attendance_views.xml',
|
||||
'views/resource_calendar_leaves_views.xml',
|
||||
@@ -30,8 +29,6 @@
|
||||
'views/leave_approval.xml',
|
||||
'views/remove_holiday_approval.xml',
|
||||
'views/card_approval.xml',
|
||||
'views/holiday_manage.xml',
|
||||
'views/holiday_manage_balance.xml',
|
||||
'views/attendance_scheme.xml',
|
||||
'views/attendance_iot_datas.xml',
|
||||
'views/all_attendance_menu.xml',
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!-- 公司通用表单- 加班 -->
|
||||
<record id="approval_overtime_data" model="overtime.approval">
|
||||
<field name="name">加班申请</field>
|
||||
</record>
|
||||
|
||||
<!-- 公司通用表单- 外出 -->
|
||||
<record id="go_approval_data" model="go.approval">
|
||||
<field name="name">外出申请</field>
|
||||
</record>
|
||||
|
||||
<!-- <!– 公司通用表单- 调休 –>-->
|
||||
<!-- <record id="approval_approval_data" model="go.approval">-->
|
||||
<!-- <field name="name">调休申请</field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!-- 公司通用表单- 请假 -->
|
||||
<record id="approval_approval_holidays" model="holidays.approval">
|
||||
<field name="name">请假申请</field>
|
||||
</record>
|
||||
|
||||
<!-- 公司通用表单- 销假 -->
|
||||
<record id="approval_approval_remove_holidays" model="remove.holiday.approval">
|
||||
<field name="name">销假申请</field>
|
||||
</record>
|
||||
|
||||
<!-- 公司通用表单- 补卡 -->
|
||||
<record id="approval_approval_card" model="card.approval">
|
||||
<field name="name">补卡申请</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -10,9 +10,8 @@ from . import duty_approval
|
||||
from . import leave_approval
|
||||
from . import remove_holiday_approval
|
||||
from . import card_approval
|
||||
from . import holiday_manage
|
||||
from . import holiday_manage_balance
|
||||
from . import attendance_iot_manager
|
||||
from . import attendance_iot_datas
|
||||
from . import attendance_scheme
|
||||
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import api, fields, models, tools
|
||||
from odoo.exceptions import ValidationError
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class HolidayManage(models.Model):
|
||||
_name = "holiday.manage"
|
||||
_description = '假期管理'
|
||||
_rec_name = 'name'
|
||||
|
||||
# 基础信息设置
|
||||
name = fields.Char(string="假期名称")
|
||||
# 范围,角色,部门,人员
|
||||
department_ids = fields.Many2many('hr.department', string='部门范围')
|
||||
employee_ids = fields.Many2many('hr.employee', string='人员范围')
|
||||
users_role_ids = fields.Many2many('soong.user.role', string='角色范围')
|
||||
holiday_users_ids = fields.Many2many('res.users', string="申请假期人员", compute="compute_holiday_users_ids", store=True)
|
||||
|
||||
is_limit = fields.Boolean(string="新员工请假是否限制", help='入职即可请假')
|
||||
leave_time = fields.Selection(selection=[(str(i), str(i)) for i in range(1, 13)], string="入职月份", help='入职时长小于此月份时,不可申请此假期')
|
||||
start_time = fields.Datetime(string="生效日期", default=fields.Datetime.now)
|
||||
end_time = fields.Datetime(string="失效日期",)
|
||||
is_enable = fields.Boolean(string="是否启用", default="False", compute="compute_is_enable", store=True)
|
||||
# 请假时长核算规则
|
||||
leave_unit = fields.Selection([('day', '按天'), ('hours', '按小时')], string="请假单位")
|
||||
unit_conversion = fields.Float(string="单位换算", help='将按此规则对天与小时进行转换,有打卡规则按工作时长计算')
|
||||
time_long = fields.Selection([('nature', '自然日'), ('work', '工作日')], string="时长计算")
|
||||
# 假期余额发放规则
|
||||
|
||||
is_quota = fields.Boolean(string="是否限额")
|
||||
issuance_method = fields.Selection([('moth', '按月自动发放'), ('year', '按年自动发放'), ('manual', '手动导入余额')], string='发放方式')
|
||||
# 按月自动发放
|
||||
|
||||
# 按年自动发放
|
||||
|
||||
# valid = fields.Selection([('forever', '永久有效'), ('no', '每年固定日期生效')], string="假期有效期")
|
||||
# release_time = fields.Selection([('calendar', '自然年'), ('onboard', '员工入职日期发放')], string="发放时间")
|
||||
# credit_rules = fields.Selection([('fixed', '固定额度'), ('division', '按司龄发放'),('seniority','按工龄发放')], string="额度计算规则")
|
||||
# person_year = fields.Float(string="每人每年发放")
|
||||
# is_balance= fields.Boolean(string="按实际工作时长发放余额")
|
||||
# valid_holidays = fields.Integer(string="假期有效期")
|
||||
# is_time = fields.Boolean(string="允许有效时长")
|
||||
|
||||
|
||||
@api.depends('department_ids', 'employee_ids', 'users_role_ids')
|
||||
def compute_holiday_users_ids(self):
|
||||
department_users_list = users_role_list = []
|
||||
for users in self:
|
||||
if users.department_ids:
|
||||
# 查看是否下级部门
|
||||
for depart in users.department_ids:
|
||||
department_users_data = users.env['hr.employee'].search([('department_id', '=', depart.id.origin)])
|
||||
department_users_list = [de.user_id.id for de in department_users_data]
|
||||
if depart.child_ids:
|
||||
for child in depart.child_ids:
|
||||
department_child_users_data = users.env['hr.employee'].search(
|
||||
[('department_id', '=', child.id.origin)])
|
||||
department_users_list += [de.user_id.id for de in department_child_users_data]
|
||||
employee_users_list = users.employee_ids.user_id.ids
|
||||
if users.users_role_ids:
|
||||
for user_id in users.users_role_ids:
|
||||
user_role_data = users.env['hr.employee'].search(
|
||||
['|', ('user_role_id', '=', user_id.id.origin), ('user_role_ids', '=', user_id.id.origin)])
|
||||
users_role_list = [ro.user_id.id for ro in user_role_data]
|
||||
publish_user_list = department_users_list + employee_users_list + users_role_list
|
||||
false_none_list = [x for x in publish_user_list if x != False]
|
||||
users.room_users_ids = [(6, 0, list(set(false_none_list)))]
|
||||
|
||||
@api.depends('start_time', 'end_time')
|
||||
def compute_is_enable(self):
|
||||
for rec in self:
|
||||
if rec.start_time and rec.end_time:
|
||||
if rec.start_time < datetime.now() and rec.end_time > datetime.now():
|
||||
rec.is_enable = True
|
||||
else:
|
||||
rec.is_enable = False
|
||||
else:
|
||||
rec.is_enable = False
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, tools
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class HolidayManageBalance(models.Model):
|
||||
_name = "holiday.manage.balance"
|
||||
_description = '假期余额'
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Many2one('hr.employee', string="姓名")
|
||||
department_id = fields.Many2one('hr.department', string='部门')
|
||||
onboard_date = fields.Date(string="入职日期")
|
||||
first_data = fields.Datetime(string="首次参加工作时间")
|
||||
annual_leave = fields.Float(string="年假")
|
||||
time_off = fields.Float(string="补休")
|
||||
|
||||
leave = fields.Char(string="事假")
|
||||
sick_leave = fields.Char(string="病假")
|
||||
|
||||
type_leave = fields.Many2one('holiday.type.setting',string="请假类型")
|
||||
estimated_time = fields.Datetime(string="预计时长")
|
||||
actual_time = fields.Datetime(string="实际时长")
|
||||
used_time = fields.Datetime(string="已用时长")
|
||||
rest_time = fields.Datetime(string="剩余时长")
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,20 +3,14 @@ access_resource_calendar_holiday,resource.calendar.holiday,model_resource_calend
|
||||
access_overtime_approval,overtime.approval,model_overtime_approval,base.group_user,1,1,1,1
|
||||
access_go_approval,go.approval,model_go_approval,base.group_user,1,1,1,1
|
||||
access_duty_approval,duty.approval,model_duty_approval,base.group_user,1,1,1,1
|
||||
access_leave_approval,leave.approval,model_leave_approval,base.group_user,1,1,1,1
|
||||
access_holidays_approval,holidays.approval,model_holidays_approval,base.group_user,1,1,1,1
|
||||
access_remove_holiday_approval,remove.holiday.approval,model_remove_holiday_approval,base.group_user,1,1,1,1
|
||||
access_card_approval,card.approval,model_card_approval,base.group_user,1,1,1,1
|
||||
access_holiday_manage,holiday_manage,model_holiday_manage,base.group_user,1,1,1,1
|
||||
access_attendance_iot,attendance_iot,model_attendance_iot,base.group_user,1,1,1,1
|
||||
access_attendance_iot_manager,attendance_iot_manager,model_attendance_iot_manager,base.group_user,1,1,1,1
|
||||
access_attendance_iot_manager_wizard,attendance_iot_manager_wizard,model_attendance_iot_manager_wizard,base.group_user,1,1,1,1
|
||||
access_holiday_manage_balance,holiday_manage_balance,model_holiday_manage_balance,base.group_user,1,1,1,1
|
||||
access_attendance_iot_datas,attendance_iot_datas,model_attendance_iot_datas,base.group_user,1,1,1,1
|
||||
access_attendance_scheme,attendance_scheme,model_attendance_scheme,base.group_user,1,1,1,1
|
||||
access_holidays_approvals_line,holidays.approvals.line,model_holidays_approvals_line,base.group_user,1,1,1,1
|
||||
access_card_approvals_line,card.approval.line,model_card_approvals_line,base.group_user,1,1,1,1
|
||||
access_holidays_approvals_line,holidays.approvals.line,model_holidays_approvals_line,base.group_user,1,1,1,1
|
||||
access_go_approvals_line,go.approvals.line,model_go_approvals_line,base.group_user,1,1,1,1
|
||||
access_overtime_user_line,overtime.user.line,model_overtime_user_line,base.group_user,1,1,1,1
|
||||
access_duty_approval_line,duty.approval.line,model_duty_approval_line,base.group_user,1,1,1,1
|
||||
|
||||
|
@@ -20,12 +20,6 @@
|
||||
parent="menu_hr_attendance_approval_request" sequence="10" action="approval_request_remove_holiday"/>
|
||||
<menuitem id="menu_hr_attendance_remove_card" name="补卡申请"
|
||||
parent="menu_hr_attendance_approval_request" sequence="12" action="approval_request_card"/>
|
||||
<menuitem id="holiday_manage_menu_root" name="假期管理"
|
||||
parent="hr_attendance.menu_hr_attendance_root" sequence="9"/>
|
||||
<menuitem id="holiday_manage_type_menu" name="假期类型"
|
||||
parent="holiday_manage_menu_root" action="holiday_manage_type_action" sequence="1"/>
|
||||
<menuitem id="holiday_manage_balance_board" name="假期余额"
|
||||
parent="holiday_manage_menu_root" action="holiday_balance_action" sequence="4"/>
|
||||
<menuitem id="attendance_iot_manager_views" name="考勤机人员信息管理" parent="hr_attendance.menu_hr_attendance_root"
|
||||
sequence="15" action="attendance_iot_manager_action"/>
|
||||
<menuitem id="attendance_iot_views" name="考勤机设备管理" parent="hr_attendance.menu_hr_attendance_root"
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="holiday_manage_tree" model="ir.ui.view">
|
||||
<field name="name">holiday.manage.tree</field>
|
||||
<field name="model">holiday.manage</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="假期类型">
|
||||
<field name="name"/>
|
||||
<field name="time_long"/>
|
||||
<field name="issuance_method"/>
|
||||
<field name="leave_unit"/>
|
||||
<field name="start_time"/>
|
||||
<field name="end_time"/>
|
||||
<field name="is_enable"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="holiday_manage_form" model="ir.ui.view">
|
||||
<field name="name">holiday.manage.form</field>
|
||||
<field name="model">holiday.manage</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="假期管理">
|
||||
<sheet>
|
||||
<group string="基础信息设置">
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
<field name="department_ids" widget="many2many_tags"/>
|
||||
<field name="employee_ids" widget="many2many_tags"/>
|
||||
<field name="users_role_ids" widget="many2many_tags"/>
|
||||
<field name="holiday_users_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="start_time" required="1"/>
|
||||
<field name="end_time" required="1"/>
|
||||
<field name="is_enable"/>
|
||||
<field name="is_limit"/>
|
||||
<field name="leave_time" invisible="not is_limit"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="请假时长核算规则">
|
||||
<group>
|
||||
<field name="leave_unit"/>
|
||||
<field name="unit_conversion"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="time_long"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="假期余额发放规则">
|
||||
<field name="is_quota"/>
|
||||
<field name="issuance_method" invisible="not is_quota"/>
|
||||
<!-- 需要与客户对接数理逻辑ing -->
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="holiday_manage_type_action" model="ir.actions.act_window">
|
||||
<field name="name">假期类型</field>
|
||||
<field name="res_model">holiday.manage</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="holiday_manage_balance_tree" model="ir.ui.view">
|
||||
<field name="name">holiday.manage.balance.tree</field>
|
||||
<field name="model">holiday.manage.balance</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom" string="假期余额">
|
||||
<field name="name"/>
|
||||
<field name="department_id"/>
|
||||
<field name="onboard_date"/>
|
||||
<field name="first_data"/>
|
||||
<field name="annual_leave"/>
|
||||
<field name="time_off"/>
|
||||
<field name="leave"/>
|
||||
<field name="sick_leave"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="holiday_balance_action" model="ir.actions.act_window">
|
||||
<field name="name">假期余额</field>
|
||||
<field name="res_model">holiday.manage.balance</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -11,7 +11,7 @@
|
||||
'license': 'LGPL-3',
|
||||
'author': 'pengyuthon',
|
||||
'website': 'https://www.pengyuthon.com',
|
||||
'depends':['base', 'hr', 'yuthon_hr_employee', 'soong_workflow', 'documents', 'hr_recruitment', 'room'],
|
||||
'depends':['base', 'hr', 'yuthon_hr_employee', 'soong_workflow', 'documents', 'hr_recruitment', 'room','yuthon_issue'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'data/process_code_data.xml',
|
||||
|
||||
@@ -10,14 +10,14 @@ class YuthonInterviewApproval(models.Model):
|
||||
_inherit = 'soong.workflow.mixin'
|
||||
|
||||
|
||||
name = fields.Char(string='名称')
|
||||
name = fields.Char(string='标题')
|
||||
job_id = fields.Many2one('hr.job', string='应聘岗位')
|
||||
department_id = fields.Many2one("hr.department", string="应聘职务", required=True)
|
||||
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_interview_approval_code'))
|
||||
applicant_ids = fields.One2many('hr.applicant', 'interview_approval_id', string='应聘面试信息')
|
||||
|
||||
is_issues = fields.Boolean(string='是否上会')
|
||||
company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储')], string="公司")
|
||||
|
||||
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
||||
|
||||
def scheduling_of_meetings(self):
|
||||
form_id = self.env.ref("room.room_booking_view_form").id
|
||||
|
||||
@@ -21,19 +21,17 @@
|
||||
<header>
|
||||
<button name="scheduling_of_meetings" string="会议安排" type="object"/>
|
||||
</header>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="job_id"/>
|
||||
<field name="department_id"/>
|
||||
<field name="related_issues_id" invisible="is_issues == False "/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="company_page"/>
|
||||
<field name="is_issues" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
|
||||
@@ -8,3 +8,4 @@ from . import inherit_room_booking
|
||||
from . import issue_approval
|
||||
from . import inherit_hr_employee
|
||||
from . import issue_meeting_minutes
|
||||
from . import inherit_soong_workflow_mixin
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class SoongWorkflowMixin(models.AbstractModel):
|
||||
_inherit = 'soong.workflow.mixin'
|
||||
|
||||
# 上议题
|
||||
def action_meeting(self):
|
||||
if self.is_issues:
|
||||
raise UserError('当前议题已上会,请勿重复提交')
|
||||
self.write({'is_issues': 'Ture'})
|
||||
issue_id = self.env['issue.library'].create({'name': self.name})
|
||||
self.related_issues_id = issue_id.id
|
||||
workflow_record_id = self.env["soong.workflow.record"].search([("res_model", "=", self._name), ("res_id", "=", self.id)])
|
||||
self.env['issue.library.approval.line'].create({
|
||||
'issue_library_id': issue_id.id,
|
||||
'workflow_record_id': workflow_record_id.id,
|
||||
'approval_type': workflow_record_id.workflow_id.id,
|
||||
'code': self.code,
|
||||
'approval_date': fields.Datetime.now(),
|
||||
})
|
||||
@@ -35,8 +35,6 @@ class YuthonIndexApproval(models.Model):
|
||||
'new_end_index_time': new.end_index_time,
|
||||
'new_unit_compute': new.unit_compute,
|
||||
'new_weight': new.weight,
|
||||
'new_compute_method': new.compute_method,
|
||||
'new_compute_act': new.compute_act,
|
||||
}))
|
||||
self.new_index_library_ids = new_lines
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ class YuthonDutyManagement(models.Model):
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'yuthon.tissue.duty.approval',
|
||||
'views': [(form_id, 'form')],
|
||||
'context': {'default_change_duty_kpi_ids':self.performance_kpi_ids.ids,
|
||||
'default_change_duty_gs_ids':self.performance_gs_ids.ids,
|
||||
'context': {'default_change_duty_kpi_ids': [(6, 0, self.performance_kpi_ids.ids)],
|
||||
'default_change_duty_gs_ids':[(6, 0, self.performance_gs_ids.ids)],
|
||||
}}
|
||||
|
||||
|
||||
|
||||
@@ -52,17 +52,17 @@ class YuthonTissueDutyApproval(models.Model):
|
||||
}))
|
||||
self.new_gs_duty_approval_ids = new_lines
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
res = super().create(vals_list)
|
||||
for vals in vals_list:
|
||||
if vals['new_kpi_duty_approval_ids']:
|
||||
for line in vals['new_kpi_duty_approval_ids']:
|
||||
self.env['yuthon.kpi.line'].create({
|
||||
'performance_kpi_id':res.id,
|
||||
'duty_index_name':line.new_duty_index_name
|
||||
})
|
||||
return res
|
||||
# @api.model_create_multi
|
||||
# def create(self, vals_list):
|
||||
# res = super().create(vals_list)
|
||||
# for vals in vals_list:
|
||||
# if vals['new_kpi_duty_approval_ids']:
|
||||
# for line in vals['new_kpi_duty_approval_ids']:
|
||||
# self.env['yuthon.kpi.line'].create({
|
||||
# 'performance_kpi_id':line.id,
|
||||
# 'duty_index_name':line.new_duty_index_name
|
||||
# })
|
||||
# return res
|
||||
|
||||
|
||||
class NewKpiDutyApproval(models.Model):
|
||||
|
||||
@@ -54,8 +54,6 @@
|
||||
<field name="department_ids" widget="many2many_tags"/>
|
||||
<field name="in_charge_role_ids" widget="many2many_tags"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="start_index_time"/>
|
||||
<field name="end_index_time"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
@@ -74,8 +72,6 @@
|
||||
<field name="new_department_ids" widget="many2many_tags"/>
|
||||
<field name="new_in_charge_role_ids" widget="many2many_tags"/>
|
||||
<field name="new_employee_id"/>
|
||||
<field name="new_start_index_time"/>
|
||||
<field name="new_end_index_time"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<field name="start_index_time"/>
|
||||
<field name="end_index_time"/>
|
||||
<field name="index_statu"/>
|
||||
<button name="button_tissue_approval" type="object" string="提交责任书变更"/>
|
||||
<button name="button_tissue_approval" type="object" string="提交责任书变更" class="btn-primary"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
'views/property_patrol_standard.xml',
|
||||
'views/yuthon_draw_result_views.xml',
|
||||
'views/yuthon_expert_database_views.xml',
|
||||
'views/property_rental_form_views.xml',
|
||||
'views/property_transaction_confirmed.xml',
|
||||
'views/yuthon_resource_mgmt_config_views.xml',
|
||||
'views/property_evaluate_application_views.xml',
|
||||
'views/yuthon_property_evaluation_views.xml',
|
||||
|
||||
@@ -9,4 +9,7 @@ from . import yuthon_resource_mgmt_config
|
||||
from . import yuthon_draw_result
|
||||
from . import yuthon_expert_database
|
||||
from . import yuthon_property_evaluation
|
||||
from . import property_evaluate_application
|
||||
from . import property_evaluate_application
|
||||
from . import property_rental_form
|
||||
|
||||
from . import property_transaction_confirmed
|
||||
@@ -4,12 +4,12 @@ from odoo import models, fields, api
|
||||
class PropertyEvaluateApplication(models.Model):
|
||||
_name = 'property.evaluate.application'
|
||||
_description = '物业评估申请'
|
||||
_inherit = 'mail.activity.mixin'
|
||||
_inherit = ['soong.workflow.mixin']
|
||||
|
||||
|
||||
name = fields.Char(string='标题')
|
||||
code = fields.Char(string='编号', required=True, copy=False,
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_property_code_sequence'))
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_property_code'))
|
||||
main_text = fields.Html(string='正文')
|
||||
is_meet = fields.Boolean(string="是否上会")
|
||||
is_experts = fields.Boolean(string="是否需要专家评审")
|
||||
|
||||
@@ -2,7 +2,7 @@ from odoo import models, fields, api
|
||||
|
||||
|
||||
class PropertyRentalForm(models.Model):
|
||||
_name = 'yuthon.property.rental.form'
|
||||
_name = 'property.rental.form'
|
||||
_description = '出租申报表'
|
||||
|
||||
name = fields.Char(string='名称')
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
from odoo import models, fields, api, exceptions, _
|
||||
from datetime import datetime
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
|
||||
class PropertyTransactionConfirmed(models.Model):
|
||||
_name = 'property.transaction.confirmed'
|
||||
_description = '成交确认书'
|
||||
|
||||
|
||||
name = fields.Char(string='标题')
|
||||
property_id = fields.Char(string='物业') #后续many2many字段
|
||||
lessee = fields.Char(string='承租人')
|
||||
entity_type = fields.Selection([('person', '个人'), ('enterprise', '企业')], string='实体类型')
|
||||
details = fields.Text(string='详情') #这里可以完善承租方信息,为租赁合同服务
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields, api
|
||||
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
class YuthonPropertyEvaluation(models.Model):
|
||||
_name = 'yuthon.property.evaluation'
|
||||
@@ -20,6 +20,7 @@ class YuthonPropertyEvaluation(models.Model):
|
||||
district_manager = fields.Char(string='片区负责人')
|
||||
company = fields.Char(string='所属公司')
|
||||
remarks = fields.Text(string='备注')
|
||||
state = fields.Selection([('done','已评估'), ('draft','待评估'), ('ing','评估中')],string='评估状态',default='draft')
|
||||
|
||||
sequence = fields.Integer(string='序号', default=10)
|
||||
|
||||
@@ -37,4 +38,23 @@ class YuthonPropertyEvaluation(models.Model):
|
||||
assessment_category = fields.Char(string='评估类别')
|
||||
property_message_id = fields.Many2one('property.evaluate.application', string='关联物业评估申请')
|
||||
|
||||
def all_issue_pull(self):
|
||||
issue_active_ids = self.env["yuthon.property.evaluation"].browse(self._context.get('active_ids', self._context.get('active_id')))
|
||||
if self.state != 'draft':
|
||||
raise UserError("当前状态不允许提交")
|
||||
for i in issue_active_ids:
|
||||
if i.state != 'draft':
|
||||
raise UserError("当前状态不允许提交")
|
||||
form_id = self.env.ref("yuthon_property.property_evaluate_application_form").id
|
||||
if not issue_active_ids:
|
||||
issue_active_ids = self
|
||||
for record in issue_active_ids:
|
||||
record.write({"state": "ing"})
|
||||
return {
|
||||
'name': '提交评估',
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'property.evaluate.application',
|
||||
'views': [(form_id, 'form')],
|
||||
'context':{'default_property_message_ids':[(6, 0,issue_active_ids.ids)]},
|
||||
|
||||
}
|
||||
|
||||
@@ -16,5 +16,8 @@ access_yuthon_resource_purpose,yuthon_resource_purpose,model_yuthon_resource_pur
|
||||
access_yuthon_resource_management_type,yuthon_resource_management_type,model_yuthon_resource_management_type,base.group_user,1,1,1,1
|
||||
access_yuthon_resource_billing_type,yuthon_resource_billing_type,model_yuthon_resource_billing_type,base.group_user,1,1,1,1
|
||||
access_property_evaluate_application,property_evaluate_application,model_property_evaluate_application,base.group_user,1,1,1,1
|
||||
|
||||
access_property_rental_form,property_rental_form,model_property_rental_form,base.group_user,1,1,1,1
|
||||
access_property_transaction_confirmed,property_transaction_confirmed,model_property_transaction_confirmed,base.group_user,1,1,1,1
|
||||
access_yuthon_property_evaluation,yuthon_property_evaluation,model_yuthon_property_evaluation,base.group_user,1,1,1,1
|
||||
access_property_eligibility_line,property_eligibility_line,model_property_eligibility_line,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
@@ -55,23 +55,25 @@
|
||||
<menuitem id="yuthon_property_menu_data"
|
||||
sequence="7"
|
||||
name="招租"
|
||||
parent="yuthon_property_menu_root"
|
||||
action="yuthon_property_action"/>
|
||||
parent="yuthon_property_menu_root"/>
|
||||
|
||||
<menuitem id="yuthon_property_rental_form"
|
||||
sequence="1"
|
||||
name="出租申报表"
|
||||
parent="yuthon_property_menu_data"
|
||||
action="yuthon_property_action"/>
|
||||
action="action_property_rental_form"/>
|
||||
|
||||
<menuitem id="yuthon_property_eligibility_form"
|
||||
sequence="3"
|
||||
name="承租资格申报表"
|
||||
parent="yuthon_property_menu_data"
|
||||
action="yuthon_property_action"/>
|
||||
action="yuthon_property_approval.property_eligibility_action"/>
|
||||
|
||||
<menuitem id="yuthon_property_confirmation_of_transaction_menu"
|
||||
sequence="5"
|
||||
name="成交确认书"
|
||||
parent="yuthon_property_menu_data"
|
||||
action="yuthon_property_action"/>
|
||||
action="action_property_transaction_confirmed"/>
|
||||
|
||||
<menuitem id="yuthon_property_estate_menu"
|
||||
sequence="9"
|
||||
@@ -86,7 +88,7 @@
|
||||
sequence="3"
|
||||
name="租赁合同"
|
||||
parent="yuthon_property_estate_menu"
|
||||
action="property_assess_action"/>
|
||||
action="yuthon_property_approval.property_lease_contract_action"/>
|
||||
|
||||
<menuitem id="yuthon_property_science_menu"
|
||||
sequence="10"
|
||||
|
||||
@@ -35,38 +35,42 @@
|
||||
<group string="物业信息" col="3">
|
||||
<group>
|
||||
<field name="property_address"/>
|
||||
<field name="property_address"/>
|
||||
<field name="property_address"/>
|
||||
<field name="current_status"/>
|
||||
<field name="evaluate_rent_price"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="property_address"/>
|
||||
<field name="property_address"/>
|
||||
<field name="registered_use"/>
|
||||
<field name="owner"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="property_address"/>
|
||||
<field name="property_address"/>
|
||||
<field name="evaluation_area"/>
|
||||
<field name="now_rent_price"/>
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
name = fields.Char(string='名称')
|
||||
property_address = fields.Char(string='物业地址')
|
||||
registered_use = fields.Char(string='证载用途')
|
||||
evaluation_area = fields.Float(string='出租面积(m²)')
|
||||
current_status = fields.Date(string='租聘到期日')
|
||||
owner = fields.Char(string='原租户')
|
||||
now_rent_price = fields.Float(string='现租价(元/m² •月)')
|
||||
evaluate_rent_price = fields.Float(string='评估租(元/m² •月)')
|
||||
upset_square = fields.Float(string='底价(元/m² •月)')
|
||||
upset = fields.Float(string='底价(元/月)')
|
||||
lease_period = fields.Char(string='租凭年限')
|
||||
increment_rate = fields.Float(string='递增率')
|
||||
rental_use = fields.Char(string='出租用途')
|
||||
other = fields.Char(string='其他')
|
||||
remarks = fields.Text(string='备注')
|
||||
</group>
|
||||
<group string="出租条件" col="3">
|
||||
<group>
|
||||
<field name="upset"/>
|
||||
<field name="rental_use"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="lease_period"/>
|
||||
<field name="other"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="increment_rate"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="备注">
|
||||
<field name="remarks" string=" "/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- action -->
|
||||
<record id="action_property_rental_form" model="ir.actions.act_window">
|
||||
<field name="name">出租申请表</field>
|
||||
<field name="res_model">property.rental.form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_property_transaction_confirmed_tree" model="ir.ui.view">
|
||||
<field name="name">property.transaction.confirmed.tree</field>
|
||||
<field name="model">property.transaction.confirmed</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="成交确认书">
|
||||
<field name="name"/>
|
||||
<field name="property_id"/>
|
||||
<field name="lessee"/>
|
||||
<field name="entity_type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_property_transaction_confirmed_form" model="ir.ui.view">
|
||||
<field name="name">property.transaction.confirmed.form</field>
|
||||
<field name="model">property.transaction.confirmed</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="成交确认书">
|
||||
<sheet>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<field name="property_id"/>
|
||||
<field name="lessee"/>
|
||||
<field name="entity_type"/>
|
||||
<field name="details"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_property_transaction_confirmed" model="ir.actions.act_window">
|
||||
<field name="name">成交确认书</field>
|
||||
<field name="res_model">property.transaction.confirmed</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -11,13 +11,15 @@
|
||||
<field name="property_area"/>
|
||||
<field name="rentable_area"/>
|
||||
<field name="unit_price"/>
|
||||
<field name="current_status"/>
|
||||
<field name="registered_use"/>
|
||||
<field name="current_status" optional="hide"/>
|
||||
<field name="registered_use" optional="hide"/>
|
||||
<field name="rental_use"/>
|
||||
<field name="rental_conditions"/>
|
||||
<field name="district_manager"/>
|
||||
<field name="company"/>
|
||||
<field name="remarks"/>
|
||||
<field name="rental_conditions" optional="hide"/>
|
||||
<field name="district_manager" optional="hide"/>
|
||||
<field name="company" optional="show"/>
|
||||
<field name="remarks" optional="hide"/>
|
||||
<field name="state"/>
|
||||
<button name="all_issue_pull" string="提交" type="object" class="btn btn-primary"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -42,6 +44,7 @@
|
||||
<field name="rental_use"/>
|
||||
<field name="district_manager"/>
|
||||
<field name="company"/>
|
||||
<field name="state" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
@@ -59,8 +62,6 @@
|
||||
</record>
|
||||
|
||||
<!-- 已评估物业-->
|
||||
rental_form
|
||||
|
||||
<record id="yuthon_property_evaluation_view_tree2" model="ir.ui.view">
|
||||
<field name="name">yuthon_property_evaluation_view_tree</field>
|
||||
<field name="model">yuthon.property.evaluation</field>
|
||||
@@ -71,16 +72,17 @@ rental_form
|
||||
<field name="evaluation_area"/>
|
||||
<field name="evaluation_category"/>
|
||||
<field name="owner"/>
|
||||
<field name="registered_use"/>
|
||||
<field name="set_purpose"/>
|
||||
<field name="current_status"/>
|
||||
<field name="registered_use" optional="hide"/>
|
||||
<field name="set_purpose" optional="hide"/>
|
||||
<field name="current_status" optional="hide"/>
|
||||
<field name="rental_conditions"/>
|
||||
<field name="remarks"/>
|
||||
<field name="last_hand_rent_price"/>
|
||||
<field name="gov_rent_price" optional="hide"/>
|
||||
<field name="evaluation_rent_price" optional="hide"/>
|
||||
<field name="evaluation_rent_total" optional="hide"/>
|
||||
<field name="evaluation_whole_rent_price" optional="hide"/>
|
||||
<field name="state"/>
|
||||
<field name="gov_rent_price" optional="hide"/>
|
||||
<field name="evaluation_rent_price" optional="hide"/>
|
||||
<field name="evaluation_rent_total" optional="hide"/>
|
||||
<field name="evaluation_whole_rent_price" optional="hide"/>
|
||||
<field name="evaluation_whole_rent_total" optional="hide"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -111,6 +113,7 @@ rental_form
|
||||
<field name="evaluation_rent_total" />
|
||||
<field name="evaluation_whole_rent_price" />
|
||||
<field name="evaluation_whole_rent_total"/>
|
||||
<field name="state" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
@@ -151,8 +154,7 @@ rental_form
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">yuthon.property.evaluation</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="domain">[('state','=','draft')]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property_evaluation_view_tree1')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_property_evaluation_view_form1')})]"/>
|
||||
@@ -164,12 +166,19 @@ rental_form
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">yuthon.property.evaluation</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="domain">[('state','=','ing')]</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property_evaluation_view_tree2')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_property_evaluation_view_form2')})]"/>
|
||||
<field name="search_view_id" ref="yuthon_property_evaluation_view_search"/>
|
||||
|
||||
</record>
|
||||
<record id="all_issue_pull" model="ir.actions.server">
|
||||
<field name="name">批量提交</field>
|
||||
<field name="model_id" ref="yuthon_property.model_yuthon_property_evaluation"/>
|
||||
<field name="binding_model_id" ref="yuthon_property.model_yuthon_property_evaluation"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.all_issue_pull()</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -36,12 +36,6 @@
|
||||
action="property_early_quitting_action"
|
||||
sequence="24"/>
|
||||
|
||||
<menuitem
|
||||
id="property_eligibility_menu"
|
||||
parent="yuthon_property.property_approval_menu"
|
||||
name="承租资格审批"
|
||||
action="property_eligibility_action"
|
||||
sequence="25"/>
|
||||
|
||||
<menuitem
|
||||
id="property_fitment_menu"
|
||||
@@ -161,12 +155,12 @@
|
||||
name="更名申请表"
|
||||
action="property_renamed_action"
|
||||
sequence="42"/>
|
||||
<menuitem
|
||||
id="property_contract_changes_menu"
|
||||
parent="yuthon_property.property_approval_menu"
|
||||
name="租聘合同变更审批"
|
||||
action="action_property_contract_changes"
|
||||
sequence="43"/>
|
||||
<!-- <menuitem-->
|
||||
<!-- id="property_contract_changes_menu"-->
|
||||
<!-- parent="yuthon_property.property_approval_menu"-->
|
||||
<!-- name="租聘合同变更审批"-->
|
||||
<!-- action="action_property_contract_changes"-->
|
||||
<!-- sequence="43"/>-->
|
||||
<menuitem
|
||||
id="property_construction_work_menu"
|
||||
parent="yuthon_property.property_approval_menu"
|
||||
|
||||
Reference in New Issue
Block a user