!5397 添加功能

Merge pull request !5397 from 李鹏宇/zhou
This commit is contained in:
李鹏宇
2025-09-25 09:05:40 +00:00
committed by Gitee
4 changed files with 17 additions and 5 deletions
@@ -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)
@@ -291,6 +291,7 @@
<field name="is_rent" column_invisible="1"/>
<field name="lessee_id" options="{'no_create': True}" readonly="1"/>
<field name="title_deed" readonly="1"/>
<field name="company_id" column_invisible="1"/>
<field name="property_ids" options="{'no_create': True}" widget="many2many_tags" column_invisible="1"/>
<field name="property_name"/>
<field name="contract_id" string="合同编号" options="{'no_create': True}"/>
@@ -308,11 +309,13 @@
<search>
<field name="property_ids"
string="综合搜索"
filter_domain="['|', '|', ('property_ids.name', 'ilike', self), ('lessee_id.name', 'ilike', self), ('contract_id.contract_code', 'ilike', self)]"/>
filter_domain="['|', '|', ('property_ids.name', 'ilike', self), ('lessee_id.name', 'ilike', self), ('contract_id.contract_code', 'ilike', self), ('company_id.name', 'ilike', self)]"/>
<field name="property_ids"/>
<field name="lessee_id"/>
<field name="contract_id"/>
<field name="company_id"/>
<group expand="0" string="group_by">
<filter name="group_company_id" string="公司" context="{'group_by':'company_id'}"/>
<filter name="group_is_reconciliation" string="对账" context="{'group_by':'is_reconciliation'}"/>
<filter name="group_property_ids" string="物业" context="{'group_by':'property_ids'}"/>
<filter name="group_lessee_id" string="承租方" context="{'group_by':'lessee_id'}"/>
+10 -1
View File
@@ -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),
])
@@ -10,7 +10,7 @@
<field name="select_year"/>
<field name="select_time"/>
<field name="company_id" domain="[('id', '=', company_id)]" invisible="1"/>
<field name="employee_ids" widget="many2many_tags" force_save="1" options="{'no_create': True}" domain="[('company_id', '=', company_id)]"/>
<field name="employee_ids" widget="many2many_tags" force_save="1" options="{'no_create': True}" domain="[('company_id', '=', company_id), ('id', 'not in', employee_ids1)]"/>
<field name="employee_number"/>
</group>
<footer>