diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index 268fad60d..fdfe58222 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -195,6 +195,7 @@ class YuthonProperty(models.Model):
if rec.manage_information_ids:
precinct_id = self.env['yuthon.precinct.message'].search([('employee_id', '=', rec.admin_id.employee_ids.id)])
rec.manage_information_ids[-1].precinct_id = precinct_id.id
+ rec.manage_information_ids[-1].admin_id = rec.manage_information_ids[-1].precinct_id.employee_id.user_id
def put_declare_approval(self):
property_ids = self.env["yuthon.property"].browse(
@@ -531,6 +532,11 @@ class ManageInformationLine(models.Model):
end_date = fields.Date(string="失效日期")
create_date = fields.Date(string="创建日期", default=fields.Date.today)
+ @api.onchange('precinct_id')
+ def _onchange_precinct_id(self):
+ for record in self:
+ if record.precinct_id:
+ record.admin_id = record.precinct_id.employee_id.user_id
class DisassemblyInformationLine(models.Model):
_name = 'disassembly.information.line'
diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml
index 0544e4623..7db17018d 100644
--- a/yuthon_property/views/yuthon_property_views.xml
+++ b/yuthon_property/views/yuthon_property_views.xml
@@ -129,7 +129,7 @@
-
+
diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py
index 7c0e61a6f..db9077667 100644
--- a/yuthon_property_approval/models/property_lease_contract.py
+++ b/yuthon_property_approval/models/property_lease_contract.py
@@ -1321,9 +1321,6 @@ class PropertyLeaseContract(models.Model):
contract.contact_state = 'complete'
elif today >= actual_end < term_end:
contract.contact_state = 'terminate'
- else:
- if actual_end and term_end and actual_end < term_end:
- contract.contact_state = 'early_termination' # 提前终止
# 续租
@@ -1452,7 +1449,7 @@ class PropertyLeaseContractLine(models.Model):
lease_id = fields.Many2one('property.lease.contract', string="关联凭租合同审批")
address_id = fields.Many2one('yuthon.property', string="物业地址")
- admin_line_id = fields.Many2one(related='address_id.admin_id', string="管理员", default=lambda self: self.env.user.id)
+ admin_line_id = fields.Many2one(related='address_id.admin_id', string="管理员")
property_area = fields.Float(related='address_id.management_area', string="面积")
message_standard_id = fields.Many2one(related='address_id.message_standard_id', string="管理费标准")
evaluate_unit_price = fields.Float(string="评估单价")
diff --git a/yuthon_salary/wizard/salary_compute_wizard.py b/yuthon_salary/wizard/salary_compute_wizard.py
index f62db3d6a..5e34444b8 100644
--- a/yuthon_salary/wizard/salary_compute_wizard.py
+++ b/yuthon_salary/wizard/salary_compute_wizard.py
@@ -35,14 +35,22 @@ class SalaryComputeWizard(models.Model):
month = int(self.select_time)
import calendar
last_day = calendar.monthrange(year, month)[1]
- start_date = datetime(year, month, last_day).strftime('%Y-%m-%d')
+ target_date = datetime(year, month, last_day).strftime('%Y-%m-%d')
if self.company_id:
employees = self.env['hr.employee'].search([
('company_id', '=', self.company_id.id),
('is_salary', '=', True),
- ('entry_date', '<=', start_date),
- ('contract_id.state', 'not in', ['draft', 'cancel', 'close']),
+ ('entry_date', '<=', target_date),
('contract_id', '!=', False),
+ '|',
+ ('contract_id.termination_date', '>=', target_date),
+ '|',
+ '&',
+ ('contract_id.termination_date', '=', False),
+ ('contract_id.date_end', '>=', target_date),
+ '&',
+ ('contract_id.termination_date', '=', False),
+ ('contract_id.date_end', '=', False)
])
self.employee_ids = [(6, 0, employees.ids)]
self.employee_number = len(self.employee_ids)