Merge branch 'dev' of gitee.com:jinan-pengyusen-data/gzth into dev
This commit is contained in:
@@ -24,6 +24,10 @@ class HrContract(models.Model):
|
||||
is_internship = fields.Boolean(string="实习期", compute='_compute_name', store=True)
|
||||
date_end = fields.Date(string="合同结束时间", compute='_compute_date_end', store=True)
|
||||
termination_date = fields.Date(string="中止时间")
|
||||
reason_suspension = fields.Selection([
|
||||
('turnover', '离职'),
|
||||
('died', '意外离世'),
|
||||
], string='中止原因')
|
||||
work_entry_source = fields.Selection([
|
||||
('calendar', '考勤安排'),
|
||||
('attendance', 'Attendances'),
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='contract_type_id']" position="after">
|
||||
<field name="termination_date"/>
|
||||
<field name="reason_suspension" required="termination_date" invisible="not termination_date"/>
|
||||
<field name="salary_day" invisible="not is_internship"/>
|
||||
<field name="salary_group_id" options="{'no_create': True}"/>
|
||||
<field name="is_internship" invisible="1"/>
|
||||
|
||||
@@ -16,9 +16,24 @@ class YuthonVacationReports(models.Model):
|
||||
meal_fee_ids = fields.One2many('vacation.meal.line', 'vacation_id', string='误餐明细')
|
||||
medical_fee_ids = fields.One2many('vacation.medical.line', 'vacation_id', string='体检费明细')
|
||||
|
||||
leave = fields.Float(string='年假', compute='_compute_leave', store=True)
|
||||
working_overtime = fields.Float(string='加班时', compute='_compute_working_overtime', store=True)
|
||||
leave = fields.Char(string='年假', compute='_compute_leave', store=True)
|
||||
working_overtime = fields.Char(string='加班时', compute='_compute_working_overtime', store=True)
|
||||
meal_fee = fields.Integer(string="误餐次数", compute='_compute_meal_fee', store=True)
|
||||
medical_fee = fields.Float(string="体检费", compute='_compute_medical_fee', store=True)
|
||||
|
||||
@api.depends('medical_fee_ids.update_type', 'medical_fee_ids.lines', 'medical_fee_ids.is_void')
|
||||
def _compute_medical_fee(self):
|
||||
for record in self:
|
||||
total = 0.0
|
||||
valid_lines = record.medical_fee_ids.filtered(lambda l: not l.is_void)
|
||||
|
||||
for line in valid_lines:
|
||||
if line.update_type == 'add':
|
||||
total += line.lines
|
||||
elif line.update_type == 'reduce':
|
||||
total -= line.lines
|
||||
|
||||
record.medical_fee = max(total, 0.0)
|
||||
|
||||
def action_open_my_form(self):
|
||||
employee = self.env.user.employee_id
|
||||
@@ -87,14 +102,17 @@ class YuthonVacationReports(models.Model):
|
||||
@api.depends('leave_ids.update_lines', 'leave_ids.update_type', 'leave_ids.is_void')
|
||||
def _compute_leave(self):
|
||||
for record in self:
|
||||
leave_total = 0.0
|
||||
leave_hours = 0.0
|
||||
for line in record.leave_ids:
|
||||
if not line.is_void:
|
||||
line_value = line.update_lines or 0
|
||||
if line.update_type == 'add':
|
||||
leave_total += line.update_lines or 0
|
||||
leave_hours += line_value
|
||||
elif line.update_type == 'reduce':
|
||||
leave_total -= line.update_lines or 0
|
||||
record.leave = leave_total
|
||||
leave_hours -= line_value
|
||||
|
||||
leave_days = leave_hours / 8
|
||||
record.leave = f"{leave_hours:.2f}小时({leave_days:.2f}天)"
|
||||
|
||||
@api.depends(
|
||||
'overtime_ids.workday',
|
||||
@@ -105,15 +123,17 @@ class YuthonVacationReports(models.Model):
|
||||
)
|
||||
def _compute_working_overtime(self):
|
||||
for record in self:
|
||||
overtime_total = 0.0
|
||||
overtime_hours = 0.0
|
||||
for line in record.overtime_ids:
|
||||
if not line.is_void:
|
||||
line_total = (line.workday or 0) + (line.legal_day or 0) + (line.public_holidays or 0)
|
||||
if line.update_type == 'add':
|
||||
overtime_total += line_total
|
||||
overtime_hours += line_total
|
||||
elif line.update_type == 'reduce':
|
||||
overtime_total -= line_total
|
||||
record.working_overtime = overtime_total
|
||||
overtime_hours -= line_total
|
||||
|
||||
overtime_days = overtime_hours / 8
|
||||
record.working_overtime = f"{overtime_hours:.2f}小时({overtime_days:.2f}天)"
|
||||
|
||||
@api.depends('meal_fee_ids.update_lines', 'meal_fee_ids.update_type', 'meal_fee_ids.is_void')
|
||||
def _compute_meal_fee(self):
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="users_id"/>
|
||||
<field name="users_id" options="{'no_create': True}"/>
|
||||
<field name="days" invisible="1"/>
|
||||
<field name="employee_id" invisible="1" force_save="1"/>
|
||||
<field name="text"/>
|
||||
|
||||
@@ -22,15 +22,18 @@
|
||||
<form string="假期额度日志">
|
||||
<sheet>
|
||||
<field name="employee_id" invisible="1"/>
|
||||
<group col="3">
|
||||
<group col="4">
|
||||
<group>
|
||||
<field name="leave" string="剩余年假(h)"/>
|
||||
<field name="leave" string="剩余年假"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="working_overtime" string="剩余补休(h)"/>
|
||||
<field name="working_overtime" string="剩余补休"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="meal_fee" string="剩余误餐费(h)"/>
|
||||
<field name="meal_fee" string="剩余误餐费"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="medical_fee" string="剩余体检费"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
@@ -128,15 +131,15 @@
|
||||
<form string="我的假期额度记录" create="0" edit="0" delete="0">
|
||||
<sheet>
|
||||
<field name="employee_id" invisible="1"/>
|
||||
<group col="3">
|
||||
<group col="4">
|
||||
<group>
|
||||
<field name="leave" string="剩余年假(h)" readonly="1"/>
|
||||
<field name="leave" string="剩余年假" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="working_overtime" string="剩余补休(h)" readonly="1"/>
|
||||
<field name="working_overtime" string="剩余补休" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="meal_fee" string="剩余误餐费(h)" readonly="1"/>
|
||||
<field name="meal_fee" string="剩余误餐费" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
'views/yuthon_customer_planning_views.xml',
|
||||
'views/planning_slot_template_views.xml',
|
||||
'views/hr_attendance_month_views.xml',
|
||||
'views/wife_message_view.xml',
|
||||
'views/wifi_message_view.xml',
|
||||
'views/hr_attendance_portal_templates.xml',
|
||||
'wizard/hr_attendance_month_wizard_views.xml',
|
||||
'wizard/yuthon_delete_planning_wizard_views.xml',
|
||||
|
||||
@@ -15,7 +15,7 @@ class AppletAddress(models.Model):
|
||||
company_id = fields.Many2one('res.company', string="公司")
|
||||
longitude = fields.Float(string="经度", digits=(16, 10))
|
||||
latitude = fields.Float(string="纬度", digits=(16, 10))
|
||||
wife_name_ids = fields.Many2many('wife.message', string="wife名称")
|
||||
wifi_name_ids = fields.Many2many('wifi.message', string="wifi名称")
|
||||
card_rice = fields.Integer(string="打卡范围(米)")
|
||||
|
||||
def update_employee(self):
|
||||
|
||||
@@ -103,12 +103,12 @@ class AppletAttendance(Controller):
|
||||
self_address = self.get_address_from_coords(kw['att_latitude'], kw['att_longitude'])
|
||||
|
||||
for address_id in address_ids:
|
||||
wife_name_list = address_id.wife_name_ids.mapped('name')
|
||||
wifi_name_list = address_id.wifi_name_ids.mapped('name')
|
||||
card_rice = address_id.card_rice * 0.001 # 打卡范围
|
||||
_logger.info(f"\n应打卡地址 地址验证: {address_id.address_name} 详细: {address_id.address_name2}___")
|
||||
_logger.info(f"\n人员: {employee_id.name} 当前所在地址: {self_address['formatted_address']}__________")
|
||||
_logger.info(f"\n可打卡 当前经度: {kw['att_longitude']} 当前纬度: {kw['att_latitude']} 范围:{address_id.card_rice}米__________")
|
||||
if self.is_within_radius_geopy(kw['att_latitude'], kw['att_longitude'], address_id.latitude, address_id.longitude, card_rice) and kw['wife_name'] in wife_name_list:
|
||||
if self.is_within_radius_geopy(kw['att_latitude'], kw['att_longitude'], address_id.latitude, address_id.longitude, card_rice) and kw['wifi_name'] in wifi_name_list:
|
||||
message = '可以打卡'
|
||||
state = 'yes'
|
||||
_logger.info(f"\n可打卡")
|
||||
|
||||
@@ -25,7 +25,7 @@ from . import yuthon_customer_planning
|
||||
from . import hr_attendance_wechat
|
||||
from . import hr_attendance_detail_wechat
|
||||
from . import hr_attendance_month
|
||||
from . import wife_message
|
||||
from . import wifi_message
|
||||
|
||||
|
||||
# from odoo.tools import SQL
|
||||
|
||||
+3
-3
@@ -4,9 +4,9 @@ from datetime import datetime, time, timedelta
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class WifeMessage(models.Model):
|
||||
_name = 'wife.message'
|
||||
_description = 'wife名称管理'
|
||||
class WifiMessage(models.Model):
|
||||
_name = 'wifi.message'
|
||||
_description = 'wifi名称管理'
|
||||
|
||||
ip = fields.Char(string='IP')
|
||||
name = fields.Char(string='名称')
|
||||
@@ -59,4 +59,4 @@ access_yuthon_integrated_wizard,yuthon.integrated.wizard,model_yuthon_integrated
|
||||
access_applet_address,applet.address,model_applet_address,base.group_user,1,1,1,1
|
||||
access_applet_security,applet.security,model_applet_security,base.group_user,1,1,1,1
|
||||
access_applet_security_setting,applet.security.setting,model_applet_security_setting,base.group_user,1,1,1,1
|
||||
access_wife_message,wife.message,model_wife_message,base.group_user,1,1,1,1
|
||||
access_wifi_message,wifi.message,model_wifi_message,base.group_user,1,1,1,1
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<field name="address_name"/>
|
||||
<field name="address_name2"/>
|
||||
<field name="employee_ids" widget="many2many_tags" column_invisible="1"/>
|
||||
<field name="wife_name_ids" widget="many2many_tags" domain="[('company_id', '=', company_id)]"/>
|
||||
<field name="wifi_name_ids" widget="many2many_tags" domain="[('company_id', '=', company_id)]"/>
|
||||
<field name="longitude"/>
|
||||
<field name="latitude"/>
|
||||
<field name="card_rice"/>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_wife_message_tree" model="ir.ui.view">
|
||||
<field name="name">wife.message.tree</field>
|
||||
<field name="model">wife.message</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Wife管理" editable="bottom">
|
||||
<field name="ip"/>
|
||||
<field name="name"/>
|
||||
<field name="company_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_wife_message_action" model="ir.actions.act_window">
|
||||
<field name="name">Wife名称管理</field>
|
||||
<field name="res_model">wife.message</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_wifi_message_tree" model="ir.ui.view">
|
||||
<field name="name">wifi.message.tree</field>
|
||||
<field name="model">wifi.message</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="wifi管理" editable="bottom">
|
||||
<field name="ip"/>
|
||||
<field name="name"/>
|
||||
<field name="company_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_wifi_message_action" model="ir.actions.act_window">
|
||||
<field name="name">wifi名称管理</field>
|
||||
<field name="res_model">wifi.message</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -49,9 +49,9 @@
|
||||
</div>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="job_id"/>
|
||||
<field name="departments_id"/>
|
||||
<field name="users_id"/>
|
||||
<field name="job_id" options="{'no_create': True}"/>
|
||||
<field name="departments_id" options="{'no_create': True}"/>
|
||||
<field name="users_id" options="{'no_create': True}"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="is_issues" invisible="is_issues == False"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
@@ -61,9 +61,9 @@
|
||||
<field name="applicant_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="name" string="姓名"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="interview_time" required="1"/>
|
||||
<field name="tage_ids" widget="many2many_tags"/>
|
||||
<field name="stage_id" options="{'no_create': True}"/>
|
||||
<field name="interview_time" required="1" options="{'no_create': True}"/>
|
||||
<field name="tage_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||
<field name="employee_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||
<button name="button_applicant_ids" type="object" string="详细信息" class="btn-primary"/>
|
||||
</tree>
|
||||
@@ -73,7 +73,7 @@
|
||||
<field name="applicant_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="name" string="姓名"/>
|
||||
<field name="interview_stage_id"/>
|
||||
<field name="interview_stage_id" options="{'no_create': True}"/>
|
||||
<field name="evaluation"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<group string="审批信息">
|
||||
<field name="name" required="1"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="users_id"/>
|
||||
<field name="users_id" options="{'no_create': True}"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="contracted_status"/>
|
||||
<field name="use_user_type" readonly="0"/>
|
||||
@@ -57,7 +57,7 @@
|
||||
<field name="issues_result" invisible="is_issues == False"/>
|
||||
</group>
|
||||
<group string="甲方信息">
|
||||
<field name="party_id"/>
|
||||
<field name="party_id" options="{'no_create': True}"/>
|
||||
<field name="representatives"/>
|
||||
<field name="economy_type"/>
|
||||
<field name="address"/>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</group>
|
||||
<group string="申请人信息" col="3">
|
||||
<group>
|
||||
<field name="users_id"/>
|
||||
<field name="users_id" options="{'no_create': True}"/>
|
||||
<field name="is_issues"/>
|
||||
<field name="related_issues_id" invisible="not is_issues"/>
|
||||
</group>
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
name="wife名称管理"
|
||||
parent="hr_attendance_root_board_menu"
|
||||
sequence="15"
|
||||
action="yuthon_hr_attendance.view_wife_message_action"/>
|
||||
action="yuthon_hr_attendance.view_wifi_message_action"/>
|
||||
<menuitem id="menu_applet_address_board"
|
||||
name="小程序地址管理"
|
||||
parent="hr_attendance_root_board_menu"
|
||||
|
||||
Reference in New Issue
Block a user