@@ -20,6 +20,7 @@ MENU_BADGE_MODEL_FUNC_ENUM = {
|
||||
'soong_workflow.menu_workflow_approval_request_my': {'model': 'soong.workflow.record', 'func': 'get_no_read_count'},
|
||||
'soong_workflow.menu_workflow_approval_request_copy': {'model': 'soong.workflow.record.copy', 'func': 'get_no_read_count'},
|
||||
'yuthon_will_task.menu_yuthon_will_task_root': {'model': 'yuthon.will.task', 'func': 'read_number'},
|
||||
'issue_library.yuthon_library_my_menu': {'model': 'issue.library', 'func': 'read_number'},
|
||||
'yuthon_property_approval.property_lease_contract_coming_menu': {'model': 'property.lease.contract', 'func': 'read_coming_count'},
|
||||
'yuthon_property_approval.property_lease_contract_coming_due_menu': {'model': 'property.lease.contract', 'func': 'read_due_count'},
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
'data/contract_code_data.xml',
|
||||
'wizard/yuthon_contract_wizard_views.xml',
|
||||
'views/inherit_hr_contract_views.xml',
|
||||
'views/inherit_hr_employee_viwes.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
from . import inherit_hr_contract
|
||||
from . import inherit_hr_employee
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, tools
|
||||
from odoo.exceptions import ValidationError
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
|
||||
class InheritHrEmployee(models.Model):
|
||||
_inherit = 'hr.employee'
|
||||
_description = 'Employee'
|
||||
|
||||
salary_group_id = fields.Many2one('yuthon.salary.group', string="工资单分组", store=True, related='contract_id.salary_group_id')
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_employee_inherit_del_form1" model="ir.ui.view">
|
||||
<field name="name">hr.employee.inherit.del.form</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="inherit_id" ref="hr.view_employee_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='public']//group[@name='departure']" position="after">
|
||||
<group name="salary_group_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -155,7 +155,7 @@ class YuthonHrEmployee(models.Model):
|
||||
pinyin_min = fields.Char(string='拼音缩写', compute='_compute_pinyin', index=True, store=True)
|
||||
|
||||
# 工资计算分组
|
||||
salary_group_id = fields.Many2one('yuthon.salary.group', string="工资单分组", store=True, index=True, compute='_compute_salary_group_id')
|
||||
salary_group_id = fields.Many2one('yuthon.salary.group', string="工资单分组", store=True)
|
||||
last_year_salary = fields.Float(string="年金基数")
|
||||
social_base_on = fields.Float(string="1-6月社保薪资基数")
|
||||
social_base_off = fields.Float(string="7-12月社保薪资基数")
|
||||
@@ -174,15 +174,6 @@ class YuthonHrEmployee(models.Model):
|
||||
for employee in self:
|
||||
employee.overtime_this_month = employee.normal_overtime_hours + employee.weekend_overtime_hours + employee.holiday_overtime_hours
|
||||
|
||||
@api.depends('contract_id')
|
||||
def _compute_salary_group_id(self):
|
||||
for employee in self:
|
||||
contract_id = self.env['hr.contract'].search([('employee_id', '=', employee.id)], limit=1)
|
||||
if contract_id:
|
||||
employee.salary_group_id = contract_id.salary_group_id.id
|
||||
else:
|
||||
employee.salary_group_id = False
|
||||
|
||||
@api.depends('social_base_on', 'social_base_off')
|
||||
def _compute_insurance_bases(self):
|
||||
current_month = datetime.now().month
|
||||
|
||||
@@ -131,7 +131,6 @@
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='public']//group[@name='departure']" position="after">
|
||||
<group string="工资计算">
|
||||
<field name="salary_group_id"/>
|
||||
<field name="last_year_salary"/>
|
||||
<field name="social_base_on"/>
|
||||
<field name="social_base_off"/>
|
||||
@@ -347,7 +346,6 @@
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='job_id']" position="after">
|
||||
<field name="use_user_type"/>
|
||||
<field name="salary_group_id" column_invisible="1"/>
|
||||
<field name="user_number" optional="hide"/>
|
||||
<field name="mobile_phone" optional="hide"/>
|
||||
<field name="user_role_id"/>
|
||||
@@ -395,7 +393,7 @@
|
||||
<field name="name">hr.employee.inherit.del.form</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="通讯录">
|
||||
<tree string="通讯录" crate="false" edit="false" delete="false">
|
||||
<field name="name"/>
|
||||
<field name="mobile_phone"/>
|
||||
<field name="department_id"/>
|
||||
|
||||
@@ -41,6 +41,7 @@ class IssueLibrary(models.Model):
|
||||
employee_id = fields.Many2one('hr.employee', string='创建人', default=lambda self: self.env.user.employee_id)
|
||||
department_id = fields.Many2one('hr.department', string='部门', related='employee_id.department_id')
|
||||
users_role_ids = fields.Many2many('soong.user.role', string='角色范围', related='employee_id.user_role_ids')
|
||||
company_id = fields.Many2one('res.company', string='公司', related='employee_id.company_id', stroe=True)
|
||||
approval_name = fields.Char(string="审批标题")
|
||||
meeting_place = fields.Char(string="会议地点")
|
||||
meeting_name = fields.Char(string="会议名称")
|
||||
@@ -54,6 +55,12 @@ class IssueLibrary(models.Model):
|
||||
|
||||
name_title = fields.Char(default=_get_default_name_title)
|
||||
|
||||
def read_number(self):
|
||||
return self.search_count([
|
||||
('issue_state', '=', 'draft'),
|
||||
('employee_id.user_id', '=', self.env.user.id)
|
||||
])
|
||||
|
||||
@api.onchange('issue_library_line_ids')
|
||||
def onchange_approval_decision_sequence(self):
|
||||
for dec in self:
|
||||
|
||||
@@ -18,4 +18,9 @@
|
||||
<field name="model_id" ref="model_issue_approval_decision"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
||||
</record>
|
||||
<record model="ir.rule" id="issue_library_rule">
|
||||
<field name="name">议题多公司</field>
|
||||
<field name="model_id" ref="model_issue_library"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -21,6 +21,7 @@
|
||||
<field name="is_district_party"/>
|
||||
<field name="issue_state"/>
|
||||
<field name="code" optional="hide"/>
|
||||
<field name="company_id" optional="hide"/>
|
||||
<field name="creart_datetime"/>
|
||||
<button name="single_issue_pull" string="提交" type="object" class="oe_highlight"/>
|
||||
<button name="issue_cancel" string="取消" type="object" class="oe_highlight"/>
|
||||
@@ -64,6 +65,7 @@
|
||||
<field name="name_text" invisible="1"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="code"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="approval_decision_sequence" invisible="1"/>
|
||||
<field name="notice_documents_ids" widget="preview_many2many"/>
|
||||
<field name="creart_datetime"/>
|
||||
@@ -193,6 +195,7 @@
|
||||
<field name="is_district_government"/>
|
||||
<field name="is_district_party"/>
|
||||
<field name="issue_state"/>
|
||||
<field name="company_id" optional="hide"/>
|
||||
<button name="single_meeting_issue" string="上会" type="object" class="oe_highlight"/>
|
||||
<button name="issue_cancel" string="取消" type="object" class="oe_highlight"/>
|
||||
<button name="unlink" string="删除" type="object" class="oe_highlight"/>
|
||||
@@ -227,6 +230,7 @@
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
<field name="approval_decision_sequence" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="notice_documents_ids" widget="preview_many2many"/>
|
||||
<field name="creart_datetime"/>
|
||||
</group>
|
||||
@@ -339,6 +343,7 @@
|
||||
<field name="is_district_government"/>
|
||||
<field name="is_district_party"/>
|
||||
<field name="issue_state"/>
|
||||
<field name="company_id" optional="hide"/>
|
||||
<button name="single_meeting_issue" string="上会" type="object" class="oe_highlight"/>
|
||||
<button name="issue_cancel" string="取消" type="object" class="oe_highlight"/>
|
||||
<button name="unlink" string="删除" type="object" class="oe_highlight"/>
|
||||
@@ -374,6 +379,7 @@
|
||||
<field name="name" required="1"/>
|
||||
<field name="name_text" invisible="1"/>
|
||||
<field name="approval_decision_sequence" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="notice_documents_ids" widget="preview_many2many"/>
|
||||
<field name="creart_datetime"/>
|
||||
</group>
|
||||
@@ -473,6 +479,7 @@
|
||||
<field name="is_district_government"/>
|
||||
<field name="is_district_party"/>
|
||||
<field name="issue_state"/>
|
||||
<field name="company_id" optional="hide"/>
|
||||
<button name="single_meeting_issue" string="上会" type="object" class="oe_highlight"/>
|
||||
<button name="issue_cancel" string="取消" type="object" class="oe_highlight"/>
|
||||
<button name="unlink" string="删除" type="object" class="oe_highlight"/>
|
||||
@@ -507,6 +514,7 @@
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
<field name="approval_decision_sequence" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="notice_documents_ids" widget="preview_many2many"/>
|
||||
<field name="creart_datetime"/>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user