diff --git a/room/security/ir_rule.xml b/room/security/ir_rule.xml
index c20ade81a..7b2e0524c 100644
--- a/room/security/ir_rule.xml
+++ b/room/security/ir_rule.xml
@@ -11,6 +11,11 @@
[('company_id', 'in', company_ids)]
+
+ 预定会议多公司
+
+ [('company_id', 'in', company_ids)]
+
diff --git a/soong_workflow/wizard/soong_workflow_record_revoke_wizard.py b/soong_workflow/wizard/soong_workflow_record_revoke_wizard.py
index f9b09b9bf..793e4435c 100644
--- a/soong_workflow/wizard/soong_workflow_record_revoke_wizard.py
+++ b/soong_workflow/wizard/soong_workflow_record_revoke_wizard.py
@@ -43,7 +43,11 @@ class SoongWorkflowRecordRevokeWizard(models.TransientModel):
])
meal_line.unlink()
-
record_to_update.write({'log_ids': [(5, 0, 0)]})
record_to_update.state = '申请人'
- self.record_id.approve_state = 'start'
\ No newline at end of file
+ self.record_id.write({
+ 'approve_state': 'start',
+ 'soong_state': 'to_do',
+ 'employee_ids': [(6, 0, [self.record_id.create_uid.employee_ids.id])],
+ 'users_ids': [(6, 0, [self.record_id.create_uid.id])]
+ })
\ No newline at end of file
diff --git a/yuthon_hr_attendance/controllers/applet_attendance.py b/yuthon_hr_attendance/controllers/applet_attendance.py
index 2056e7b68..a21eee297 100644
--- a/yuthon_hr_attendance/controllers/applet_attendance.py
+++ b/yuthon_hr_attendance/controllers/applet_attendance.py
@@ -889,15 +889,15 @@ class AppletAttendance(Controller):
last_day_str = last_day.strftime('%Y-%m-%d')
two_months_ago = datetime.now().date() - relativedelta(months=2)
# 去掉 数据为 0 的数据.
- valid_archives_ids = request.env(user=SUPERUSER_ID)['property.meter.archives'].search([
+ valid_archives = request.env(user=SUPERUSER_ID)['property.meter.archives'].search([
('is_virtual_meter', '!=', True),
'|',
('end_time', '=', False),
('end_time', '<=', two_months_ago)
- ]).ids
+ ])
electric_records = request.env(user=SUPERUSER_ID)['meter.archives.line'].search([
('archives_state', '!=', 'stop'),
- ('archives_id', 'in', valid_archives_ids),
+ ('archives_id', 'in', valid_archives.ids),
('meter_date', '>=', first_day_str),
('meter_date', '<=', last_day_str),
])
@@ -1071,14 +1071,21 @@ class AppletAttendance(Controller):
# ('meter_date', '>=', first_day_str),
# ('meter_date', '<=', last_day_str)]
- # 去掉 state
- domain = [('epitope_values_id.name', '=', floor_name),
- ('meter_date', '>=', first_day_str),
- ('meter_date', '<=', last_day_str)]
-
+ domain = [
+ ('epitope_values_id.name', '=', floor_name),
+ ('meter_date', '>=', first_day_str),
+ ('meter_date', '<=', last_day_str)
+ ]
+ two_months_ago = datetime.now().date() - relativedelta(months=2)
if type == 'electric':
domain.append(('archives_state', '!=', 'stop'))
model = 'meter.archives.line'
+ domain.extend([
+ ('archives_id.is_virtual_meter', '!=', True),
+ '|',
+ ('archives_id.end_time', '=', False),
+ ('archives_id.end_time', '<=', two_months_ago)
+ ])
else:
domain.append(('water_state', '!=', 'stop'))
model = 'meter.water.line'
diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py
index c7d1b7bfe..9fc7fd241 100644
--- a/yuthon_hr_employee/models/yuthon_hr_employee.py
+++ b/yuthon_hr_employee/models/yuthon_hr_employee.py
@@ -286,6 +286,28 @@ class YuthonHrEmployee(models.Model):
else:
record.date_end = None
+ def renew(self):
+ employee_ids = self.env["hr.employee"].browse(
+ self._context.get("active_ids", self._context.get("active_id"))
+ )
+ for record in employee_ids:
+ if len(record) > 1:
+ raise UserError("只能选择一个员工续签")
+ return {
+ "name": "续签",
+ "type": "ir.actions.act_window",
+ "res_model": "yuthon.renewal.approval",
+ "view_mode": "form",
+ "context": {
+ "default_employee_id": self.id,
+ "default_current_status": self.contract_id.date_end,
+ "default_department1_id": self.department_id.id,
+ "default_contract_id": self.contract_id.id,
+ },
+ }
+
+
+
def update_social_base(self):
current_year = fields.Date.today().year
group_company = self.env['res.company'].search([('name', '=', '集团本部')], limit=1)
diff --git a/yuthon_hr_employee_approval/models/yuthon_employee_setting.py b/yuthon_hr_employee_approval/models/yuthon_employee_setting.py
index 591a681c8..889c36df6 100644
--- a/yuthon_hr_employee_approval/models/yuthon_employee_setting.py
+++ b/yuthon_hr_employee_approval/models/yuthon_employee_setting.py
@@ -6,4 +6,4 @@ class YuthonServiceType(models.Model):
_name = 'yuthon.service.type'
_description = '服务类型'
- name = fields.Char(string="名称")
+ name = fields.Char(string="名称")
\ No newline at end of file
diff --git a/yuthon_hr_employee_approval/models/yuthon_service_approval.py b/yuthon_hr_employee_approval/models/yuthon_service_approval.py
index 533213769..98427753e 100644
--- a/yuthon_hr_employee_approval/models/yuthon_service_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_service_approval.py
@@ -11,7 +11,7 @@ class YuthonServiceApproval(models.Model):
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_service_approval_code'))
service_type_id = fields.Many2one('yuthon.service.type', string="服务类型")
- users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.snv.user.id)
+ users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user)
documents_ids = fields.Many2many('ir.attachment', string="附件")
department_id = fields.Many2one(related='users_id.employee_ids.department_id', string="部门", store=True)
employee_id = fields.Many2one('hr.employee', string="员工姓名", default=lambda self: self.env.user.employee_id.id)
diff --git a/yuthon_hr_employee_approval/views/inherit_hr_employee_views.xml b/yuthon_hr_employee_approval/views/inherit_hr_employee_views.xml
index 87cc4bbac..0a79d2fbb 100644
--- a/yuthon_hr_employee_approval/views/inherit_hr_employee_views.xml
+++ b/yuthon_hr_employee_approval/views/inherit_hr_employee_views.xml
@@ -10,6 +10,7 @@
+
diff --git a/yuthon_issue/models/issue_approval_decision.py b/yuthon_issue/models/issue_approval_decision.py
index 40e941104..fe423ce41 100644
--- a/yuthon_issue/models/issue_approval_decision.py
+++ b/yuthon_issue/models/issue_approval_decision.py
@@ -27,6 +27,7 @@ class IssueApprovalDecision(models.Model):
end_date = fields.Date(string="失效日期")
remarks = fields.Text(string='备注')
issue_approval_id = fields.Many2one('issue.approval', string="关联议题审批")
+ version = fields.Char(string="版本", default="V3.0")
def _get_default_company(self):
company = self.env['res.company'].search([('name', '=', '集团本部')], limit=1)
diff --git a/yuthon_issue/views/issue_approval_decision_views.xml b/yuthon_issue/views/issue_approval_decision_views.xml
index 11f01459e..8bc051342 100644
--- a/yuthon_issue/views/issue_approval_decision_views.xml
+++ b/yuthon_issue/views/issue_approval_decision_views.xml
@@ -20,6 +20,7 @@
+
@@ -47,14 +48,14 @@
-
-
-
+
+
+
@@ -62,6 +63,7 @@
+
diff --git a/yuthon_maintain/models/processing_order_approval.py b/yuthon_maintain/models/processing_order_approval.py
index 33de5f59c..67042f1a8 100644
--- a/yuthon_maintain/models/processing_order_approval.py
+++ b/yuthon_maintain/models/processing_order_approval.py
@@ -100,6 +100,28 @@ class ProcessingOrderApproval(models.Model):
else:
record.contract_id = False
+ def open_record(self):
+ if self.device_id:
+ return {
+ 'type': 'ir.actions.act_window',
+ 'name': self.device_id.display_name,
+ 'res_model': 'property.device.repair',
+ 'res_id': self.device_id.id,
+ 'view_mode': 'form',
+ 'view_type': 'form',
+ 'target': 'new'
+ }
+ elif self.repair_id:
+ return {
+ 'type': 'ir.actions.act_window',
+ 'name': self.repair_id.display_name,
+ 'res_model': 'property.report.repair',
+ 'res_id': self.repair_id.id,
+ 'view_mode': 'form',
+ 'view_type': 'form',
+ 'target': 'new'
+ }
+
@api.onchange('repair_id')
def onchange_repair_id(self):
if self.repair_id:
diff --git a/yuthon_maintain/models/property_device_repair.py b/yuthon_maintain/models/property_device_repair.py
index 951e84e2e..44514a058 100644
--- a/yuthon_maintain/models/property_device_repair.py
+++ b/yuthon_maintain/models/property_device_repair.py
@@ -8,7 +8,6 @@ from odoo.exceptions import UserError, ValidationError
class PropertyDeviceRelief(models.Model):
_name = 'property.device.repair'
_description = '报事报修'
- _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
name = fields.Char(string='标题', compute='_compute_name', store=True)
code = fields.Char(string="报修编号",
@@ -18,8 +17,7 @@ class PropertyDeviceRelief(models.Model):
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
software_processing_id = fields.Many2one('software.issues.processing', string="设备类型")
problem_description = fields.Text(string="问题描述")
- remake = fields.Text(string="问题描述")
- report_state = fields.Selection([('to', '待处理'), ('done', '已处理')], string='状态', default='to')
+ report_state = fields.Selection([('to_submitted', '待提交'), ('to', '待处理'), ('done', '已处理')], string='状态', default='to_submitted')
create_time = fields.Date(string="填报日期", default=fields.Datetime.now)
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
@@ -38,14 +36,26 @@ class PropertyDeviceRelief(models.Model):
def _compute_name(self):
for rec in self:
if rec.users_id and rec.software_processing_id:
- rec.name = f" {rec.software_processing_id.name}-{rec.users_id.name}-{rec.remake}"
+ rec.name = f"{rec.users_id.name}-{rec.software_processing_id.name}-{rec.problem_description}"
+ def device_delete(self):
+ self.unlink()
+
+ def open_record(self):
+ return {
+ "type": "ir.actions.act_window",
+ "res_model": 'processing.order.approval',
+ "res_id": self.processing_order_id.id,
+ "name": '详情',
+ "view_mode": "form",
+ }
def get_no_read_count(self):
- return self.search_count([('report_state', '=', 'to')])
+ return self.search_count([('report_state', '=', 'to'), ('users_id', '=', self.env.user.id)])
def pull_order(self):
soong_workflow_line_list = []
+ self.report_state = 'to'
if self.env['processing.order.approval'].search([('device_id', '=', self.id)]):
raise UserError('该设备已生成处理单')
order_id = self.env['processing.order.approval'].create({
diff --git a/yuthon_maintain/models/property_report_repair.py b/yuthon_maintain/models/property_report_repair.py
index f058dafd0..b51dfce9b 100644
--- a/yuthon_maintain/models/property_report_repair.py
+++ b/yuthon_maintain/models/property_report_repair.py
@@ -8,7 +8,6 @@ from odoo.exceptions import UserError
class PropertyRentRelief(models.Model):
_name = 'property.report.repair'
_description = '报事报修(物业)'
- _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
name = fields.Char(string='标题', compute='_compute_name', store=True)
code = fields.Char(string="报修编号",
@@ -29,8 +28,6 @@ class PropertyRentRelief(models.Model):
documents_ids = fields.Many2many('ir.attachment', string="附件")
active = fields.Boolean('Active', default=True, tracking=True)
work_end = fields.Boolean(string="结束")
- self_users_ids = fields.Many2many('res.users', string="当前经办人",
- default=lambda self: [(6, 0, [self.env.user.id])])
create_time = fields.Date(string="填报日期", default=fields.Datetime.now)
processing_order_id = fields.Many2one('processing.order.approval', string="处理单")
def _get_default_name_title(self):
diff --git a/yuthon_maintain/views/processing_order_approval_views.xml b/yuthon_maintain/views/processing_order_approval_views.xml
index 286816ce0..fd90c73fb 100644
--- a/yuthon_maintain/views/processing_order_approval_views.xml
+++ b/yuthon_maintain/views/processing_order_approval_views.xml
@@ -43,7 +43,7 @@
-
+
@@ -53,7 +53,9 @@
-
+
+
+
@@ -70,12 +72,11 @@
-
-
+
diff --git a/yuthon_maintain/views/property_device_repair_views.xml b/yuthon_maintain/views/property_device_repair_views.xml
index 63af193ca..43d3dc357 100644
--- a/yuthon_maintain/views/property_device_repair_views.xml
+++ b/yuthon_maintain/views/property_device_repair_views.xml
@@ -4,13 +4,15 @@
property.device.repair.tree
property.device.repair
-
+
-
+
+
+
@@ -18,7 +20,7 @@
property.device.repair.form
property.device.repair
-
@@ -60,6 +63,12 @@
报事报修
property.device.repair
+ [('users_id', '=', uid)]
+ tree,form
+
+
+ 报事报修(管理员)
+ property.device.repair
tree,form
\ No newline at end of file
diff --git a/yuthon_maintain/views/property_report_repair.xml b/yuthon_maintain/views/property_report_repair.xml
index 1f75d9501..53ea13d0d 100644
--- a/yuthon_maintain/views/property_report_repair.xml
+++ b/yuthon_maintain/views/property_report_repair.xml
@@ -49,7 +49,6 @@
-
diff --git a/yuthon_property_approval/wizard/penalty_line_wizard.py b/yuthon_property_approval/wizard/penalty_line_wizard.py
index 88800d163..fb7f39025 100644
--- a/yuthon_property_approval/wizard/penalty_line_wizard.py
+++ b/yuthon_property_approval/wizard/penalty_line_wizard.py
@@ -129,10 +129,13 @@ class PenaltyLineWizard(models.Model):
# 计算剩余本金
remaining_principal = max(0, pay_line.not_collected - pay_amount)
penalty_start_date = pay_date
-
+ if is_penalty:
+ remake = f'支付违约金¥{pay_line.amount}'
+ else:
+ remake = f'支付金额¥{pay_line.amount}'
new_penalty_lines.append((0, 0, {
'date': pay_date,
- 'remake': f'支付金额¥{pay_line.amount}',
+ 'remake':remake,
'days_overdue': days_overdue,
'remaining_principal': remaining_principal,
'penalty': round(current_penalty, 2),
@@ -196,7 +199,7 @@ class PenaltyLineWizard(models.Model):
'date': self.calculation_date,
'days_overdue': days_overdue,
'remaining_principal': prev_line.remaining_principal,
- 'remake': f'{base_date}至{self.calculation_date}',
+ 'remake': f'违约金:{base_date}至{self.calculation_date}',
'penalty': round(current_penalty, 2),
'is_realtime': True,
}))
diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py
index a25031ea2..1980fe84b 100644
--- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py
+++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py
@@ -586,9 +586,13 @@ class PropertyReconciliationWizard(models.Model):
'is_write': True if line.amount != 0 else False,
'is_penalty': True,
'reconciliation_date': rec.actual_date if line.amount != 0 else None,
- 'receivable_id': receivable_id.id,
+ 'receivable_id': receivable_id[0].id,
'amount': line.amount,
})
+ # 删除多余的违约金数据
+ if len(receivable_id) > 1:
+ receivable_id = existing_record[1:]
+ receivable_id.unlink()
rec.amount_been_reconciled += line.amount
yes_amount += line.amount
@@ -607,7 +611,6 @@ class PropertyReconciliationWizard(models.Model):
if unreconciled_receivables:
remaining_contract_ids.append(contract.id)
-
class PropertyReconciliationLine(models.Model):
_name = 'property.reconciliation.line'
_description = '对账明细'
diff --git a/yuthon_purchase/models/purchase_workflow.py b/yuthon_purchase/models/purchase_workflow.py
index 5ea9e7a37..2a6380fcb 100644
--- a/yuthon_purchase/models/purchase_workflow.py
+++ b/yuthon_purchase/models/purchase_workflow.py
@@ -24,13 +24,14 @@ class PurchaseWorkflow(models.Model):
default='normal', required=True)
pay_way = fields.Selection([('onetime', '一次性'), ('installment', '分期')], string="付款方式", default='onetime',
required=True)
+ pay_amount = fields.Float(string="付款金额")
total = fields.Float(string="合计金额", readonly=True)
document_ids = fields.Many2many('ir.attachment', string="附件")
active = fields.Boolean('启用', default=True, tracking=True)
work_end = fields.Boolean(string="审批结束", default=False, tracking=True)
purchase_order_id = fields.Many2one('purchase.order', string="采购订单", readonly=True)
- purchase_type = fields.Selection([('fixed', '固定资产'), ('low', '低值易耗'), ('service', '服务')],
+ purchase_type = fields.Selection([('fixed', '固定资产'), ('low', '低值易耗'), ('service', '服务'), ('day', '日常消耗品')],
string="采购类型", required=True, default='fixed')
service_content = fields.Text(string="服务内容")
@@ -127,12 +128,12 @@ class PurchaseFixedLine(models.Model):
product_id = fields.Many2one('product.product', string="物品名称")
brand = fields.Char(string="品牌")
specs = fields.Char(string="规格")
- number = fields.Integer(string="数量",)
+ number = fields.Integer(string="数量")
name = fields.Text(string="描述")
product_packaging_id = fields.Many2one('product.packaging', string="包装")
taxes_id = fields.Many2one('account.tax', string='税项')
- unit_id = fields.Many2one(related='product_id.uom_id', string="单位")
- price_unit = fields.Float(related='product_id.standard_price', string="单价", store=True)
+ unit_id = fields.Many2one('uom.uom', string="单位")
+ price_unit = fields.Float(string="单价", store=True)
total = fields.Float(string="合计", compute='_compute_total', store=True)
@api.depends('price_unit', 'number')
@@ -144,20 +145,23 @@ class PurchaseFixedLine(models.Model):
def _onchange_product_id(self):
if self.product_id:
self.name = self.product_id.display_name
+ self.unit_id = self.product_id.uom_id
+ self.price_unit = self.product_id.standard_price
+
class PurchaseLowLine(models.Model):
_name = 'purchase.low.line'
_description = '低值易耗采购明细'
purchase_id = fields.Many2one('purchase.workflow', string="关联采购工作流")
product_id = fields.Many2one('product.product', string="物品名称")
- brand = fields.Char(related="product_id.brand", string="品牌")
- specs = fields.Char(related="product_id.specs", string="规格")
+ brand = fields.Char(string="品牌")
+ specs = fields.Char(string="规格")
name = fields.Text(string="描述")
product_packaging_id = fields.Many2one('product.packaging', string="包装")
taxes_id = fields.Many2one('account.tax', string='税项')
number = fields.Integer(string="数量")
- unit_id = fields.Many2one(related='product_id.uom_id', string="单位")
- price = fields.Float(related='product_id.standard_price', string="单价", store=True)
+ unit_id = fields.Many2one('uom.uom', string="单位")
+ price = fields.Float(string="单价", store=True)
total = fields.Float(string="合计", compute='_compute_total', store=True)
@api.depends('price', 'number')
@@ -169,7 +173,12 @@ class PurchaseLowLine(models.Model):
def _onchange_product_id(self):
if self.product_id:
self.name = self.product_id.display_name
+ self.brand = self.product_id.brand
+ self.specs = self.product_id.specs
+ self.unit_id = self.product_id.uom_id
+ self.price = self.product_id.standard_price
+# 服务采购明细
class PurchaseServiceLine(models.Model):
_name = 'purchase.service.line'
_description = '服务采购明细'
@@ -178,11 +187,11 @@ class PurchaseServiceLine(models.Model):
product_id = fields.Many2one('product.product', string="服务项目")
frequency = fields.Integer(string='频次')
fee = fields.Float(string="费用")
- name = fields.Text(string="描述", default=lambda self: self.product_id.display_name if self.product_id else False )
+ name = fields.Text(string="描述")
product_packaging_id = fields.Many2one('product.packaging', string="包装")
taxes_id = fields.Many2one('account.tax', string='税项')
- unit_id = fields.Many2one(related='product_id.uom_id', string="单位")
- price = fields.Float(related='product_id.standard_price', string="单价", store=True)
+ unit_id = fields.Many2one('uom.uom', string="单位")
+ price = fields.Float(string="单价", store=True)
total = fields.Float(string="合计", compute='_compute_total', store=True)
@api.depends('price', 'frequency')
@@ -194,6 +203,9 @@ class PurchaseServiceLine(models.Model):
def _onchange_product_id(self):
if self.product_id:
self.name = self.product_id.display_name
+ self.unit_id = self.product_id.uom_id
+ self.price = self.product_id.standard_price
+
class PurchaseFixedAssets(models.Model):
_name = 'purchase.fixed.assets'
diff --git a/yuthon_purchase/views/purchase_workflow_views.xml b/yuthon_purchase/views/purchase_workflow_views.xml
index f7b3b9aec..9e415102a 100644
--- a/yuthon_purchase/views/purchase_workflow_views.xml
+++ b/yuthon_purchase/views/purchase_workflow_views.xml
@@ -50,6 +50,7 @@
+
@@ -92,6 +93,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_will_task/models/inherit_room_booking.py b/yuthon_will_task/models/inherit_room_booking.py
index 95c6b86f2..8a8cf84e3 100644
--- a/yuthon_will_task/models/inherit_room_booking.py
+++ b/yuthon_will_task/models/inherit_room_booking.py
@@ -5,6 +5,20 @@ from datetime import datetime, timedelta, date
class InheritRoomBooking(models.Model):
_inherit = 'room.booking'
+ def get_no_read_count(self):
+ today = date.today()+ timedelta(hours=8)
+ today_start = datetime.combine(today, datetime.min.time())
+ today_end = datetime.combine(today, datetime.max.time())
+ current_datetime = datetime.now() + timedelta(hours=8)
+ domain = [
+ ('start_datetime', '>=', today_start),
+ ('start_datetime', '<=', today_end),
+ '|',
+ ('end_datetime', '=', False),
+ ('end_datetime', '>', current_datetime)
+ ]
+ return self.search_count(domain)
+
@api.model
def create(self, vals):
task_time_ids = self.env['yuthon.task.time'].search([('name', '=', '30分钟')])
diff --git a/yuthon_will_task/security/yuthon_will_task_security.xml b/yuthon_will_task/security/yuthon_will_task_security.xml
index d8e1b26a8..0056a273e 100644
--- a/yuthon_will_task/security/yuthon_will_task_security.xml
+++ b/yuthon_will_task/security/yuthon_will_task_security.xml
@@ -13,5 +13,13 @@
+
+ 会议组
+
+
+ 会议管理员
+
+
+
\ No newline at end of file
diff --git a/yuthon_will_task/views/yuthon_task_menu.xml b/yuthon_will_task/views/yuthon_task_menu.xml
index 1b7b5861e..c83c199c5 100644
--- a/yuthon_will_task/views/yuthon_task_menu.xml
+++ b/yuthon_will_task/views/yuthon_task_menu.xml
@@ -23,6 +23,7 @@
name="预定会议"
action="room.room_booking_action"
parent="menu_yuthon_will_task"
+ groups="yuthon_will_task.group_room_booking_manager"
sequence="10"/>