添加功能
This commit is contained in:
@@ -20,7 +20,6 @@ class PropertyRentRelief(models.Model):
|
||||
situation = fields.Char(string="现场说明情况")
|
||||
is_fee = fields.Boolean(string="是否产生费用")
|
||||
labor_costs = fields.Float(string="人工费")
|
||||
device_name = fields.Char(string="设备名称")
|
||||
|
||||
confirmation_repairer = fields.Char(string="报修人确认")
|
||||
warehouse_management = fields.Char(string="库管")
|
||||
|
||||
@@ -27,6 +27,7 @@ class PropertyRentRelief(models.Model):
|
||||
software_processing_id = fields.Many2one('software.issues.processing', string="处理类型")
|
||||
hardware_processing_id = fields.Many2one('hardware.issues.processing', string="处理类型")
|
||||
resolution = fields.Text(string="解决方法")
|
||||
device_name = fields.Char(string="设备名称")
|
||||
picture_resolution_id = fields.Many2one('ir.attachment', string="图片上传")
|
||||
repair_company = fields.Char(string="维修人/公司")
|
||||
list_quotations = fields.Many2one('ir.attachment', string="报价清单")
|
||||
@@ -49,6 +50,7 @@ class PropertyRentRelief(models.Model):
|
||||
default='normal')
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
work_end = fields.Boolean(string="结束")
|
||||
device_ids = fields.One2many('property.device.line', 'report_id', string="关联设备信息明细")
|
||||
|
||||
def _get_default_name_title(self):
|
||||
return self._description if self._description else self._name
|
||||
@@ -60,4 +62,14 @@ class PropertyRentRelief(models.Model):
|
||||
if self.users_id:
|
||||
self.name = self.users_id.name
|
||||
if self.users_id and self.fault:
|
||||
self.name = self.users_id.name + self.fault
|
||||
self.name = self.users_id.name + self.fault
|
||||
|
||||
class PropertyDeviceLine(models.Model):
|
||||
_name = 'property.device.line'
|
||||
_description = '设备信息'
|
||||
|
||||
report_id = fields.Many2one('property.report.repair', string="设备信息")
|
||||
name = fields.Char(string="设备名称")
|
||||
device_specs = fields.Char(string="规格")
|
||||
mac = fields.Char(string="MAC")
|
||||
ip = fields.Char(string="IP")
|
||||
@@ -0,0 +1,38 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api, exceptions, _
|
||||
|
||||
class YuthonTaskApproval(models.Model):
|
||||
_name = 'yuthon.task.approval'
|
||||
_description = '作业审批表'
|
||||
_inherit = ['soong.workflow.mixin', '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('property_report_repair_code'))
|
||||
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
|
||||
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
|
||||
text = fields.Text(string='正文')
|
||||
document_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
start_time = fields.Date(string="申请时间")
|
||||
employee_ids = fields.Many2many('hr.employee', string="作业人员")
|
||||
task_id = fields.Many2one('yuthon.task.setting', string="作业项目")
|
||||
stack_position_ids = fields.Many2many('yuthon.stack.position', string="作业堆位")
|
||||
task_start_time = fields.Datetime(string="作业开始时间")
|
||||
task_end_time = fields.Datetime(string="作业结束时间")
|
||||
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
|
||||
default='normal')
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
work_end = fields.Boolean(string="结束")
|
||||
duration = fields.Float(string="时长", store=True)
|
||||
concentration = fields.Float(string="浓度")
|
||||
warning_value = fields.Float(string="警戒值")
|
||||
number = fields.Integer(string="数量")
|
||||
|
||||
|
||||
def _get_default_name_title(self):
|
||||
return self._description if self._description else self._name
|
||||
|
||||
name_title = fields.Char(default=_get_default_name_title)
|
||||
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, fields, api, exceptions, _
|
||||
|
||||
class YuthonTaskSetting(models.Model):
|
||||
_name = 'yuthon.task.setting'
|
||||
_description = '作业项目配置'
|
||||
|
||||
name = fields.Char(string='名称', required=True)
|
||||
standard = fields.Text(string='标准')
|
||||
inspector = fields.Text(string='工作要求')
|
||||
scope = fields.Char(string='发放范围')
|
||||
|
||||
class YuthonStackPosition(models.Model):
|
||||
_name = 'yuthon.stack.position'
|
||||
_description = '堆垛位置'
|
||||
|
||||
name = fields.Char(string='名称', required=True)
|
||||
@@ -8,4 +8,4 @@ access_maintain_service_setting,maintain_service_setting,model_maintain_service_
|
||||
access_maintain_desktop_setting,maintain_desktop_setting,model_maintain_desktop_setting,base.group_user,1,1,1,1
|
||||
access_yuthon_maintain_service,yuthon_maintain_service,model_yuthon_maintain_service,base.group_user,1,1,1,1
|
||||
access_yuthon_maintain_desktop,yuthon_maintain_desktop,model_yuthon_maintain_desktop,base.group_user,1,1,1,1
|
||||
|
||||
access_property_device_line,property_device_line,model_property_device_line,base.group_user,1,1,1,1
|
||||
|
@@ -53,6 +53,17 @@
|
||||
<field name="department_id"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="设备信息">
|
||||
<field name="device_ids" string=" ">
|
||||
<tree editable="bottom">
|
||||
<field name="report_id" column_invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="device_specs"/>
|
||||
<field name="mac"/>
|
||||
<field name="ip"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group string="故障信息">
|
||||
<field name="fault"/>
|
||||
<field name="picture_id" widget="preview_many2one"/>
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_yuthon_task_approval_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.task.approval.tree</field>
|
||||
<field name="model">yuthon.task.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="作业审批表">
|
||||
<field name="name"/>
|
||||
<field name="employee_ids" widget="many2many_tags"/>
|
||||
<field name="task_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_task_approval_form" model="ir.ui.view">
|
||||
<field name="name">yuthon.task.approval.form</field>
|
||||
<field name="model">yuthon.task.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="作业审批表">
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
|
||||
invisible="urgency_level != 'normal'"/>
|
||||
<widget name="web_ribbon" title="急件" bg_color="text-bg-warning"
|
||||
invisible="urgency_level != 'urgent'"/>
|
||||
<widget name="web_ribbon" title="特级" bg_color="text-bg-danger"
|
||||
invisible="urgency_level != 'emergency'"/>
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="name" string="保修编号" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="urgency_level" readonly="1"/>
|
||||
</group>
|
||||
<group/>
|
||||
</group>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
<field name="name_title" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group string="审批事项">
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="users_id"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="start_time"/>
|
||||
<field name="text"/>
|
||||
<field name="document_ids" widget="preview_many2many"/>
|
||||
</group>
|
||||
<group string="详细">
|
||||
<field name="employee_ids" widget="many2many_tags"/>
|
||||
<field name="task_id"/>
|
||||
<field name="stack_position_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="task_start_time"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="task_end_time"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="duration"/>
|
||||
<field name="concentration"/>
|
||||
<field name="warning_value"/>
|
||||
<field name="number"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_task_approval_action" model="ir.actions.act_window">
|
||||
<field name="name">作业审批表</field>
|
||||
<field name="res_model">yuthon.task.approval</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_yuthon_task_setting_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.task.setting.tree</field>
|
||||
<field name="model">yuthon.task.setting</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="作业项目配置" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="standard"/>
|
||||
<field name="inspector"/>
|
||||
<field name="scope"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_task_setting_action" model="ir.actions.act_window">
|
||||
<field name="name">作业项目配置</field>
|
||||
<field name="res_model">yuthon.task.setting</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<record id="view_yuthon_stack_position_tree" model="ir.ui.view">
|
||||
<field name="name">yuthon.stack.position.tree</field>
|
||||
<field name="model">yuthon.stack.position</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="堆位配置" editable="bottom">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_yuthon_stack_position_action" model="ir.actions.act_window">
|
||||
<field name="name">堆位配置</field>
|
||||
<field name="res_model">yuthon.stack.position</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -13,7 +13,7 @@ class SalaryComputeWizard(models.Model):
|
||||
_description = '薪资计算弹窗'
|
||||
|
||||
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
|
||||
string='公司')
|
||||
string='公司', default=lambda self: self.env.user.employee_id.yuthon_company)
|
||||
employee_ids = fields.Many2many('hr.employee', string='人员', store=True)
|
||||
select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2060)], string='年份',
|
||||
default=lambda self: str(datetime.now().year))
|
||||
|
||||
Reference in New Issue
Block a user