1
This commit is contained in:
@@ -151,7 +151,7 @@ function makeRouter(env) {
|
||||
*/
|
||||
function makeDebouncedPush(mode) {
|
||||
let allPushArgs = [];
|
||||
async function doPush() {
|
||||
function doPush() {
|
||||
// Aggregates push/replace state arguments
|
||||
const replace = allPushArgs.some(([, options]) => options && options.replace);
|
||||
const newHash = allPushArgs.reduce((finalHash, [hash, options]) => {
|
||||
@@ -168,34 +168,42 @@ function makeRouter(env) {
|
||||
}
|
||||
// If the route changed: pushes or replaces browser state
|
||||
const url = browser.location.origin + routeToUrl(newRoute);
|
||||
|
||||
// softhealer ---quick menu start
|
||||
|
||||
var sh_url = url
|
||||
if (sh_url) {
|
||||
var rec = await jsonrpc("/web/dataset/call_kw/sh.wqm.quick.menu/is_quick_menu_avail_url", {
|
||||
model: 'sh.wqm.quick.menu',
|
||||
method: 'is_quick_menu_avail_url',
|
||||
args: ['', sh_url],
|
||||
kwargs: {},
|
||||
});
|
||||
|
||||
if (rec) {
|
||||
// softhealer ---quick menu start
|
||||
var sh_url = url
|
||||
if (sh_url) {
|
||||
const jsonData = {
|
||||
id: Math.floor(Math.random() * 1000 * 1000 * 1000),
|
||||
jsonrpc: "2.0",
|
||||
method: "call",
|
||||
params: {
|
||||
args: ['', sh_url],
|
||||
kwargs: {},
|
||||
method: "is_quick_menu_avail_url",
|
||||
model: "sh.wqm.quick.menu",
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
url: "/web/dataset/call_kw/",
|
||||
method: "POST",
|
||||
dataType: 'json',
|
||||
async: false, // 设置为同步请求
|
||||
beforeSend: (xhr) => {xhr.setRequestHeader('Content-Type', 'application/json');},
|
||||
data : JSON.stringify(jsonData),
|
||||
success: (rec) => {
|
||||
if (rec) {
|
||||
$('.o_main_navbar').find('.o_menu_systray').find('.sh_bookmark').addClass('active');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$('.o_main_navbar').find('.o_menu_systray').find('.sh_bookmark').removeClass('active');
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('.o_main_navbar').find('.o_menu_systray').find('.sh_bookmark').removeClass('active');
|
||||
}
|
||||
// quick menu end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
$('.o_main_navbar').find('.o_menu_systray').find('.sh_bookmark').removeClass('active');
|
||||
}
|
||||
});
|
||||
} else{
|
||||
$('.o_main_navbar').find('.o_menu_systray').find('.sh_bookmark').removeClass('active');
|
||||
}
|
||||
// quick menu end
|
||||
if (mode === "push") {
|
||||
browser.history.pushState({}, "", url);
|
||||
} else {
|
||||
|
||||
@@ -71,10 +71,9 @@ class InheritHrPayslip(models.Model):
|
||||
paid_tax = fields.Float(string='已缴税额')
|
||||
based_pay = fields.Float(string='临时绩效工资')
|
||||
|
||||
performance_deduction = fields.Float(string='扣发绩效奖金', store=True)
|
||||
attendance_deduction = fields.Float(string='扣发全勤奖', store=True)
|
||||
commuting_deduction = fields.Float(string='扣发通信补贴', store=True)
|
||||
base_salary_deduction = fields.Float(string='扣发基本工资', store=True)
|
||||
performance_deduction = fields.Float(string='扣发绩效奖金', compute='_compute_salary', store=True)
|
||||
commuting_deduction = fields.Float(string='扣发通信补贴', compute='_compute_salary', store=True)
|
||||
base_salary_deduction = fields.Float(string='扣发基本工资', compute='_compute_salary', store=True)
|
||||
|
||||
|
||||
def action_refresh_from_work_entries(self):
|
||||
@@ -87,6 +86,7 @@ class InheritHrPayslip(models.Model):
|
||||
pay.mapped('line_ids').unlink()
|
||||
pay._compute_worked_days_line_ids()
|
||||
pay.compute_sheet()
|
||||
|
||||
@api.depends('line_ids')
|
||||
def _compute_salary(self):
|
||||
for rec in self:
|
||||
@@ -148,6 +148,12 @@ class InheritHrPayslip(models.Model):
|
||||
rec.work_injury_insurance = line.total
|
||||
if line.name == '住房公积金':
|
||||
rec.housing_provident_fund = line.total
|
||||
if line.name == '扣发绩效奖金':
|
||||
rec.performance_deduction = line.total
|
||||
if line.name == '扣发基本工资':
|
||||
rec.base_salary_deduction = line.total
|
||||
if line.name == '扣发通讯补贴':
|
||||
rec.commuting_deduction = line.total
|
||||
|
||||
|
||||
def put_payslip(self):
|
||||
|
||||
@@ -53,6 +53,12 @@ class YuthonPayrollCommon(models.Model):
|
||||
rule_list = []
|
||||
formula_salary = ''
|
||||
if ins.name not in sal.rule_ids.mapped('name'):
|
||||
if ins.name == '扣发绩效奖金':
|
||||
formula_salary = "result = employee.last_month_performance_deduction"
|
||||
if ins.name == '扣发通信补贴':
|
||||
formula_salary = "result = employee.last_month_commuting_deduction"
|
||||
if ins.name == '扣发基本工资':
|
||||
formula_salary = "result = employee.last_month_base_salary_deduction"
|
||||
if ins.name == '工龄工资':
|
||||
formula_salary = "result = (employee.company_old_year) * 10"
|
||||
if ins.name == '误餐费':
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
<field name="overtime_pay"/>
|
||||
<field name="full_attendance_award"/>
|
||||
<field name="performance_deduction"/>
|
||||
<field name="attendance_deduction"/>
|
||||
<field name="commuting_deduction"/>
|
||||
<field name="base_salary_deduction"/>
|
||||
<field name="assessment_reserved_amount"/>
|
||||
@@ -142,7 +141,6 @@
|
||||
<field name="study_on" invisible="1"/>
|
||||
<field name="jing_te" invisible="1"/>
|
||||
<field name="performance_deduction" invisible="1"/>
|
||||
<field name="attendance_deduction" invisible="1"/>
|
||||
<field name="commuting_deduction" invisible="1"/>
|
||||
<field name="base_salary_deduction" invisible="1"/>
|
||||
<field name="commercial_health_insurance" invisible="1"/>
|
||||
@@ -185,7 +183,6 @@
|
||||
<field name="overtime_pay"/>
|
||||
<field name="meal_misunderstanding_fee"/>
|
||||
<field name="performance_deduction" decoration-success="1"/>
|
||||
<field name="attendance_deduction" decoration-success="1"/>
|
||||
<field name="commuting_deduction" decoration-success="1"/>
|
||||
<field name="base_salary_deduction" decoration-success="1"/>
|
||||
<field name="b_year"/>
|
||||
|
||||
Reference in New Issue
Block a user