Merge pull request !1350 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-01-15 08:24:14 +00:00
committed by Gitee
30 changed files with 475 additions and 171 deletions
+3 -1
View File
@@ -46,7 +46,9 @@
'views/property_check_decorate_views.xml',
'views/property_other_list_views.xml',
'views/property_bank_statements_views.xml',
'views/property_meter_reading_views.xml',
'views/property_water_reading_views.xml',
'views/property_electric_reading_views.xml',
'views/property_deposit_list_views.xml',
'wizard/yuthon_property_wizard_views.xml',
'wizard/property_meter_wizard_views.xml',
'wizard/property_tenant_wizard_views.xml',
+4 -2
View File
@@ -30,9 +30,11 @@ from . import property_check_lobby
from . import property_check_project
from . import property_check_room
from . import property_check_stairs
from . import property_meter_reading
from . import property_electric_reading
from . import property_message_fee
from . import yuthon_property_setting
from . import yuthon_precinct_message
from . import yuthon_property_message
from . import property_bank_statements
from . import property_bank_statements
from . import property_water_reading
from . import property_deposit_list
@@ -21,3 +21,7 @@ class PropertyType(models.Model):
class PropertyProspectiveCustomers(models.Model):
_name = 'property.prospective.customers'
class PropertyMeterReading(models.Model):
_name = 'property.meter.reading'
@@ -0,0 +1,9 @@
from odoo import models, fields, api
class PropertyDepositList(models.Model):
_name = 'property.deposit.list'
_description = '押金列表'
property_id = fields.Many2one('yuthon.property', string='物业')
lessee_id = fields.Many2one(related='property_id.lessee_id', string='承租方')
@@ -0,0 +1,53 @@
from odoo import models, fields, api
class PropertyElectricReading(models.Model):
_name = 'property.electric.reading'
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
_description = '抄表'
code = fields.Char(string='编号')
position = fields.Char(string='单元编号')
property_id = fields.Many2one('yuthon.property', string='地址')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
contract = fields.Char(string='合同')
lessee_id = fields.Many2one(related='property_id.lessee_id', string="承租方")
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='缴费科目')
other = fields.Char(string='其他')
billing_period = fields.Date(string='账期')
meter_date= fields.Date(string='抄表年月')
last_meter = fields.Date(string='上次')
current_meter = fields.Float(string='本次', tracking=True)
apply_standards = fields.Char(string='应用标准')
price_unit = fields.Float(string='单价')
ratio = fields.Float(string='倍率')
amount_wastage = fields.Float(string='损耗量')
dosage = fields.Float(string='用量')
is_push = fields.Boolean(string='已推送')
generate_charges = fields.Float(string='生成费用')
type = fields.Selection([('public', '公共'), ('fees', '收费')], string='收费类型')
reading_type = fields.Selection([('done', '已抄'), ('undone', '待抄')], string='类型')
def reading_publish(self):
menu_id = self.env['ir.ui.menu'].search([('name', '=', '电表抄表')])
str = 'https://oa.thtzjt.com/web#id={}&cids=1&menu_id={}&action={}&model=property.electric.reading&view_type=form'.format(self.id, menu_id.id, menu_id.action.id)
reading_ids = self.env["property.electric.reading"].browse(self._context.get('active_ids', self._context.get('active_id')))
for record in reading_ids:
for employee_id in record.employee_ids:
we_id = self.env['hr.employee'].search([('id', '=', employee_id)]).wecom_userid
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='notice', user_id=we_id,
title="通知公告",
description="您有抄表待处理,请及时处理",
url=str, btntxt="详细信息")
def button_details(self):
return {
'name': '抄表详情',
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_model': 'property.electric.reading',
'res_id': self.id,
}
@@ -1,7 +1,7 @@
from email.policy import default
from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError
class PropertyMeterArchives(models.Model):
_name = 'property.meter.archives'
@@ -18,7 +18,6 @@ class PropertyMeterArchives(models.Model):
maker = fields.Char(string='制造商')
meter_gateways = fields.Char(string='仪表网关') #选择字段 后续优化
is_state = fields.Boolean(string='是否启用')
gauge_type = fields.Char(string='仪表类型', default='电表')
type = fields.Selection([('public', '公共'), ('fees', '收费')], string='类型')
gauge_magnification = fields.Float(string='仪表倍率')
maximum_count = fields.Float(string='最大计数', default=99999)
@@ -29,6 +28,7 @@ class PropertyMeterArchives(models.Model):
meter_reading_type = fields.Selection([('readout','最后读数'),('accumulation','本次用量')], string='抄表类型')
gauge_labels = fields.Text(string='仪表标签')
meter_remarks = fields.Text(string='仪表备注')
is_push = fields.Boolean(string='是否推送')
pre_existing_balances = fields.Float(string='预存结余')
start_time = fields.Date(string="开始时间")
end_time = fields.Date(string="结束时间")
@@ -61,4 +61,37 @@ class PropertyMeterArchives(models.Model):
"res_model": "property.meter.wizard",
"view_mode": "form",
"target": "new",
}
}
def button_reading_push(self):
for rec in self:
rec.write({
'is_push': True,
})
if rec.is_push:
raise UserError("该仪表已经推送,不能重复推送")
self.env["property.electric.reading"].create({
'code': rec.name,
'property_id': rec.yuthon_property_id.id if rec.yuthon_property_id else None,
'ratio': rec.gauge_magnification,
'position': rec.unit_number,
'type': rec.type,
'is_push': True,
})
def batch_reading_push(self):
archives_ids = self.env["property.meter.archives"].browse(self._context.get('active_ids', self._context.get('active_id')))
for record in archives_ids:
record.write({
'is_push': True,
})
if record.is_push:
raise UserError(f"该{record.name}仪表已经推送,不能重复推送")
self.env["property.electric.reading"].create({
'code': record.name,
'property_id': record.yuthon_property_id.id if record.yuthon_property_id else None,
'ratio': record.gauge_magnification,
'position': record.unit_number,
'type': record.type,
'is_push': True,
})
+36 -2
View File
@@ -1,4 +1,5 @@
from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError
class PropertyMeterWater(models.Model):
@@ -16,7 +17,6 @@ class PropertyMeterWater(models.Model):
maker = fields.Char(string='制造商')
meter_gateways = fields.Char(string='仪表网关') #选择字段 后续优化
is_state = fields.Boolean(string='是否启用')
gauge_type = fields.Char(string='仪表类型', default='水表')
other = fields.Char(string='其他')
type = fields.Selection([('public', '公共'), ('fees', '收费')], string='类型')
gauge_magnification = fields.Float(string='仪表倍率')
@@ -28,6 +28,7 @@ class PropertyMeterWater(models.Model):
meter_reading_type = fields.Selection([('readout','最后读数'),('accumulation','本次用量')], string='抄表类型')
gauge_labels = fields.Text(string='仪表标签')
meter_remarks = fields.Text(string='仪表备注')
is_push = fields.Boolean(string='是否推送')
pre_existing_balances = fields.Float(string='预存结余')
start_time = fields.Date(string="开始时间")
end_time = fields.Date(string="结束时间")
@@ -59,4 +60,37 @@ class PropertyMeterWater(models.Model):
"res_model": "property.water.wizard",
"view_mode": "form",
"target": "new",
}
}
def button_reading_water_push(self):
for rec in self:
rec.write({
'is_push': True,
})
if rec.is_push:
raise UserError(f"该仪表已经推送,不能重复推送")
self.env["property.water.reading"].create({
'code': rec.name ,
'property_id': rec.yuthon_property_id.id if rec.yuthon_property_id else None,
'ratio': rec.gauge_magnification,
'position': rec.unit_number ,
'type': rec.type,
'is_push': True,
})
def batch_reading_water_push(self):
water_ids = self.env["property.meter.water"].browse(self._context.get('active_ids', self._context.get('active_id')))
for record in water_ids:
record.write({
'is_push': True,
})
if record.is_push:
raise UserError(f"该{record.unit_number}仪表已经推送,不能重复推送")
self.env["property.water.reading"].create({
'code': record.name,
'property_id': record.yuthon_property_id.id if record.yuthon_property_id else None,
'ratio': record.gauge_magnification,
'position': record.unit_number,
'type': record.type,
'is_push': True,
})
+3 -2
View File
@@ -35,7 +35,7 @@ class PropertyRentList(models.Model):
is_billing = fields.Boolean(string='开票')
is_reconciliation = fields.Boolean(string='对账')
is_push = fields.Boolean(string='已推送')
management_type_id = fields.Many2one('yuthon.management.type', string='管理费类型')
management_type_id = fields.Many2one('yuthon.management.type', string='应收类型')
last_update_time = fields.Datetime(string='最后修改时间')
def write(self, vals):
@@ -52,4 +52,5 @@ class PropertyRentList(models.Model):
rent_ids = self.env["property.rent.list"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for record in rent_ids:
record.is_push = True
record.is_push = True
@@ -26,6 +26,7 @@ class PropertyTenantInformation(models.Model):
business_license_id = fields.Many2one('ir.attachment', string='营业执照')
power_attorney_id = fields.Many2one('ir.attachment', string='委托代理书')
attorne_card_id = fields.Many2one('ir.attachment', string='委托代理人身份证')
bank_ids = fields.One2many('property.bank.line', 'tenant_id', string='银行信息')
def update_tenant_wizard(self):
return {
@@ -36,6 +37,11 @@ class PropertyTenantInformation(models.Model):
"target": "new",
}
class PropertyBankLine(models.Model):
_name = 'property.bank.line'
_description = '银行账户明细'
tenant_id = fields.Many2one('property.tenant.information', string='关联承租方信息')
name = fields.Char(string="账户")
user = fields.Char(string="用户")
bank = fields.Char(string="开户行")
@@ -1,10 +1,10 @@
from odoo import models, fields, api
class PropertyMeterReading(models.Model):
_name = 'property.meter.reading'
class PropertyWaterReading(models.Model):
_name = 'property.water.reading'
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
_description = '抄表'
_description = '水表抄表'
code = fields.Char(string='编号')
position = fields.Char(string='单元编号')
@@ -32,9 +32,9 @@ class PropertyMeterReading(models.Model):
reading_type = fields.Selection([('done', '已抄'), ('undone', '待抄')], string='类型')
def reading_publish(self):
menu_id = self.env['ir.ui.menu'].search([('name', '=', '电表抄表')])
str = 'https://oa.thtzjt.com/web#id={}&cids=1&menu_id={}&action={}&model=property.meter.reading&view_type=form'.format(self.id, menu_id.id, menu_id.action.id)
reading_ids = self.env["property.meter.reading"].browse(self._context.get('active_ids', self._context.get('active_id')))
menu_id = self.env['ir.ui.menu'].search([('name', '=', '水表抄表')])
str = 'https://oa.thtzjt.com/web#id={}&cids=1&menu_id={}&action={}&model=property.water.reading&view_type=form'.format(self.id, menu_id.id, menu_id.action.id)
reading_ids = self.env["property.water.reading"].browse(self._context.get('active_ids', self._context.get('active_id')))
for record in reading_ids:
for employee_id in record.employee_ids:
we_id = self.env['hr.employee'].search([('id', '=', employee_id)]).wecom_userid
@@ -48,14 +48,6 @@ class PropertyMeterReading(models.Model):
'name': '抄表详情',
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_model': 'property.meter.reading',
'res_model': 'property.water.reading',
'res_id': self.id,
}
def button_reading_push(self):
self.is_push = True
def batch_reading_push(self):
reading_ids = self.env["property.meter.reading"].browse(self._context.get('active_ids', self._context.get('active_id')))
for record in reading_ids:
record.is_push = True
+6 -6
View File
@@ -41,8 +41,6 @@ class YuthonProperty(models.Model):
is_electricity_meter = fields.Boolean(string="电表")
is_confirm_authorization = fields.Boolean(string="确权")
property_card = fields.Html(string="产权证")
life_timer = fields.Datetime(string="使用时间")
property_use_time = fields.Selection([('a', '70年'), ('b', '40年'), ('c', '50年'), ('e', '30年'), ('f', '60年')], string="产权年限")
asset_type_id = fields.Many2one('yuthon.resource.type', string="出租类型")
is_hvac = fields.Boolean(string="使用中央空调")
is_handle_land = fields.Boolean(string="办理土地有偿使用手续")
@@ -54,8 +52,6 @@ class YuthonProperty(models.Model):
rental_unit_price = fields.Float(string="评估单价")
title_number = fields.Char(string="产权编号")
suite_area = fields.Float(string="套内面积", digits=(16, 4))
start_time = fields.Date(string="生效时间")
end_date = fields.Date(string="失效日期")
purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型")
admin_id = fields.Many2one('res.users', string="片区管理员")
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
@@ -289,7 +285,9 @@ class YuthonProperty(models.Model):
self._context.get('active_ids', self._context.get('active_id')))
for record in property_ids:
company_id = record.manage_information_ids[0].company_id.id if record.manage_information_ids else ''
title_deed = record.title_information_ids[0].title_certificate if record.title_information_ids else ''
record.company_id = company_id
record.title_deed = title_deed
class YuthonPropertyWater(models.Model):
_name = 'yuthon.property.water'
@@ -326,6 +324,8 @@ class TitleInformationLine(models.Model):
owner_id = fields.Many2one(related='property_message_id.owner_id', string="权属人")
equity_area = fields.Float(related='property_message_id.equity_area', string="产权面积", digits=(16, 4))
registered_id = fields.Many2one(related='property_message_id.registered_id', string='证载用途')
property_use_time = fields.Selection(related='property_message_id.property_use_time', string="产权年限")
life_timer = fields.Datetime(related='property_message_id.life_timer', string="使用时间")
title_certificate = fields.Char(related='property_message_id.title_certificate', string="产权证号")
start_time = fields.Date(string="生效日期", default=fields.Date.today)
@@ -355,8 +355,8 @@ class DisassemblyInformationLine(models.Model):
yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息")
property_id = fields.Many2one('yuthon.property', string="物业名称")
rent_area = fields.Float(related='property_id.rent_area', string="可租面积")
start_time = fields.Date(related='property_id.start_time',string="生效日期")
end_date = fields.Date(related='property_id.end_date',string="失效日期")
start_time = fields.Date(string="生效日期")
end_date = fields.Date(string="失效日期")
@@ -12,5 +12,7 @@ class YuthonPropertyMessage(models.Model):
pooled_area = fields.Float(string="公摊面积", digits=(16, 4))
ctual_area = fields.Float(string="实际面积", digits=(16, 4))
equity_area = fields.Float(string="产权面积", digits=(16, 4))
property_use_time = fields.Selection([('a', '70年'), ('b', '40年'), ('c', '50年'), ('e', '30年'), ('f', '60年')], string="产权年限")
life_timer = fields.Datetime(string="使用时间")
registered_id = fields.Many2one('yuthon.purpose.evidence', string='证载用途')
documents_ids = fields.Many2many('ir.attachment', string="附件")
+5 -2
View File
@@ -40,7 +40,6 @@ access_property_check_lobby,property_check_lobby,model_property_check_lobby,base
access_property_check_project,property_check_project,model_property_check_project,base.group_user,1,1,1,1
access_property_check_room,property_check_room,model_property_check_room,base.group_user,1,1,1,1
access_property_check_stairs,property_check_stairs,model_property_check_stairs,base.group_user,1,1,1,1
access_property_meter_reading,property_meter_reading,model_property_meter_reading,base.group_user,1,1,1,1
access_property_message_fee,property_message_fee,model_property_message_fee,base.group_user,1,1,1,1
access_yuthon_penalty_setting,yuthon_penalty_setting,model_yuthon_penalty_setting,base.group_user,1,1,1,1
access_yuthon_tariff_setting,yuthon_tariff_setting,model_yuthon_tariff_setting,base.group_user,1,1,1,1
@@ -62,4 +61,8 @@ access_yuthon_purpose_evidence,yuthon_purpose_evidence,model_yuthon_purpose_evid
access_yuthon_management_type,yuthon_management_type,model_yuthon_management_type,base.group_user,1,1,1,1
access_yuthon_bank_setting,yuthon_bank_setting,model_yuthon_bank_setting,base.group_user,1,1,1,1
access_property_bank_statements,property_bank_statements,model_property_bank_statements,base.group_user,1,1,1,1
access_property_statements_wizard,property_statements_wizard,model_property_statements_wizard,base.group_user,1,1,1,1
access_property_statements_wizard,property_statements_wizard,model_property_statements_wizard,base.group_user,1,1,1,1
access_property_bank_line,property_bank_line,model_property_bank_line,base.group_user,1,1,1,1
access_property_electric_reading,property_electric_reading,model_property_electric_reading,base.group_user,1,1,1,1
access_property_water_reading,property_water_reading,model_property_water_reading,base.group_user,1,1,1,1
access_property_deposit_list,property_deposit_list,model_property_deposit_list,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
40 access_property_check_project property_check_project model_property_check_project base.group_user 1 1 1 1
41 access_property_check_room property_check_room model_property_check_room base.group_user 1 1 1 1
42 access_property_check_stairs property_check_stairs model_property_check_stairs base.group_user 1 1 1 1
access_property_meter_reading property_meter_reading model_property_meter_reading base.group_user 1 1 1 1
43 access_property_message_fee property_message_fee model_property_message_fee base.group_user 1 1 1 1
44 access_yuthon_penalty_setting yuthon_penalty_setting model_yuthon_penalty_setting base.group_user 1 1 1 1
45 access_yuthon_tariff_setting yuthon_tariff_setting model_yuthon_tariff_setting base.group_user 1 1 1 1
61 access_yuthon_management_type yuthon_management_type model_yuthon_management_type base.group_user 1 1 1 1
62 access_yuthon_bank_setting yuthon_bank_setting model_yuthon_bank_setting base.group_user 1 1 1 1
63 access_property_bank_statements property_bank_statements model_property_bank_statements base.group_user 1 1 1 1
64 access_property_statements_wizard property_statements_wizard model_property_statements_wizard base.group_user 1 1 1 1
65 access_property_bank_line property_bank_line model_property_bank_line base.group_user 1 1 1 1
66 access_property_electric_reading property_electric_reading model_property_electric_reading base.group_user 1 1 1 1
67 access_property_water_reading property_water_reading model_property_water_reading base.group_user 1 1 1 1
68 access_property_deposit_list property_deposit_list model_property_deposit_list base.group_user 1 1 1 1
+4 -18
View File
@@ -124,29 +124,15 @@
name="水表抄表任务"
parent="yuthon_property_meter_menu"
action="view_property_meter_water_task_action"/>
<menuitem id="yuthon_property_meter_ele_readout_menu"
sequence="10"
name="电表抄表"
parent="yuthon_property_meter_menu"
action="view_property_meter_archives_reading_action"/>
<menuitem id="yuthon_property_meter_water_readout_menu"
sequence="15"
name="水表抄表"
parent="yuthon_property_meter_menu"
action="view_property_meter_water_reading_action"/>
<menuitem id="yuthon_property_meter_archives_menu"
sequence="20"
name="档案"
parent="yuthon_property_meter_menu"/>
<menuitem id="yuthon_property_archives_power_menu"
sequence="1"
sequence="10"
name="电表库"
parent="yuthon_property_meter_archives_menu"
parent="yuthon_property_meter_menu"
action="action_property_meter_archives"/>
<menuitem id="yuthon_property_archives_water_menu"
sequence="3"
sequence="15"
name="水表库"
parent="yuthon_property_meter_archives_menu"
parent="yuthon_property_meter_menu"
action="action_property_meter_water"/>
<menuitem id="yuthon_property_archives_setting_meu"
sequence="99"
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_property_deposit_list_tree" model="ir.ui.view">
<field name="name">property.deposit.tree</field>
<field name="model">property.deposit.list</field>
<field name="arch" type="xml">
<tree string="押金列表" editable="bottom">
<field name="property_id"/>
<field name="lessee_id"/>
</tree>
</field>
</record>
</odoo>
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_property_electric_reading_tree" model="ir.ui.view">
<field name="name">property.electric.reading.tree</field>
<field name="model">property.electric.reading</field>
<field name="arch" type="xml">
<tree string="抄表" editable="bottom">
<field name="code"/>
<field name="position" optional="hide"/>
<field name="property_id"/>
<field name="contract" optional="hide"/>
<field name="lessee_id"/>
<field name="users_id" optional="hide"/>
<field name="state" optional="hide"/>
<field name="payment_account" optional="hide"/>
<field name="billing_period" optional="hide"/>
<field name="meter_date" optional="hide"/>
<field name="last_meter"/>
<field name="current_meter"/>
<field name="apply_standards" optional="hide"/>
<field name="price_unit" optional="hide"/>
<field name="ratio" optional="hide"/>
<field name="amount_wastage" optional="hide"/>
<field name="dosage"/>
<field name="employee_ids" widget="many2many_tags"/>
<field name="reading_type" optional="hide"/>
<field name="generate_charges" optional="hide"/>
<field name="other" optional="hide"/>
<field name="type" optional="hide"/>
<button name="button_details" type="object" string="详情" class="btn-primary"/>
</tree>
</field>
</record>
<record id="view_property_electric_reading_form" model="ir.ui.view">
<field name="name">property.electric.reading.form</field>
<field name="model">property.electric.reading</field>
<field name="arch" type="xml">
<form string="抄表">
<sheet>
<group col="2">
<group>
<field name="code"/>
<field name="employee_ids" widget="many2many_tags" readonly="1"/>
<field name="position"/>
<field name="property_id"/>
<field name="contract"/>
<field name="lessee_id"/>
<field name="state"/>
<field name="other"/>
<field name="payment_account"/>
<field name="billing_period"/>
<field name="is_push"/>
</group>
<group>
<field name="meter_date"/>
<field name="last_meter"/>
<field name="current_meter"/>
<field name="apply_standards"/>
<field name="price_unit"/>
<field name="ratio"/>
<field name="amount_wastage"/>
<field name="dosage"/>
<field name="type"/>
<field name="generate_charges"/>
</group>
</group>
</sheet>
<div class="o_attachment_preview"/>
<div class="oe_chatter">
<field name="message_follower_ids" groups="base.group_user"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="view_property_electric_reading_search" model="ir.ui.view">
<field name="name">property.electric.reading.search</field>
<field name="model">property.electric.reading</field>
<field name="arch" type="xml">
<search string="抄表">
<field name="code"/>
<filter name="property_id" string="地址" context="{'group_by':'property_id'}"/>
<filter name="reading_type" string="抄表状态" context="{'group_by':'reading_type'}"/>
</search>
</field>
</record>
<record id="view_property_meter_archives_task_action" model="ir.actions.act_window">
<field name="name">电表抄表任务</field>
<field name="res_model">property.electric.reading</field>
<field name="view_mode">tree,form,search</field>
</record>
<record id="all_data_relevance_property" model="ir.actions.server">
<field name="name">发送消息提醒</field>
<field name="model_id" ref="yuthon_property.model_property_electric_reading"/>
<field name="binding_model_id" ref="yuthon_property.model_property_electric_reading"/>
<field name="state">code</field>
<field name="code">action = model.reading_publish()</field>
</record>
</odoo>
@@ -14,6 +14,7 @@
<field name="last_reading_time"/>
<field name="type"/>
<field name="pre_existing_balances"/>
<button name="button_reading_push" type="object" string="推送" class="btn-primary"/>
</tree>
</field>
</record>
@@ -45,7 +46,6 @@
<field name="end_time"/>
</group>
<group>
<field name="gauge_type" readonly="1"/>
<field name="type"/>
<field name="gauge_magnification"/>
<field name="maximum_count"/>
@@ -56,6 +56,7 @@
<field name="meter_reading_type"/>
<field name="last_reading_time" invisible="meter_reading_type != 'readout'"/>
<field name="pre_existing_balances"/>
<field name="is_push" invisible="1"/>
</group>
</group>
<group col="2" string="默认关联设置">
@@ -73,7 +74,7 @@
</field>
</record>
<record id="action_property_meter_archives" model="ir.actions.act_window">
<field name="name">仪表库档案</field>
<field name="name">电表仪表库档案</field>
<field name="res_model">property.meter.archives</field>
<field name="view_mode">tree,form</field>
</record>
@@ -84,4 +85,11 @@
<field name="state">code</field>
<field name="code">action = model.action_property_meter_wizard()</field>
</record>
<record id="all_batch_archives_reading_push" model="ir.actions.server">
<field name="name">批量推送</field>
<field name="model_id" ref="yuthon_property.model_property_meter_archives"/>
<field name="binding_model_id" ref="yuthon_property.model_property_meter_archives"/>
<field name="state">code</field>
<field name="code">action = model.batch_reading_push()</field>
</record>
</odoo>
@@ -14,6 +14,7 @@
<field name="type"/>
<field name="last_reading_time"/>
<field name="pre_existing_balances"/>
<button name="button_reading_water_push" type="object" string="推送" class="btn-primary"/>
</tree>
</field>
</record>
@@ -44,7 +45,6 @@
<field name="end_time"/>
</group>
<group>
<field name="gauge_type" readonly="1"/>
<field name="other"/>
<field name="type"/>
<field name="gauge_magnification"/>
@@ -56,6 +56,7 @@
<field name="meter_reading_type"/>
<field name="last_reading_time" invisible="meter_reading_type != 'readout'"/>
<field name="pre_existing_balances"/>
<field name="is_push" invisible="1"/>
</group>
</group>
<group col="2" string="默认关联设置">
@@ -73,7 +74,7 @@
</field>
</record>
<record id="action_property_meter_water" model="ir.actions.act_window">
<field name="name">仪表库档案</field>
<field name="name">水表仪表库档案</field>
<field name="res_model">property.meter.water</field>
<field name="view_mode">tree,form</field>
</record>
@@ -84,4 +85,11 @@
<field name="state">code</field>
<field name="code">action = model.action_property_water_wizard()</field>
</record>
<record id="all_batch_water_reading_push" model="ir.actions.server">
<field name="name">批量推送</field>
<field name="model_id" ref="yuthon_property.model_property_meter_water"/>
<field name="binding_model_id" ref="yuthon_property.model_property_meter_water"/>
<field name="state">code</field>
<field name="code">action = model.batch_reading_water_push()</field>
</record>
</odoo>
@@ -8,16 +8,16 @@
decoration-success="charge_status == 'fully_paid'">
<field name="property_id"/>
<field name="lessee_id"/>
<field name="management_type_id"/>
<field name="due_date"/>
<field name="original_amount"/>
<field name="discount_amount"/>
<field name="remark"/>
<field name="charge_status" column_invisible="1"/>
<field name="multiplier" column_invisible="1"/>
<field name="is_push" optional="hide"/>
<field name="create_time"/>
<field name="last_update_time"/>
<field name="management_type_id"/>
<field name="remark"/>
<field name="last_update_time" optional="hide"/>
<field name="condition"/>
<field name="is_billing"/>
<field name="is_reconciliation"/>
@@ -61,6 +61,7 @@
<field name="lessee_id"/>
<group expand="0" string="group_by">
<filter name="group_property_id" string="物业" context="{'group_by':'property_id'}"/>
<filter name="group_lessee_id" string="承租方" context="{'group_by':'lessee_id'}"/>
</group>
</search>
</field>
@@ -70,6 +71,7 @@
<field name="res_model">property.rent.list</field>
<field name="view_mode">tree,search</field>
<field name="domain">[('is_billing', '=', True), ('is_push', '=', True)]</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_rent_list_tree2')})]"/>
</record>
@@ -78,6 +80,7 @@
<field name="res_model">property.rent.list</field>
<field name="view_mode">tree,search</field>
<field name="domain">[('is_billing', '=', False), ('is_push', '=', True)]</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_rent_list_tree')})]"/>
</record>
@@ -85,6 +88,7 @@
<field name="name">对账</field>
<field name="res_model">property.rent.list</field>
<field name="view_mode">tree,search</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="domain">[('is_reconciliation', '=', True), ('is_push', '=', True), ('is_billing', '=', True)]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_rent_list_tree')})]"/>
@@ -93,6 +97,7 @@
<field name="name">未对账</field>
<field name="res_model">property.rent.list</field>
<field name="view_mode">tree,search</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="domain">[('is_reconciliation', '=', False), ('is_push', '=', True), ('is_billing', '=', True)]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_rent_list_tree')})]"/>
@@ -101,6 +106,7 @@
<field name="name">红冲</field>
<field name="res_model">property.rent.list</field>
<field name="view_mode">tree,search</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="domain">[('condition', '=', 'red'), ('is_push', '=', True)]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_rent_list_tree')})]"/>
@@ -109,6 +115,7 @@
<field name="name">作废</field>
<field name="res_model">property.rent.list</field>
<field name="view_mode">tree,search</field>
<field name="context">{'search_default_group_lessee_id': 1}</field>
<field name="domain">[('condition', '=', 'invalid'), ('is_push', '=', True)]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.view_property_rent_list_tree')})]"/>
@@ -51,6 +51,18 @@
<field name="end_date"/>
</group>
</group>
<notebook>
<page string="银行账户信息">
<field name="bank_ids" string=" ">
<tree editable="bottom">
<field name="tenant_id" column_invisible="1"/>
<field name="name"/>
<field name="user"/>
<field name="bank"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_property_meter_reading_tree" model="ir.ui.view">
<field name="name">property.meter.reading.tree</field>
<field name="model">property.meter.reading</field>
<record id="view_property_water_reading_tree" model="ir.ui.view">
<field name="name">property.water.reading.tree</field>
<field name="model">property.water.reading</field>
<field name="arch" type="xml">
<tree string="抄表" editable="bottom">
<field name="code"/>
@@ -12,7 +12,6 @@
<field name="lessee_id"/>
<field name="users_id" optional="hide"/>
<field name="state" optional="hide"/>
<field name="meter_type"/>
<field name="payment_account" optional="hide"/>
<field name="billing_period" optional="hide"/>
<field name="meter_date" optional="hide"/>
@@ -29,27 +28,25 @@
<field name="other" optional="hide"/>
<field name="type" optional="hide"/>
<button name="button_details" type="object" string="详情" class="btn-primary"/>
<button name="button_reading_push" type="object" string="推送" class="btn-primary"/>
</tree>
</field>
</record>
<record id="view_property_meter_reading_form" model="ir.ui.view">
<field name="name">property.meter.reading.form</field>
<field name="model">property.meter.reading</field>
<record id="view_property_water_reading_form" model="ir.ui.view">
<field name="name">property.water.reading.form</field>
<field name="model">property.water.reading</field>
<field name="arch" type="xml">
<form string="抄表">
<sheet>
<group col="2">
<group>
<field name="code"/>
<field name="employee_ids" widget="many2many_tags" required="1"/>
<field name="employee_ids" widget="many2many_tags" readonly="1"/>
<field name="position"/>
<field name="property_id"/>
<field name="contract"/>
<field name="lessee_id"/>
<field name="state"/>
<field name="other"/>
<field name="meter_type" required="1"/>
<field name="payment_account"/>
<field name="billing_period"/>
<field name="is_push"/>
@@ -77,9 +74,9 @@
</form>
</field>
</record>
<record id="view_property_meter_reading_search" model="ir.ui.view">
<field name="name">property.meter.reading.search</field>
<field name="model">property.meter.reading</field>
<record id="view_property_water_reading_search" model="ir.ui.view">
<field name="name">property.water.reading.search</field>
<field name="model">property.water.reading</field>
<field name="arch" type="xml">
<search string="抄表">
<field name="code"/>
@@ -88,45 +85,18 @@
</search>
</field>
</record>
<record id="view_property_meter_archives_task_action" model="ir.actions.act_window">
<field name="name">电表抄表任务</field>
<field name="res_model">property.meter.reading</field>
<field name="view_mode">tree,form,search</field>
<field name="domain">[('meter_type','=','electric'), ('is_push', '=', True)]</field>
</record>
<record id="view_property_meter_water_task_action" model="ir.actions.act_window">
<field name="name">水表抄表任务</field>
<field name="res_model">property.meter.reading</field>
<field name="res_model">property.water.reading</field>
<field name="view_mode">tree,form,search</field>
<field name="domain">[('meter_type','=','water'), ('is_push', '=', True)]</field>
</record>
<record id="view_property_meter_archives_reading_action" model="ir.actions.act_window">
<field name="name">电表抄表</field>
<field name="res_model">property.meter.reading</field>
<field name="view_mode">tree,form,search</field>
<field name="context">{'search_default_property_id': 1, 'search_default_reading_type': 1}</field>
<field name="domain">[('meter_type','=','electric'), ('is_push', '=', False)]</field>
</record>
<record id="view_property_meter_water_reading_action" model="ir.actions.act_window">
<field name="name">水表抄表</field>
<field name="res_model">property.meter.reading</field>
<field name="view_mode">tree,form,search</field>
<field name="domain">[('meter_type','=','water'), ('is_push', '=', False)]</field>
</record>
<record id="all_data_relevance_property" model="ir.actions.server">
<field name="name">发送消息提醒</field>
<field name="model_id" ref="yuthon_property.model_property_meter_reading"/>
<field name="binding_model_id" ref="yuthon_property.model_property_meter_reading"/>
<field name="model_id" ref="yuthon_property.model_property_water_reading"/>
<field name="binding_model_id" ref="yuthon_property.model_property_water_reading"/>
<field name="state">code</field>
<field name="code">action = model.reading_publish()</field>
</record>
<record id="all_batch_reading_push" model="ir.actions.server">
<field name="name">批量推送</field>
<field name="model_id" ref="yuthon_property.model_property_meter_reading"/>
<field name="binding_model_id" ref="yuthon_property.model_property_meter_reading"/>
<field name="state">code</field>
<field name="code">action = model.batch_reading_push()</field>
</record>
</odoo>
@@ -12,6 +12,7 @@
<field name="pooled_area"/>
<field name="ctual_area"/>
<field name="registered_id"/>
<field name="property_use_time"/>
</tree>
</field>
</record>
@@ -32,11 +33,13 @@
<field name="owner_id"/>
<field name="title_certificate"/>
<field name="equity_area"/>
<field name="life_timer"/>
</group>
<group>
<field name="pooled_area"/>
<field name="ctual_area"/>
<field name="registered_id"/>
<field name="property_use_time"/>
</group>
</group>
<group>
+10 -13
View File
@@ -6,6 +6,7 @@
<field name="arch" type="xml">
<tree string="物业管理">
<header>
<!-- <field name="state" widget="statusbar"/>-->
<button name="put_property_handover" string="物业移交" type="object"/>
<button name="put_declare_approval" type="object" string="提交出租申报"/>
</header>
@@ -15,8 +16,6 @@
<field name="management_area" digits="[16, 4]"/>
<field name="rent_area" digits="[16, 4]"/>
<field name="equity_area" digits="[16, 4]"/>
<field name="start_time"/>
<field name="end_date"/>
<button name="put_offline_approval" type="object" string="提交线下审批" class="btn btn-primary"/>
<button name="put_adjustment_approval" type="object" string="调整出租条件" class="btn btn-primary"/>
</tree>
@@ -29,6 +28,9 @@
<field name="arch" type="xml">
<form string="资产信息">
<sheet>
<header>
<field name="state" widget="statusbar"/>
</header>
<field name="code" readonly="1"/>
<div class="container">
<div class="row justify-content-between position-relative w-100 m-0 mb-2">
@@ -48,14 +50,12 @@
</div>
<group string="基本信息">
<group>
<field name="lessee_id" readonly="1"/>
<field name="premises"/>
<field name="users_id" invisible="1"/>
<field name="units"/>
<field name="property_floor"/>
<field name="property_orientation"/>
<field name="street"/>
<field name="life_timer"/>
<field name="effective_date"/>
</group>
<group>
@@ -70,14 +70,12 @@
<field name="title_deed" invisible="1"/>
<field name="purpose_id" invisible="1"/>
<field name="admin_id" invisible="1"/>
<field name="state" readonly="1"/>
<field name="house_type_id"/>
<field name="district"/>
<field name="live_room"/>
<field name="is_done_split" invisible="1"/>
<field name="is_done_merge" invisible="1"/>
<field name="property_use_time"/>
<field name="end_date"/>
<field name="state" invisible="1"/>
</group>
</group>
<group col="3">
@@ -268,10 +266,6 @@
<span>管理员:</span>
<field name="admin_id"/>
</div>
<div>
<span>承租方:</span>
<field name="lessee_id"/>
</div>
</div>
</div>
<div name="tags"/>
@@ -326,6 +320,9 @@
<field name="arch" type="xml">
<form>
<sheet>
<header>
<field name="state" widget="statusbar"/>
</header>
<group>
<group>
<field name="name"/>
@@ -337,7 +334,7 @@
<field name="current_status"/>
<field name="registered_id"/>
<field name="district_manager"/>
<field name="state" readonly="1"/>
<field name="state" readonly="1" invisible="1"/>
</group>
</group>
<group>
@@ -378,7 +375,7 @@
<field name="code">action = model.action_yuthon_property_wizard()</field>
</record>
<record id="all_data_update_property_company" model="ir.actions.server">
<field name="name">更新公司</field>
<field name="name">更新公司和产权证编号</field>
<field name="model_id" ref="yuthon_property.model_yuthon_property"/>
<field name="binding_model_id" ref="yuthon_property.model_yuthon_property"/>
<field name="state">code</field>
+1
View File
@@ -12,6 +12,7 @@
'data/property_contract_time.xml',
'security/ir.model.access.csv',
'views/inherit_rent_list_views.xml',
'views/inherit_property_deposit_list.xml',
'views/property_billing_confirmation.xml',
'views/property_approval_views.xml',
'views/property_business_confirm.xml',
@@ -16,6 +16,15 @@ class PropertyRentList(models.Model):
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
class PropertyDepositList(models.Model):
_inherit = 'property.deposit.list'
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
deposit = fields.Float(related='contract_id.deposit',string="押金/履约保证金", store=True)
rent = fields.Float(related='contract_id.rent',string="租金", store=True)
percentage_damages = fields.Float(related='contract_id.percentage_damages',string="违约金", store=True)
aggregate = fields.Float(string="合计", store=True)
class PropertyManagementList(models.Model):
_inherit = 'property.management.list'
@@ -28,12 +37,19 @@ class YuthonProperty(models.Model):
property_contract_ids = fields.One2many('property.contract.line', 'yuthon_property_id', string="关联物业合同明细行")
class PropertyBankStatements(models.Model):
_inherit = 'property.bank.statements'
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
class PropertyBankLine(models.Model):
_inherit = 'property.bank.line'
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
class PropertyContractLine(models.Model):
_name = 'property.contract.line'
_description = '物业合同明细行'
@@ -151,6 +167,7 @@ class PropertyLeaseContract(models.Model):
mange_fee_ids = fields.One2many('property.manage.fee.line', 'contract_id', string="物业管理费明细行")
other_ids = fields.One2many('property.other.fee.line', 'other_id', string="其他费用明细行")
rent_list_ids = fields.One2many('property.rent.list', 'contract_id', string="租金明细行")
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="管理费用明细行")
# 附件
@@ -163,6 +180,13 @@ class PropertyLeaseContract(models.Model):
responsibility_book_id = fields.Many2one('ir.attachment', string="安全生产责任书")
handover_time = fields.Date(string="交接日期")
@api.onchange('lessee_id')
def _onchange_lessee_id(self):
for record in self:
if record.lessee_id:
lease_bank_ids = self.env['property.bank.line'].search([('tenant_id', '=', record.lessee_id.id)])
record.lease_bank_ids = lease_bank_ids.ids
@api.depends('not_received', 'now_receivable')
def _compute_comparison(self):
for record in self:
@@ -1160,6 +1184,7 @@ class PropertyLeaseContractLine(models.Model):
address_id = fields.Many2one('yuthon.property', string="物业地址")
admin_id = fields.Many2one(related='address_id.admin_id', string="管理员", default=lambda self: self.env.user.id)
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="评估单价")
@@ -0,0 +1,21 @@
<odoo>
<record id="inherit_property_deposit_list_tree" model="ir.ui.view">
<field name="name">property.deposit.list.tree</field>
<field name="model">property.deposit.list</field>
<field name="inherit_id" ref="yuthon_property.view_property_deposit_list_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='property_id']" position="after">
<field name="contract_id" string="合同"/>
<field name="deposit"/>
<field name="rent"/>
<field name="percentage_damages"/>
<field name="aggregate"/>
</xpath>
</field>
</record>
<record id="property_deposit_list_action" model="ir.actions.act_window">
<field name="name">押金列表</field>
<field name="res_model">property.deposit.list</field>
<field name="view_mode">tree</field>
</record>
</odoo>
@@ -104,20 +104,31 @@
</group>
</group>
</page>
<page string="承租方个人信息">
<group col="2">
<group>
<field name="invoicing_type"/>
<field name="invoicing_begins"/>
<field name="tax_number"/>
<field name="industry_id"/>
</group>
<group>
<field name="contact"/>
<field name="phone"/>
<field name="email"/>
</group>
</group>
<group>
<field name="lease_bank_ids" string="银行账户信息">
<tree editable="bottom" create="false" delete="false">
<field name="name"/>
<field name="user"/>
<field name="bank"/>
</tree>
</field>
</group>
</page>
</notebook>
<group col="2" string="承租方个人信息">
<group>
<field name="invoicing_type"/>
<field name="invoicing_begins"/>
<field name="tax_number"/>
<field name="industry_id"/>
</group>
<group>
<field name="contact"/>
<field name="phone"/>
<field name="email"/>
</group>
</group>
<group>
<field name="property_documents_ids" widget="many2many_tags" invisible="1">
<tree>
@@ -418,6 +429,7 @@
<field name="admin_id"/>
<field name="property_area"/>
<field name="evaluate_unit_price"/>
<field name="message_standard_id"/>
</tree>
</field>
</page>
@@ -437,21 +449,31 @@
</group>
</group>
</page>
<page string="承租方个人信息">
<group col="2">
<group>
<field name="invoicing_type"/>
<field name="invoicing_begins"/>
<field name="tax_number"/>
<field name="industry_id"/>
</group>
<group>
<field name="contact"/>
<field name="phone"/>
<field name="email"/>
</group>
</group>
<group>
<field name="lease_bank_ids" string="银行账户信息">
<tree editable="bottom" create="false" delete="false">
<field name="name"/>
<field name="user"/>
<field name="bank"/>
</tree>
</field>
</group>
</page>
</notebook>
<group col="2" string="承租方个人信息">
<group>
<field name="invoicing_type"/>
<field name="invoicing_begins"/>
<field name="tax_number"/>
<field name="industry_id"/>
<field name="precinct_id" invisible="1"/>
</group>
<group>
<field name="contact"/>
<field name="phone"/>
<field name="email"/>
</group>
</group>
<group>
<field name="property_documents_ids" widget="many2many_tags" invisible="1">
<tree>
@@ -580,6 +602,16 @@
</tree>
</field>
</page>
<page string="其他费用">
<field name="other_ids" string=" ">
<tree editable="bottom">
<field name="other_id" column_invisible="1"/>
<field name="charges"/>
<field name="coping"/>
<field name="coping_time"/>
</tree>
</field>
</page>
<page string="银行流水">
<field name="bank_statements_ids" string=" ">
<tree editable="bottom">
@@ -594,16 +626,6 @@
</tree>
</field>
</page>
<page string="其他费用">
<field name="other_ids" string=" ">
<tree editable="bottom">
<field name="other_id" column_invisible="1"/>
<field name="charges"/>
<field name="coping"/>
<field name="coping_time"/>
</tree>
</field>
</page>
<page string="水费" invisible="not is_water">
<field name="water_fee_ids" string=" ">
<tree editable="bottom">
@@ -322,4 +322,9 @@
name="作废"
parent="yuthon_accounts_receivable_menu"
action="yuthon_property.view_property_rent_invalid_action"/>
<menuitem id="yuthon_property_deposit_list"
sequence="22"
name="押金列表"
parent="yuthon_property.yuthon_property_fee_management"
action="property_deposit_list_action"/>
</odoo>
@@ -11,10 +11,6 @@ class PropertyRentalWizard(models.Model):
('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'),
('9', '九月'), ('10', '十月'), ('11', '十一月'),
('12', '十二月')], string='选择月份', default=lambda self: str(datetime.now().month))
is_rental = fields.Boolean(string='租金')
is_management_fee = fields.Boolean(string='管理费')
is_water_fee = fields.Boolean(string='水费')
is_electricity_fee = fields.Boolean(string='电费')
select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2060)], string='选择年份', default=lambda self: str(datetime.now().year))
def create_rent_list(self, record, rent_id, rent_amount, start_date,multiplier):
@@ -6,20 +6,6 @@
<field name="arch" type="xml">
<form string="合同应收向导">
<sheet>
<group col="4">
<group>
<field name="is_rental"/>
</group>
<group>
<field name="is_management_fee"/>
</group>
<group>
<field name="is_water_fee"/>
</group>
<group>
<field name="is_electricity_fee"/>
</group>
</group>
<group>
<field name="select_month"/>
<field name="select_year"/>