@@ -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'
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<field name="yuthon_property_id" column_invisible="1"/>
|
||||
<field name="company_id" required="1"/>
|
||||
<field name="tenure_type"/>
|
||||
<field name="admin_id" column_invisible="1"/>
|
||||
<field name="admin_id" optional="hide"/>
|
||||
<field name="precinct_id"/>
|
||||
<field name="purpose_id"/>
|
||||
<field name="management_area"/>
|
||||
|
||||
@@ -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="评估单价")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user