diff --git a/yuthon_salary/__manifest__.py b/yuthon_salary/__manifest__.py
index 9979fc76a..eca970dfd 100644
--- a/yuthon_salary/__manifest__.py
+++ b/yuthon_salary/__manifest__.py
@@ -31,10 +31,14 @@
'views/yuthon_salary_documents_views.xml',
'views/yuthon_welfare_expenses_views.xml',
'views/yuthon_payroll_retired_views.xml',
+ 'views/yuthon_meal_expenses_views.xml',
'views/yuthon_salary_year_views.xml',
'wizard/rank_log_wizard_views.xml',
+ 'wizard/salary_meal_wizard_views.xml',
'wizard/yuthon_salary_wizard_views.xml',
'wizard/salary_party_wizard_views.xml',
+ 'wizard/party_send_wizard_views.xml',
+ 'wizard/party_meal_wizard_views.xml',
'wizard/temporary_payslip_wizard_views.xml',
'wizard/salary_import_wizard_views.xml',
'wizard/yuthon_payroll_wizard_views.xml',
@@ -64,6 +68,8 @@
'yuthon_salary/static/src/js/salary_validation_button.js',
'yuthon_salary/static/src/js/salary_year_button.js',
'yuthon_salary/static/src/js/salary_import_button.js',
+ 'yuthon_salary/static/src/js/salary_meal_button.js',
+ 'yuthon_salary/static/src/xml/salary_meal_button.xml',
'yuthon_salary/static/src/xml/salary_create_button.xml',
'yuthon_salary/static/src/xml/salary_labor_button.xml',
'yuthon_salary/static/src/xml/salary_import_button.xml',
diff --git a/yuthon_salary/models/__init__.py b/yuthon_salary/models/__init__.py
index 8864f9ba9..345668a87 100644
--- a/yuthon_salary/models/__init__.py
+++ b/yuthon_salary/models/__init__.py
@@ -15,4 +15,5 @@ from . import yuthon_welfare_expenses
from . import inherit_hr_payslip_run
from . import inherit_hr_payslip_line
from . import yuthon_salary_party
-from . import yuthon_individual_tax
\ No newline at end of file
+from . import yuthon_individual_tax
+from . import yuthon_meal_expenses
\ No newline at end of file
diff --git a/yuthon_salary/models/yuthon_meal_expenses.py b/yuthon_salary/models/yuthon_meal_expenses.py
new file mode 100644
index 000000000..e0b571b42
--- /dev/null
+++ b/yuthon_salary/models/yuthon_meal_expenses.py
@@ -0,0 +1,45 @@
+from odoo import api, fields, models
+from datetime import datetime
+import calendar
+
+
+class YuthonMealExpenses(models.Model):
+ _name = 'yuthon.meal.expenses'
+ _description = '餐费'
+
+ employee_id = fields.Many2one('hr.employee', string='姓名')
+ card = fields.Char(string='身份证')
+ number_breakfasts = fields.Integer(string='早餐次数')
+ number_lunches = fields.Integer(string='午餐次数')
+ total_payment = fields.Float(string='合计缴费')
+ company_id = fields.Many2one(related='employee_id.company_id', string="公司")
+ select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
+ ('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
+ ('9', '九月'), ('10', '十月'), ('11', '十一月'),
+ ('12', '十二月')], string='月份',
+ default=lambda self: self._get_default_month())
+ select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2040)], string='年份',
+ default=lambda self: str(datetime.now().year))
+ meal_state = fields.Selection([('to_do', '待发送'), ('done', '已发送')], string='状态', default='to_do')
+
+
+ def _get_default_month(self):
+ current_month = datetime.now().month
+ return str(current_month)
+
+ def send_meal(self):
+ year = self.select_year or datetime.now().year
+ month = self.select_time or datetime.now().month
+ last_day = calendar.monthrange(year, month)[1]
+ message = f"""致{self.employee_id.name}:
+ {self.select_year}年{self.select_time}月 早餐{self.number_breakfasts} 次、午餐{self.number_lunches} 次,按餐标核算,
+ 本月餐费合计{self.total_payment}元。缴费截止{self.select_year}年{self.select_time}月{last_day}日],可汇入账户:[账户信息]。异议请联系行政部 [联系方式]。
+ 办公室
+ {fields.Date.today()}"""
+ self.sudo().env["wecom.apps"].sync_send_message(
+ category='att',
+ user_id=self.employee_id.wecom_userid,
+ message=message,
+ )
+ self.write({'party_state': 'done'})
+
diff --git a/yuthon_salary/models/yuthon_salary_party.py b/yuthon_salary/models/yuthon_salary_party.py
index 0f948e3a8..7ca732b7d 100644
--- a/yuthon_salary/models/yuthon_salary_party.py
+++ b/yuthon_salary/models/yuthon_salary_party.py
@@ -1,4 +1,5 @@
from odoo import api, fields, models
+from datetime import datetime
class YuthonSalaryParty(models.Model):
@@ -6,12 +7,35 @@ class YuthonSalaryParty(models.Model):
_description = '党建'
employee_id = fields.Many2one('hr.employee', string='姓名')
- phone = fields.Char(string='手机')
+ card = fields.Char(string='身份找')
fee = fields.Float(string='党费')
payment = fields.Float(string='补缴党费')
total_payment = fields.Float(string='合计缴费')
company_id = fields.Many2one(related='employee_id.company_id', string="公司")
+ select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
+ ('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
+ ('9', '九月'), ('10', '十月'), ('11', '十一月'),
+ ('12', '十二月')], string='月份',
+ default=lambda self: self._get_default_month())
+ select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2040)], string='年份',
+ default=lambda self: str(datetime.now().year))
+ party_state = fields.Selection([('to_do', '待发送'), ('done', '已发送')], string='状态', default='to_do')
+ def _get_default_month(self):
+ current_month = datetime.now().month
+ return str(current_month)
+ def send_party(self):
+ pay_year_month = self.select_year + '年' + self.select_time + '月'
+ message = f"""【{pay_year_month}缴纳党费通知】:
+ 请于{fields.Date.today()}(今天)15:00前将党费按时汇入账户:44001580909059000222 广州市天河投资集团有限公司,
+ 并在群里告知汇款完毕。
+ 您当月的缴费金额为{self.total_payment},其中党费{self.fee},补缴党费{self.payment}。"""
+ self.sudo().env["wecom.apps"].sync_send_message(
+ category='att',
+ user_id=self.employee_id.wecom_userid,
+ message=message,
+ )
+ self.write({'party_state': 'done'})
diff --git a/yuthon_salary/security/ir.model.access.csv b/yuthon_salary/security/ir.model.access.csv
index 34e5dc719..bf11fa4f7 100644
--- a/yuthon_salary/security/ir.model.access.csv
+++ b/yuthon_salary/security/ir.model.access.csv
@@ -39,4 +39,9 @@ access_yuthon_salary_party,access_yuthon_salary_party,model_yuthon_salary_party,
access_salary_party_wizard,access_salary_party_wizard,model_salary_party_wizard,base.group_user,1,1,1,1
access_salary_import_wizard,access_salary_import_wizard,model_salary_import_wizard,base.group_user,1,1,1,1
-access_yuthon_individual_tax,access_yuthon_individual_tax,model_yuthon_individual_tax,base.group_user,1,1,1,1
\ No newline at end of file
+access_yuthon_individual_tax,access_yuthon_individual_tax,model_yuthon_individual_tax,base.group_user,1,1,1,1
+access_party_send_wizard,access_party_send_wizard,model_party_send_wizard,base.group_user,1,1,1,1
+
+access_yuthon_meal_expenses,access_yuthon_meal_expenses,model_yuthon_meal_expenses,base.group_user,1,1,1,1
+access_party_meal_wizard,access_party_meal_wizard,model_party_meal_wizard,base.group_user,1,1,1,1
+access_salary_meal_wizard,access_salary_meal_wizard,model_salary_meal_wizard,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_salary/static/others/salary_meal.xlsx b/yuthon_salary/static/others/salary_meal.xlsx
new file mode 100644
index 000000000..5296faeeb
Binary files /dev/null and b/yuthon_salary/static/others/salary_meal.xlsx differ
diff --git a/yuthon_salary/static/others/salary_party.xlsx b/yuthon_salary/static/others/salary_party.xlsx
index 61d522f69..991dd8d29 100644
Binary files a/yuthon_salary/static/others/salary_party.xlsx and b/yuthon_salary/static/others/salary_party.xlsx differ
diff --git a/yuthon_salary/static/src/js/salary_meal_button.js b/yuthon_salary/static/src/js/salary_meal_button.js
new file mode 100644
index 000000000..29f22edff
--- /dev/null
+++ b/yuthon_salary/static/src/js/salary_meal_button.js
@@ -0,0 +1,42 @@
+/** @odoo-module */
+import {ListController} from "@web/views/list/list_controller";
+import {registry} from '@web/core/registry';
+import {listView} from '@web/views/list/list_view';
+
+export class CustomSalaryMealController extends ListController {
+ setup() {
+ super.setup();
+ }
+
+ openMealWizard() {
+ this.actionService.doAction({
+ type: 'ir.actions.act_window',
+ res_model: 'salary.meal.wizard',
+ name: '餐费导入',
+ view_mode: 'form',
+ view_type: 'form',
+ views: [[false, 'form']],
+ target: 'new',
+ context: {},
+ });
+ }
+
+ openMealSendWizard() {
+ this.actionService.doAction({
+ type: 'ir.actions.act_window',
+ res_model: 'party.meal.wizard',
+ name: '发送弹窗',
+ view_mode: 'form',
+ view_type: 'form',
+ views: [[false, 'form']],
+ target: 'new',
+ context: {},
+ });
+ }
+}
+
+registry.category("views").add("custom_meal_button", {
+ ...listView,
+ Controller: CustomSalaryMealController,
+ buttonTemplate: "meal_module.ListView.Buttons"
+});
\ No newline at end of file
diff --git a/yuthon_salary/static/src/js/salary_party_button.js b/yuthon_salary/static/src/js/salary_party_button.js
index 229ac576d..d91cd2775 100644
--- a/yuthon_salary/static/src/js/salary_party_button.js
+++ b/yuthon_salary/static/src/js/salary_party_button.js
@@ -20,6 +20,19 @@ export class CustomSalaryPartyController extends ListController {
context: {},
});
}
+
+ openPartySendWizard() {
+ this.actionService.doAction({
+ type: 'ir.actions.act_window',
+ res_model: 'party.send.wizard',
+ name: '发送弹窗',
+ view_mode: 'form',
+ view_type: 'form',
+ views: [[false, 'form']],
+ target: 'new',
+ context: {},
+ });
+ }
}
registry.category("views").add("custom_party_button", {
diff --git a/yuthon_salary/static/src/xml/salary_meal_button.xml b/yuthon_salary/static/src/xml/salary_meal_button.xml
new file mode 100644
index 000000000..53feb64ad
--- /dev/null
+++ b/yuthon_salary/static/src/xml/salary_meal_button.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_salary/static/src/xml/salary_party_button.xml b/yuthon_salary/static/src/xml/salary_party_button.xml
index a909547ba..a1cb363de 100644
--- a/yuthon_salary/static/src/xml/salary_party_button.xml
+++ b/yuthon_salary/static/src/xml/salary_party_button.xml
@@ -5,6 +5,9 @@
+
diff --git a/yuthon_salary/views/yuthon_meal_expenses_views.xml b/yuthon_salary/views/yuthon_meal_expenses_views.xml
new file mode 100644
index 000000000..f3f73a9e6
--- /dev/null
+++ b/yuthon_salary/views/yuthon_meal_expenses_views.xml
@@ -0,0 +1,27 @@
+
+
+
+ yuthon.meal.expenses.tree
+ yuthon.meal.expenses
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 餐费
+ yuthon.meal.expenses
+ tree
+
+
+
diff --git a/yuthon_salary/views/yuthon_salary_party_views.xml b/yuthon_salary/views/yuthon_salary_party_views.xml
index 72335b8a9..e03bd5a87 100644
--- a/yuthon_salary/views/yuthon_salary_party_views.xml
+++ b/yuthon_salary/views/yuthon_salary_party_views.xml
@@ -5,12 +5,16 @@
yuthon.salary.party
+
+
-
+
+
+
diff --git a/yuthon_salary/wizard/__init__.py b/yuthon_salary/wizard/__init__.py
index c5e46fbca..13f4bc72d 100644
--- a/yuthon_salary/wizard/__init__.py
+++ b/yuthon_salary/wizard/__init__.py
@@ -14,4 +14,7 @@ from . import initialize_payroll_wizard
from . import rank_log_wizard
from . import basic_pension_wizard
from . import salary_party_wizard
-from . import salary_import_wizard
\ No newline at end of file
+from . import salary_import_wizard
+from . import party_send_wizard
+from . import party_meal_wizard
+from . import salary_meal_wizard
\ No newline at end of file
diff --git a/yuthon_salary/wizard/party_meal_wizard.py b/yuthon_salary/wizard/party_meal_wizard.py
new file mode 100644
index 000000000..e82353782
--- /dev/null
+++ b/yuthon_salary/wizard/party_meal_wizard.py
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+from odoo import models, fields, api, _, SUPERUSER_ID
+from odoo.exceptions import ValidationError, UserError
+from pypinyin import pinyin, Style
+import xlrd
+import base64
+import datetime
+from datetime import datetime
+
+
+# -*- coding: utf-8 -*-
+from odoo import models, fields, api, _, SUPERUSER_ID
+from odoo.exceptions import ValidationError, UserError
+from pypinyin import pinyin, Style
+import xlrd
+import base64
+import datetime
+from datetime import datetime
+import calendar
+
+
+class PartyMealWizard(models.TransientModel):
+ _name = 'party.meal.wizard'
+ _description = '发送弹窗'
+
+ select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
+ ('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
+ ('9', '九月'), ('10', '十月'), ('11', '十一月'),
+ ('12', '十二月')], string='月份',
+ default=lambda self: self._get_default_month())
+ select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2040)], string='年份',
+ default=lambda self: str(datetime.now().year))
+ employee_ids = fields.Many2many('hr.employee', string='员工')
+
+ def confirm(self):
+ year = self.select_year or datetime.now().year
+ month = self.select_time or datetime.now().month
+ last_day = calendar.monthrange(year, month)[1]
+ if self.select_time and self.select_year and not self.employee_ids:
+ meal_ids = self.env['yuthon.meal.expenses'].search([('select_time', '=', self.select_time),
+ ('select_year', '=', self.select_year)])
+ for meal in meal_ids:
+ message = f"""致{meal.employee_id.name}:
+ {self.select_year}年{self.select_time}月 早餐{meal.number_breakfasts} 次、午餐{meal.number_lunches} 次,按餐标核算,
+ 本月餐费合计{meal.total_payment}元。缴费截止{self.select_year}年{self.select_time}月{last_day}日],可汇入账户:[账户信息]。异议请联系行政部 [联系方式]。
+ 办公室
+ {fields.Date.today()}"""
+ self.sudo().env["wecom.apps"].sync_send_message(
+ category='att',
+ user_id=meal.employee_id.wecom_userid,
+ message=message,
+ )
+ meal.write({'meal_state': 'done'})
+
+ if self.employee_ids:
+ for employee in self.employee_ids:
+ meal = self.env['yuthon.meal.expenses'].search([('employee_id', '=', employee.id),
+ ('select_time', '=', self.select_time),
+ ('select_year', '=', self.select_year)])
+ message = f"""致{meal.employee_id.name}:
+ {self.select_year}年{self.select_time}月 早餐{meal.number_breakfasts} 次、午餐{meal.number_lunches} 次,按餐标核算,
+ 本月餐费合计{meal.total_payment}元。缴费截止{self.select_year}年{self.select_time}月{last_day}日],可汇入账户:[账户信息]。异议请联系行政部 [联系方式]。
+ 办公室
+ {fields.Date.today()}"""
+ self.sudo().env["wecom.apps"].sync_send_message(
+ category='att',
+ user_id=employee.wecom_userid,
+ message=message,
+ )
+ meal.write({'meal_state': 'done'})
+
+ def _get_default_month(self):
+ current_month = datetime.now().month
+ return str(current_month)
diff --git a/yuthon_salary/wizard/party_meal_wizard_views.xml b/yuthon_salary/wizard/party_meal_wizard_views.xml
new file mode 100644
index 000000000..a27604431
--- /dev/null
+++ b/yuthon_salary/wizard/party_meal_wizard_views.xml
@@ -0,0 +1,22 @@
+
+
+
+ party.meal.wizard.form
+ party.meal.wizard
+
+
+
+
+
\ No newline at end of file
diff --git a/yuthon_salary/wizard/party_send_wizard.py b/yuthon_salary/wizard/party_send_wizard.py
new file mode 100644
index 000000000..8cde0d597
--- /dev/null
+++ b/yuthon_salary/wizard/party_send_wizard.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+from odoo import models, fields, api, _, SUPERUSER_ID
+from odoo.exceptions import ValidationError, UserError
+from pypinyin import pinyin, Style
+import xlrd
+import base64
+import datetime
+from datetime import datetime
+
+
+# -*- coding: utf-8 -*-
+from odoo import models, fields, api, _, SUPERUSER_ID
+from odoo.exceptions import ValidationError, UserError
+from pypinyin import pinyin, Style
+import xlrd
+import base64
+import datetime
+from datetime import datetime
+
+
+class PartySendWizard(models.TransientModel):
+ _name = 'party.send.wizard'
+ _description = '发送弹窗'
+
+ select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
+ ('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
+ ('9', '九月'), ('10', '十月'), ('11', '十一月'),
+ ('12', '十二月')], string='月份',
+ default=lambda self: self._get_default_month())
+ select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2040)], string='年份',
+ default=lambda self: str(datetime.now().year))
+ employee_ids = fields.Many2many('hr.employee', string='员工')
+
+ def confirm(self):
+ pay_year_month = self.select_year + '年' + self.select_time + '月'
+ if self.select_time and self.select_year and not self.employee_ids:
+ party_ids = self.env['yuthon.salary.party'].search([('select_time', '=', self.select_time),
+ ('select_year', '=', self.select_year)])
+ for party in party_ids:
+ message = f"""【{pay_year_month}缴纳党费通知】:
+ 请于{fields.Date.today()}(今天)15:00前将党费按时汇入账户:44001580909059000222 广州市天河投资集团有限公司,
+ 并在群里告知汇款完毕。
+ 您当月的缴费金额为{party.total_payment},其中党费{party.fee},补缴党费{party.payment}。"""
+ self.sudo().env["wecom.apps"].sync_send_message(
+ category='att',
+ user_id=party.employee_id.wecom_userid,
+ message=message,
+ )
+ party.write({'party_state': 'done'})
+
+ if self.employee_ids:
+ for employee in self.employee_ids:
+ party = self.env['yuthon.salary.party'].search([('employee_id', '=', employee.id),
+ ('select_time', '=', self.select_time),
+ ('select_year', '=', self.select_year)])
+ message = f"""【{pay_year_month}缴纳党费通知】:
+ 请于{fields.Date.today()}(今天)15:00前将党费按时汇入账户:44001580909059000222 广州市天河投资集团有限公司,
+ 并在群里告知汇款完毕。
+ 您当月的缴费金额为{party.total_payment},其中党费{party.fee},补缴党费{party.payment}。"""
+ self.sudo().env["wecom.apps"].sync_send_message(
+ category='att',
+ user_id=employee.wecom_userid,
+ message=message,
+ )
+ party.write({'party_state': 'done'})
+
+ def _get_default_month(self):
+ current_month = datetime.now().month
+ return str(current_month)
diff --git a/yuthon_salary/wizard/party_send_wizard_views.xml b/yuthon_salary/wizard/party_send_wizard_views.xml
new file mode 100644
index 000000000..07cfe0e30
--- /dev/null
+++ b/yuthon_salary/wizard/party_send_wizard_views.xml
@@ -0,0 +1,22 @@
+
+
+
+ party.send.wizard.form
+ party.send.wizard
+
+
+
+
+
\ No newline at end of file
diff --git a/yuthon_salary/wizard/salary_meal_wizard.py b/yuthon_salary/wizard/salary_meal_wizard.py
new file mode 100644
index 000000000..9532003de
--- /dev/null
+++ b/yuthon_salary/wizard/salary_meal_wizard.py
@@ -0,0 +1,76 @@
+# -*- coding: utf-8 -*-
+from odoo import models, fields, api, _, SUPERUSER_ID
+from odoo.exceptions import ValidationError, UserError
+from pypinyin import pinyin, Style
+import xlrd
+import base64
+import datetime
+from datetime import datetime
+
+
+# -*- coding: utf-8 -*-
+from odoo import models, fields, api, _, SUPERUSER_ID
+from odoo.exceptions import ValidationError, UserError
+from pypinyin import pinyin, Style
+import xlrd
+import base64
+import datetime
+from datetime import datetime
+import calendar
+# -*- coding: utf-8 -*-
+from odoo import models, fields, api, _, SUPERUSER_ID
+from odoo.exceptions import ValidationError, UserError
+from pypinyin import pinyin, Style
+import xlrd
+import base64
+import datetime
+from datetime import datetime, timedelta
+
+class SalaryMealWizard(models.TransientModel):
+ _name = 'salary.meal.wizard'
+ _description = '餐费导入弹窗'
+
+ excel_file = fields.Binary(string="上传Excel表")
+ excel_name = fields.Char(string="文件名")
+
+ def confirm(self):
+ if not self.excel_file:
+ raise ValidationError('请上传文件。')
+ book = xlrd.open_workbook(file_contents=base64.decodebytes(self.excel_file))
+ sh = book.sheet_by_index(0)
+ for rx in range(1, sh.nrows):
+ row = sh.row(rx)
+ self.salary_meal_data(row)
+
+ def salary_meal_data(self, row):
+ select_year = row[0].value
+ select_time = row[1].value
+ employee_id = self.env['hr.employee'].search([('identification_id', '=', row[3].value)], limit=1)
+ card = row[3].value
+ number_breakfasts = row[4].value
+ number_lunches = row[5].value
+ total_payment = row[6].value
+ if employee_id:
+ party_id = self.env['yuthon.meal.expenses'].search([
+ ('employee_id', '=', employee_id.id),
+ ('select_year', '=', select_year),
+ ('select_time', '=', select_time)
+ ])
+ if not party_id:
+ self.env['yuthon.meal.expenses'].create({
+ 'employee_id': employee_id.id,
+ 'select_year': select_year,
+ 'select_time': select_time,
+ 'card': card,
+ 'number_breakfasts': number_breakfasts,
+ 'number_lunches': number_lunches,
+ 'total_payment': total_payment,
+ })
+ else:
+ party_id.write({
+ 'card': card,
+ 'number_breakfasts': number_breakfasts,
+ 'number_lunches': number_lunches,
+ 'total_payment': total_payment,
+ }
+ )
diff --git a/yuthon_salary/wizard/salary_meal_wizard_views.xml b/yuthon_salary/wizard/salary_meal_wizard_views.xml
new file mode 100644
index 000000000..bffc46e8a
--- /dev/null
+++ b/yuthon_salary/wizard/salary_meal_wizard_views.xml
@@ -0,0 +1,37 @@
+
+
+
+ 模板下载
+ self
+ /yuthon_salary/static/others/salary_meal.xlsx
+
+
+ 弹窗
+ salary.meal.wizard
+
+
+
+
+
+
+
+
diff --git a/yuthon_salary/wizard/salary_party_wizard.py b/yuthon_salary/wizard/salary_party_wizard.py
index 38e75939b..801589bd6 100644
--- a/yuthon_salary/wizard/salary_party_wizard.py
+++ b/yuthon_salary/wizard/salary_party_wizard.py
@@ -24,26 +24,32 @@ class SalaryPartyWizard(models.TransientModel):
self.salary_year_ttjt_data(row)
def salary_party_data(self, row):
- employee_id = self.env['hr.employee'].search([('name', '=', row[0].value)], limit=1)
- phone = row[1].value
- fee = row[2].value
- payment = row[3].value
- total_payment = row[4].value
+ select_year = row[0].value
+ select_time = row[1].value
+ employee_id = self.env['hr.employee'].search([('identification_id', '=', row[3].value)], limit=1)
+ card = row[3].value
+ fee = row[4].value
+ payment = row[5].value
+ total_payment = row[6].value
if employee_id:
party_id = self.env['yuthon.salary.party'].search([
('employee_id', '=', employee_id.id),
+ ('select_year', '=', select_year),
+ ('select_time', '=', select_time)
])
if not party_id:
self.env['yuthon.salary.party'].create({
'employee_id': employee_id.id,
- 'phone': phone,
+ 'card': card,
+ 'select_year': select_year,
+ 'select_time': select_time,
'fee': fee,
'payment': payment,
'total_payment': total_payment,
})
else:
party_id.write({
- 'phone': phone,
+ 'card': card,
'fee': fee,
'payment': payment,
'total_payment': total_payment,
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index 77a40aa07..653ed4a1f 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -338,6 +338,11 @@
parent="human_resources_salary_root_board"
action="yuthon_salary.action_view_hr_payslip_month_form2"
sequence="3"/>
+