diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 3ba62a3e3..9d7b0db30 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -372,8 +372,8 @@ class PropertyAccountsReceivable(models.Model): is_rent = fields.Boolean(string='是否租金', default=True, compute = '_compute_is_rent', store=True) management_area = fields.Float(related='contract_id.total_area', string='面积') title_deed = fields.Char(string="产权证号", compute='_compute_title_deed') - lessee_id = fields.Many2one(related='contract_id.lessee_id', string='承租方', stroe=True) - # company_id = fields.Many2one('res.company', string="公司", default=lambda self: self.env.company) + lessee_id = fields.Many2one(related='contract_id.lessee_id', string='承租方', store=True) + company_id = fields.Many2one(related='contract_id.lessor_id', string="公司", store=True) contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批") admin_id = fields.Many2one(related='contract_id.admin_id', string="片区管理员", store=True) tenure_type = fields.Selection(related='contract_id.tenure_type', string="权属类型", store=True) diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml index e419f8add..e4ac55a99 100644 --- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml +++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml @@ -291,6 +291,7 @@ + @@ -308,11 +309,13 @@ + filter_domain="['|', '|', ('property_ids.name', 'ilike', self), ('lessee_id.name', 'ilike', self), ('contract_id.contract_code', 'ilike', self), ('company_id.name', 'ilike', self)]"/> + + diff --git a/yuthon_salary/wizard/salary_compute_wizard.py b/yuthon_salary/wizard/salary_compute_wizard.py index 634b9749d..d3fe444a8 100644 --- a/yuthon_salary/wizard/salary_compute_wizard.py +++ b/yuthon_salary/wizard/salary_compute_wizard.py @@ -57,7 +57,15 @@ class SalaryComputeWizard(models.Model): ('contract_id.termination_date', '=', False), ('contract_id.date_end', '=', False) ]) - self.employee_ids = [(6, 0, employees.ids)] + last_day1 = (datetime(year, month + 1, 1) - timedelta(days=1)).strftime('%Y-%m-%d') + existing_employees = self.env['hr.payslip'].search([ + ('date_from', '>=', first_day), + ('date_to', '<=', last_day1), + ('company_id', '=', self.company_id.id) + ]).mapped('employee_id') + new_employees = employees - existing_employees + self.employee_ids = [(6, 0, new_employees.ids)] + self.employee_number = len(employees) for employee in employees: print(f"员工姓名: {employee.name}") @@ -183,6 +191,7 @@ class SalaryComputeWizard(models.Model): internship_ids = self.env['hr.payslip'].search([ ('is_push', '=', False), ('company_id', '=', self.company_id.id), + ('employee_id.name', '=', '林嘉宜'), ('date_from', '<=', end_date), ('date_to', '>=', start_date), ]) diff --git a/yuthon_salary/wizard/salary_compute_wizard_views.xml b/yuthon_salary/wizard/salary_compute_wizard_views.xml index 80ec82964..3582a493a 100644 --- a/yuthon_salary/wizard/salary_compute_wizard_views.xml +++ b/yuthon_salary/wizard/salary_compute_wizard_views.xml @@ -10,7 +10,7 @@ - +