!2366 添加功能

Merge pull request !2366 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-04-08 08:02:17 +00:00
committed by Gitee
20 changed files with 105 additions and 52 deletions
@@ -12,7 +12,7 @@ class PropertyElectricReading(models.Model):
property_id = fields.Many2one('yuthon.property', string='地址')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
state = fields.Char(string='状态')
property_state = fields.Char(string='状态')
employee_ids = fields.Many2many('hr.employee', string='抄表人')
meter_type = fields.Selection([('electric', '电表'), ('water', '水表')], string='仪表类型')
payment_account = fields.Selection([('prepaid', '电费'), ('postpaid', '水费')], string='缴费科目')
@@ -21,7 +21,7 @@ class PropertyEvaluationPlan(models.Model):
default='6')
annual_increase_percentage = fields.Float(string='每年递增(%)', igits=(6, 2))
remake = fields.Text(string='备注')
state = fields.Selection([('to', '待审批'), ('done', '已审批')], string="状态", default='to')
property_state = fields.Selection([('to', '待审批'), ('done', '已审批')], string="状态", default='to')
def put_assessment_approval(self):
property_evaluation_ids = self.env["property.evaluation.plan"].browse(
@@ -29,12 +29,12 @@ class PropertyEvaluationPlan(models.Model):
form_id = self.env.ref('yuthon_property_approval.property_evaluate_application_form').id
property_list = []
for i in property_evaluation_ids:
if i.state == 'done':
if i.property_state == 'done':
raise UserError('该方案不可提交')
property_list.append([0, 0, {
'property_evaluation_id': i.id,
}])
i.write({'state': 'done'})
i.write({'property_state': 'done'})
return {
'name': '提交物业评估',
'view_mode': 'form',
@@ -13,7 +13,7 @@ class PropertyWaterReading(models.Model):
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
contract = fields.Char(string='合同')
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
state = fields.Char(string='状态')
property_state = fields.Char(string='状态')
employee_ids = fields.Many2many('hr.employee', string='抄表人')
maximum_count = fields.Float(string='最大计数', default=999999)
meter_type = fields.Selection([('electric', '电表'), ('water', '水表')], string='仪表类型')
+4 -4
View File
@@ -33,7 +33,7 @@ class YuthonProperty(models.Model):
property_orientation = fields.Selection([('north', '东'), ('south', '南'), ('east', '西'), ('west', '北')],
string="朝向")
street = fields.Char(string="街道")
state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中'),
property_state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中'),
('ing_handover', '移交中'), ('done_handover', '已移交'),
('filing', '备案中'), ('net', '挂网'), ('signing', '签约中'),
('signed', '已备案'), ('leased', '已租'), ('idle', '空置'), ('no_lease','不可租'), ('leasing', '在租'), ('self', '自用')], string='资产目前状态', default='to')
@@ -212,7 +212,7 @@ class YuthonProperty(models.Model):
for record in property_ids:
property_list.append([0, 0, {'property_id': record.id}])
for i in property_ids:
i.write({'state': 'ing_handover'})
i.write({'property_state': 'ing_handover'})
return {
'name': '提交物业移交',
'view_mode': 'form',
@@ -239,7 +239,7 @@ class YuthonProperty(models.Model):
'assessment_category': 'rent_money',
'remake': record.remark,
})
record.write({'state': 'ing'})
record.write({'property_state': 'ing'})
return {
"name": "物业评估方案",
'type': 'ir.actions.act_window',
@@ -266,7 +266,7 @@ class YuthonProperty(models.Model):
'assessment_category': 'rent_money',
'remake': record.remark,
})
record.write({'state': 'ing'})
record.write({'property_state': 'ing'})
return {
"name": "物业评估方案",
'type': 'ir.actions.act_window',
@@ -10,7 +10,7 @@
<field name="property_id"/>
<field name="lessee_id"/>
<field name="users_id" optional="hide" widget="ztree_select"/>
<field name="state" optional="hide"/>
<field name="property_state" optional="hide"/>
<field name="payment_account" optional="hide"/>
<field name="billing_period" optional="hide"/>
<field name="meter_date" optional="hide"/>
@@ -44,7 +44,7 @@
<field name="position"/>
<field name="property_id"/>
<field name="lessee_id"/>
<field name="state"/>
<field name="property_state"/>
<field name="other"/>
<field name="payment_account"/>
<field name="billing_period"/>
@@ -20,7 +20,7 @@
<field name="rent_id"/>
<field name="annual_increase_percentage"/>
<field name="remake"/>
<field name="state"/>
<field name="property_state"/>
<button name="button_source" type="object" string="详情" class="btn btn-primary"/>
</tree>
</field>
@@ -10,7 +10,7 @@
<field name="property_id"/>
<field name="lessee_id"/>
<field name="users_id" optional="hide" widget="ztree_select"/>
<field name="state" optional="hide"/>
<field name="property_state" optional="hide"/>
<field name="payment_account" optional="hide"/>
<field name="billing_period" optional="hide"/>
<field name="meter_date" optional="hide"/>
@@ -44,7 +44,7 @@
<field name="position"/>
<field name="property_id"/>
<field name="lessee_id"/>
<field name="state"/>
<field name="property_state"/>
<field name="other"/>
<field name="payment_account"/>
<field name="billing_period"/>
+16 -16
View File
@@ -16,12 +16,12 @@
<field name="management_area" digits="[16, 4]"/>
<field name="rent_area" digits="[16, 4]"/>
<field name="equity_area" digits="[16, 4]"/>
<field name="state"/>
<field name="property_state"/>
<field name="first_letter" column_invisible="1"/>
<button name="put_assessment_approval" type="object" string="评估推送" class="btn btn-primary" invisible="state == 'ing'"/>
<button name="put_split_approval" type="object" string="拆分" class="btn btn-primary" invisible="state != 'done'"/>
<button name="put_offline_approval" type="object" string="提交线下审批" class="btn btn-primary" invisible="state != 'done'"/>
<button name="put_adjustment_approval" type="object" string="调整出租条件" class="btn btn-primary" invisible="state != 'done'"/>
<button name="put_assessment_approval" type="object" string="评估推送" class="btn btn-primary" invisible="property_state == 'ing'"/>
<button name="put_split_approval" type="object" string="拆分" class="btn btn-primary" invisible="property_state != 'done'"/>
<button name="put_offline_approval" type="object" string="提交线下审批" class="btn btn-primary" invisible="property_state != 'done'"/>
<button name="put_adjustment_approval" type="object" string="调整出租条件" class="btn btn-primary" invisible="property_state != 'done'"/>
</tree>
</field>
</record>
@@ -33,17 +33,17 @@
<form string="资产信息" create="0">
<sheet>
<widget name="web_ribbon" title="已评估" bg_color="text-bg-success"
invisible="state != 'done'"/>
invisible="property_state != 'done'"/>
<widget name="web_ribbon" title="已租" bg_color="text-bg-success"
invisible="state != 'leased'"/>
invisible="property_state != 'leased'"/>
<widget name="web_ribbon" title="空置" bg_color="text-bg-success"
invisible="state != 'idle'"/>
invisible="property_state != 'idle'"/>
<widget name="web_ribbon" title="不可租" bg_color="text-bg-success"
invisible="state != 'no_lease'"/>
invisible="property_state != 'no_lease'"/>
<widget name="web_ribbon" title="在租" bg_color="text-bg-success"
invisible="state != 'leasing'"/>
invisible="property_state != 'leasing'"/>
<widget name="web_ribbon" title="自用" bg_color="text-bg-success"
invisible="state != 'self'"/>
invisible="property_state != 'self'"/>
<field name="code" readonly="1"/>
<div class="container">
<div class="row justify-content-between position-relative w-100 m-0 mb-2">
@@ -91,7 +91,7 @@
<field name="feature_ids" widget="many2many_tags"/>
<field name="is_done_split" invisible="1"/>
<field name="is_done_merge" invisible="1"/>
<field name="state" invisible="1"/>
<field name="property_state" invisible="1"/>
</group>
</group>
<group col="3">
@@ -274,7 +274,7 @@
<field name="name" string="资产名称"/>
<field name="precinct_id" string="片区"/>
<group expand="0">
<filter name="group_statu" string="物业状态" context="{'group_by': 'state'}"/>
<filter name="group_statu" string="物业状态" context="{'group_by': 'property_state'}"/>
<filter name="purpose_id" string="管理类型" context="{'group_by': 'purpose_id'}"/>
<filter name="admin_id" string="管理员" context="{'group_by': 'admin_id'}"/>
<filter name="referred_id" string="地段" context="{'group_by': 'referred_id'}"/>
@@ -287,9 +287,9 @@
</searchpanel>
<header_search>
<quick_filter string="评估状态">
<filter string="待评估" name="state_to" domain="[('state', '=', 'to')]"/>
<filter string="评估中" name="state_ing" domain="[('state', '=', 'ing')]"/>
<filter string="已评估" name="state_done" domain="[('state', '=', 'done')]"/>
<filter string="待评估" name="property_state_to" domain="[('property_state', '=', 'to')]"/>
<filter string="评估中" name="property_state_ing" domain="[('property_state', '=', 'ing')]"/>
<filter string="已评估" name="property_state_done" domain="[('property_state', '=', 'done')]"/>
</quick_filter>
</header_search>
</search>
@@ -7,7 +7,7 @@
<form>
<sheet>
<group>
<field name="property_ids" widget="many2many_tags" domain="[('state', '=', 'to')]"/>
<field name="property_ids" widget="many2many_tags" domain="[('property_state', '=', 'to')]"/>
</group>
</sheet>
<footer>
@@ -78,7 +78,7 @@ class YuthonPropertyWizard(models.Model):
'name': row[18].value,
})
state_dict = {'已租':'leased', '自用':'self', '在租':'leasing', '空置':'idle', '不可租':'no_lease', '':''}
state = state_dict.get(row[19].value, '')
property_state = state_dict.get(row[19].value, '')
title_certificate = row[12].value
property_message_id = self.env['yuthon.property.message'].search([('name', '=', row[1].value)], limit=1)
if not property_message_id:
@@ -93,7 +93,7 @@ class YuthonPropertyWizard(models.Model):
'referred_id': referred_id.id,
'company_id': company_id.id,
'tenure_type': tenure_type,
'state': state,
'property_state': property_state,
'title_deed':title_certificate,
'precinct_id':precinct_id.id,
'asset_type_id':asset_type_id.id,
@@ -12,7 +12,7 @@ class YuthonProperty(models.Model):
def get_yuthon_property_time(self):
unique_property_ids = set()
for record in self.search([('state', '=', 'to'), ('property_contract_ids', '=', False)]):
for record in self.search([('property_state', '=', 'to'), ('property_contract_ids', '=', False)]):
contracts = self.env['property.evaluation.plan'].search([])
for contract in contracts:
for property_id in contract.property_ids:
@@ -59,5 +59,5 @@ class PropertyHandoverLine(models.Model):
area = fields.Float(related='property_id.rent_area',string="面积")
owner_id = fields.Many2one('yuthon.owner.message', string="权属人")
purposes = fields.Many2one(related='property_id.asset_type_id',string="用途")
state = fields.Selection(related='property_id.state', string="现状",)
property_state = fields.Selection(related='property_id.property_state', string="现状",)
documents_ids = fields.Many2many('ir.attachment', string="附件")
@@ -132,7 +132,7 @@ class PropertyLeaseContract(models.Model):
lease_bank_ids = fields.One2many('property.bank.line', 'contract_id', string="承租方账户明细行")
bank_statements_ids = fields.One2many('property.bank.statements', 'contract_id', string="银行流水明细行")
management_list_ids = fields.One2many('property.management.list', 'contract_id', string="管理费用明细行")
state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中')], string="状态", default=None)
property_state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中')], string="状态", default=None)
# 附件
license_id = fields.Many2one('ir.attachment', string="营业执照")
card_id = fields.Many2one('ir.attachment', string="经办人身份证")
@@ -1100,7 +1100,7 @@ class PropertyLeaseContract(models.Model):
should_process = any(lease_id not in unique_property_ids for lease_id in lease_id_list)
if should_process:
record.put_evaluation_plan()
record.write({'state': 'to'})
record.write({'property_state': 'to'})
# 续租
def button_lease_extension(self):
form_id = self.env.ref('yuthon_property_approval.view_property_lease_extension_form').id
@@ -1173,7 +1173,7 @@ class PropertyLeaseContract(models.Model):
'remake': first_address_id.remark if first_address_id else None,
'assessment_category': 'rent_money',
})
record.write({'state': 'ing'})
record.write({'property_state': 'ing'})
return {
"name": "物业评估方案",
'type': 'ir.actions.act_window',
@@ -1186,7 +1186,7 @@ class PropertyLeaseContract(models.Model):
for record in contract_ids:
property_ids = []
property_id = record.lease_ids[0].address_id
if record.state == 'done':
if record.property_state == 'done':
raise UserError(f'{record.name}该物业已评估,请勿重复评估')
rent_area = 0
for lease_id in record.lease_ids:
@@ -1205,7 +1205,7 @@ class PropertyLeaseContract(models.Model):
'remake': property_id.remark,
'assessment_category': 'rent_money',
})
record.write({'state': 'ing'})
record.write({'property_state': 'ing'})
return {
"name": "物业评估方案",
'type': 'ir.actions.act_window',
@@ -72,7 +72,7 @@ class EvaluatedApplicationLine(models.Model):
evaluation_rent_total = fields.Float(string='评估总价(元•月,散租)')
evaluation_whole_rent_price = fields.Float(string='评估整租单价(元/m² •月)')
evaluation_whole_rent_total = fields.Float(string='评估总价(元•月,整租)')
state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中'),
property_state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中'),
('ing_handover', '移交中'), ('done_handover', '已移交'),
('filing', '备案中'), ('net', '挂网'), ('signing', '签约中'),
('signed', '已备案'), ('leased', '已出租'), ('idle', '闲置')], string='状态',
@@ -72,7 +72,7 @@
<field name="title_number"/>
<field name="area"/>
<field name="purposes"/>
<field name="state"/>
<field name="property_state"/>
<field name="documents_ids" widget="preview_many2many"/>
</tree>
</field>
@@ -355,8 +355,8 @@
<field name="deposit_status" column_invisible="1"/>
<field name="company_id" string="所属公司"/>
<field name="admin_id" string="负责人"/>
<field name="state"/>
<button name="put_evaluation_plan" type="object" class="btn-primary" string="评估推送" invisible="state == 'ing'"/>
<field name="property_state"/>
<button name="put_evaluation_plan" type="object" class="btn-primary" string="评估推送" invisible="property_state == 'ing'"/>
<button name="button_lease_extension" type="object" class="btn-primary" string="续租"/>
<button name="button_lease_return" type="object" class="btn-primary" string="退租"/>
<button name="button_lease_change" type="object" class="btn-primary" string="变更"/>
@@ -418,7 +418,7 @@
<field name="department_id" invisible="1"/>
<field name="name"/>
<field name="use_address"/>
<field name="state" invisible="1"/>
<field name="property_state" invisible="1"/>
<field name="deposit_status" invisible="1"/>
<field name="address_for_delivery"/>
<field name="condition" invisible="1" readonly="1"/>
+25 -2
View File
@@ -62,7 +62,8 @@ class InheritHrPayslip(models.Model):
reimburse_performance_bonus = fields.Float(string='上个月多扣绩效补回')
is_push = fields.Boolean(string='推送')
is_salary_push = fields.Boolean(string='工资推送')
is_salary_release = fields.Boolean(string='薪资发放')
salary_state = fields.Selection([('to_signed', '待签字' ), ('to_release', '待发放'), ('released', '已发放')], string='状态', default='to_signed')
commercial_health_insurance = fields.Float(string='商业健康保险')
tax_deferred_pension_insurance = fields.Float(string='税延养老保险')
others = fields.Float(string='其他')
@@ -255,7 +256,7 @@ class InheritHrPayslip(models.Model):
def return_salary_button(self):
for record in self:
record.write({'is_salary_push': False})
record.write({'is_salary_release': False})
def action_put_wizard(self):
return {
@@ -308,3 +309,25 @@ class InheritHrPayslip(models.Model):
})
self.env['hr.payslip.line'].create(payslips._get_payslip_lines())
return True
def put_release(self):
for record in self:
record.write({
'is_salary_release': True
})
def all_put_release(self):
payslip_ids = self.env["hr.payslip"].browse(self._context.get('active_ids', self._context.get('active_id')))
for record in payslip_ids:
record.write({
'is_salary_release': True,
'salary_state': 'to_release',
})
def all_return_release(self):
payslip_ids = self.env["hr.payslip"].browse(self._context.get('active_ids', self._context.get('active_id')))
for record in payslip_ids:
record.write({
'is_salary_release': False,
'salary_state': 'to_signed',
})
@@ -27,6 +27,9 @@
<xpath expr="//field[@name='company_id']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<xpath expr="//field[@name='state']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='net_wage']" position="after">
<field name="struct_id" string="职级"/>
<field name="bank_account"/>
@@ -65,11 +68,14 @@
<field name="continuing_education"/>
<field name="infant_care"/>
<field name="meal_misunderstanding_fee"/>
<field name="salary_state"/>
<field name="is_salary_release" column_invisible="1"/>
<field name="is_salary_push" column_invisible="1"/>
</xpath>
<xpath expr="//field[@name='state']" position="after">
<button name="put_payslip" type="object" string="发送" class="btn-primary"/>
<button name="return_salary_button" string="退回" type="object" class="oe_highlight"/>
<button name="put_release" type="object" string="推送" class="btn-primary" invisible="is_salary_release"/>
<button name="put_payslip" type="object" string="发送" class="btn-primary" invisible="not is_salary_release"/>
<button name="return_salary_button" string="退回" type="object" class="oe_highlight" invisible="not is_salary_release"/>
</xpath>
</field>
</record>
@@ -277,7 +283,17 @@
<field name="name">薪资审定</field>
<field name="res_model">hr.payslip</field>
<field name="view_mode">tree,form,search</field>
<field name="domain">[('is_salary_push', '=', True)]</field>
<field name="domain">[('is_salary_push', '=', True), ('is_salary_release', '=', False)]</field>
<field name="context">{'search_default_group_by_employee': 1}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('hr_payroll.view_hr_payslip_tree')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('hr_payroll.view_hr_payslip_form')})]"/>
</record>
<record id="action_view_hr_payslip_salary_release" model="ir.actions.act_window">
<field name="name">薪资发放</field>
<field name="res_model">hr.payslip</field>
<field name="view_mode">tree,form,search</field>
<field name="domain">[('is_salary_push', '=', True), ('is_salary_release', '=', True)]</field>
<field name="context">{'search_default_group_by_employee': 1}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('hr_payroll.view_hr_payslip_tree')}),
@@ -341,6 +357,20 @@
<field name="state">code</field>
<field name="code">action = model.action_return_salary_wizard()</field>
</record>
<record id="all_data_put_release" model="ir.actions.server">
<field name="name">批量推送薪资发放</field>
<field name="model_id" ref="hr_payroll.model_hr_payslip"/>
<field name="binding_model_id" ref="hr_payroll.model_hr_payslip"/>
<field name="state">code</field>
<field name="code">action = model.all_put_release()</field>
</record>
<record id="all_data_return_release" model="ir.actions.server">
<field name="name">批量退回薪资审定</field>
<field name="model_id" ref="hr_payroll.model_hr_payslip"/>
<field name="binding_model_id" ref="hr_payroll.model_hr_payslip"/>
<field name="state">code</field>
<field name="code">action = model.all_return_release()</field>
</record>
<record id="all_data_write_payslip" model="ir.actions.server">
<field name="name">导入累计专项</field>
<field name="model_id" ref="hr_payroll.model_hr_payslip"/>
+1 -1
View File
@@ -31,7 +31,7 @@ class PutSalaryWizard(models.TransientModel):
_name = 'put.salary.wizard'
_description = '推送确认弹窗'
name = fields.Char(string='你确定要退回吗?', readonly=1)
name = fields.Char(string='你确定要推送吗?', readonly=1)
def put_confirm(self):
payslip_records = self.env["hr.payslip"].browse(
+1 -1
View File
@@ -454,7 +454,7 @@
<menuitem id="human_pay_slips_root_board"
name="薪资发放"
parent="finance_manage_employee_root_board"
action="hr_payroll.action_view_hr_payslip_month_form"
action="yuthon_salary.action_view_hr_payslip_salary_release"
sequence="30"/>
<menuitem id="yuthon_financial_management_menu"
name="物业财务管理"