@@ -2672,6 +2672,9 @@
|
||||
<field name="name">议题库</field>
|
||||
<field name="res_model">issue.library</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_issue.view_issue_library_form')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_issue.view_issue_library_form')})]"/>
|
||||
</record>
|
||||
<record id="all_data_update_issue_library" model="ir.actions.server">
|
||||
<field name="name">批量上会</field>
|
||||
|
||||
@@ -11,17 +11,16 @@
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
action="issue_library_my_action"
|
||||
sequence="1"/>
|
||||
<menuitem id="yuthon_library_all_menu"
|
||||
name="全部"
|
||||
<menuitem id="issue_approval_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
action="issue_library_all_action"
|
||||
sequence="3"/>
|
||||
name="议题审批"
|
||||
action="issue_library_approval_action"
|
||||
sequence="5"/>
|
||||
<menuitem id="tianhe_issue_library_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="议题库"
|
||||
groups="yuthon_issue.group_topic_admin"
|
||||
sequence="5"/>
|
||||
|
||||
sequence="10"/>
|
||||
<menuitem id="tianhe_issue_library_all"
|
||||
parent="tianhe_issue_library_menu"
|
||||
name="全部"
|
||||
@@ -46,47 +45,12 @@
|
||||
action="issue_library_action_cancel"
|
||||
sequence="15"/>
|
||||
|
||||
<menuitem id="issue_approval_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="议题审批"
|
||||
action="issue_library_approval_action"
|
||||
sequence="28"/>
|
||||
|
||||
<menuitem id="issue_meeting_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="议题相关会议"
|
||||
action="issue_meeting_action"
|
||||
sequence="29"/>
|
||||
|
||||
<menuitem id="issue_meeting_minutes_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="会议纪要"
|
||||
action="action_issue_meeting_minutes"
|
||||
sequence="30"/>
|
||||
|
||||
<menuitem id="issue_approval_decision_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="决策清单"
|
||||
action="issue_approval_decision_action"
|
||||
sequence="40"/>
|
||||
|
||||
<menuitem id="issue_approval_decision_setting_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="配置"
|
||||
sequence="50"/>
|
||||
|
||||
<menuitem id="issue_approval_decision_type_menu"
|
||||
parent="issue_approval_decision_setting_menu"
|
||||
name="事项类别配置"
|
||||
action="issue_approval_decision_type_action"
|
||||
sequence="1"/>
|
||||
|
||||
<!--党支委会议题库-->
|
||||
<menuitem id="tianhe_issue_library_menu_root3"
|
||||
name="党支委议题库"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
groups="yuthon_issue.group_party_topic"
|
||||
sequence="10"/>
|
||||
sequence="15"/>
|
||||
|
||||
<menuitem id="issue_library_menu3"
|
||||
parent="tianhe_issue_library_menu_root3"
|
||||
@@ -117,7 +81,7 @@
|
||||
name="班子会议题库"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
groups="yuthon_issue.group_team_topic"
|
||||
sequence="15"/>
|
||||
sequence="20"/>
|
||||
|
||||
<menuitem id="issue_library_menu4"
|
||||
parent="tianhe_issue_library_menu_root4"
|
||||
@@ -148,7 +112,7 @@
|
||||
name="董事会议题库"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
groups="yuthon_issue.group_board_topic"
|
||||
sequence="20"/>
|
||||
sequence="25"/>
|
||||
|
||||
<menuitem id="issue_library_menu5"
|
||||
parent="tianhe_issue_library_menu_root5"
|
||||
@@ -179,7 +143,7 @@
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="物管党支委议题库"
|
||||
groups="property_group_party_topic"
|
||||
sequence="25"/>
|
||||
sequence="30"/>
|
||||
|
||||
<menuitem id="issue_library_menu6"
|
||||
parent="tianhe_issue_library_menu_root6"
|
||||
@@ -210,7 +174,7 @@
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="物管班子会议题库"
|
||||
groups="property_group_team_topic"
|
||||
sequence="30"/>
|
||||
sequence="35"/>
|
||||
|
||||
<menuitem id="issue_library_menu7"
|
||||
parent="tianhe_issue_library_menu_root7"
|
||||
@@ -236,12 +200,44 @@
|
||||
action="issue_library_action_cancel7"
|
||||
sequence="9"/>
|
||||
|
||||
<!--物管议题库-->
|
||||
<menuitem id="tianhe_issue_library_menu_root11"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="物管议题库"
|
||||
groups="yuthon_issue.group_property_admin"
|
||||
sequence="40"/>
|
||||
|
||||
<menuitem id="issue_library_menu11"
|
||||
parent="tianhe_issue_library_menu_root11"
|
||||
name="全部"
|
||||
action="issue_library_action11"
|
||||
sequence="1"/>
|
||||
|
||||
<menuitem id="tianhe_other_issue_library_will11"
|
||||
parent="tianhe_issue_library_menu_root11"
|
||||
name="已审批"
|
||||
action="issue_library_action_will11"
|
||||
sequence="5"/>
|
||||
|
||||
<menuitem id="tianhe_other_issue_library_done11"
|
||||
parent="tianhe_issue_library_menu_root11"
|
||||
name="已上会"
|
||||
action="issue_library_action_done11"
|
||||
sequence="7"/>
|
||||
|
||||
<menuitem id="tianhe_other_issue_library_cancel11"
|
||||
parent="tianhe_issue_library_menu_root11"
|
||||
name="已取消"
|
||||
action="issue_library_action_cancel11"
|
||||
sequence="9"/>
|
||||
|
||||
|
||||
<!--粮储党支议题库-->
|
||||
<menuitem id="tianhe_issue_library_menu_root9"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="粮储党支委议题库"
|
||||
groups="yuthon_issue.group_grain_party_topic"
|
||||
sequence="35"/>
|
||||
sequence="45"/>
|
||||
|
||||
<menuitem id="issue_library_menu9"
|
||||
parent="tianhe_issue_library_menu_root9"
|
||||
@@ -272,7 +268,7 @@
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="粮储班子会议题库"
|
||||
groups="yuthon_issue.group_grain_team_topic"
|
||||
sequence="40"/>
|
||||
sequence="50"/>
|
||||
|
||||
<menuitem id="issue_library_menu10"
|
||||
parent="tianhe_issue_library_menu_root10"
|
||||
@@ -297,37 +293,6 @@
|
||||
name="已取消"
|
||||
action="issue_library_action_cancel10"
|
||||
sequence="9"/>
|
||||
|
||||
<!--物管议题库-->
|
||||
<menuitem id="tianhe_issue_library_menu_root11"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="物管议题库"
|
||||
groups="yuthon_issue.group_property_admin"
|
||||
sequence="45"/>
|
||||
|
||||
<menuitem id="issue_library_menu11"
|
||||
parent="tianhe_issue_library_menu_root11"
|
||||
name="全部"
|
||||
action="issue_library_action11"
|
||||
sequence="1"/>
|
||||
|
||||
<menuitem id="tianhe_other_issue_library_will11"
|
||||
parent="tianhe_issue_library_menu_root11"
|
||||
name="已审批"
|
||||
action="issue_library_action_will11"
|
||||
sequence="5"/>
|
||||
|
||||
<menuitem id="tianhe_other_issue_library_done11"
|
||||
parent="tianhe_issue_library_menu_root11"
|
||||
name="已上会"
|
||||
action="issue_library_action_done11"
|
||||
sequence="7"/>
|
||||
|
||||
<menuitem id="tianhe_other_issue_library_cancel11"
|
||||
parent="tianhe_issue_library_menu_root11"
|
||||
name="已取消"
|
||||
action="issue_library_action_cancel11"
|
||||
sequence="9"/>
|
||||
|
||||
<!--粮储议题库-->
|
||||
<menuitem id="tianhe_issue_library_menu_root12"
|
||||
@@ -359,4 +324,40 @@
|
||||
name="已取消"
|
||||
action="issue_library_action_cancel12"
|
||||
sequence="9"/>
|
||||
|
||||
<menuitem id="issue_meeting_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="议题相关会议"
|
||||
action="issue_meeting_action"
|
||||
sequence="55"/>
|
||||
|
||||
<menuitem id="issue_meeting_minutes_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="会议纪要"
|
||||
action="action_issue_meeting_minutes"
|
||||
sequence="60"/>
|
||||
|
||||
<menuitem id="issue_approval_decision_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="决策清单"
|
||||
action="issue_approval_decision_action"
|
||||
sequence="65"/>
|
||||
|
||||
<menuitem id="yuthon_library_all_menu"
|
||||
name="全部"
|
||||
parent="yuthon_library_my_menu"
|
||||
action="issue_library_all_action"
|
||||
sequence="88"/>
|
||||
|
||||
<menuitem id="issue_approval_decision_setting_menu"
|
||||
parent="tianhe_issue_library_menu_root"
|
||||
name="配置"
|
||||
sequence="99"/>
|
||||
|
||||
<menuitem id="issue_approval_decision_type_menu"
|
||||
parent="issue_approval_decision_setting_menu"
|
||||
name="事项类别配置"
|
||||
action="issue_approval_decision_type_action"
|
||||
sequence="1"/>
|
||||
|
||||
</odoo>
|
||||
@@ -1,4 +1,5 @@
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
|
||||
class PropertyElectricReading(models.Model):
|
||||
@@ -10,7 +11,6 @@ class PropertyElectricReading(models.Model):
|
||||
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='抄表人')
|
||||
@@ -51,3 +51,18 @@ class PropertyElectricReading(models.Model):
|
||||
'res_model': 'property.electric.reading',
|
||||
'res_id': self.id,
|
||||
}
|
||||
|
||||
def button_electric_push(self):
|
||||
for rec in self:
|
||||
rec.write({
|
||||
'is_push': True,
|
||||
})
|
||||
if rec.is_push:
|
||||
raise UserError(f"该仪表已经推送,不能重复推送")
|
||||
self.env["property.tariff.list"].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,
|
||||
})
|
||||
@@ -5,21 +5,12 @@ class PropertyManagementList(models.Model):
|
||||
_name = 'property.management.list'
|
||||
_description = '物业费管理列表'
|
||||
|
||||
contract_code = fields.Char(string='合同编号', required=True)
|
||||
contract_code = fields.Char(string='合同编号')
|
||||
property_id = fields.Many2one('yuthon.property', string='物业')
|
||||
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
|
||||
due_date = fields.Date(string='应收日期')
|
||||
year = fields.Char(string='所属年')
|
||||
month = fields.Char(string='所属月')
|
||||
management_fee_standard = fields.Float(string='管理费标准')
|
||||
original_amount = fields.Float(string='原金额')
|
||||
message_standard_id = fields.Many2one('property.message.fee', string="管理费标准")
|
||||
original_amount = fields.Float(string='金额')
|
||||
reduction_amount = fields.Float(string='减免金额')
|
||||
remarks = fields.Text(string='备注')
|
||||
is_cancel = fields.Boolean(string='作废')
|
||||
is_red = fields.Boolean(string='红冲')
|
||||
red_date = fields.Date(string='红冲日期')
|
||||
charge_status = fields.Selection([('not_paid', '未收'), ('paid', '已收')], string='收费状态')
|
||||
is_invoice = fields.Boolean(string='开票')
|
||||
is_suspend = fields.Boolean(string='挂起')
|
||||
create_time = fields.Datetime(string='创建时间')
|
||||
last_update_time = fields.Datetime(string='最后修改时间')
|
||||
|
||||
@@ -63,35 +63,4 @@ class PropertyMeterArchives(models.Model):
|
||||
"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,
|
||||
})
|
||||
@@ -61,36 +61,3 @@ class PropertyMeterWater(models.Model):
|
||||
"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,
|
||||
})
|
||||
@@ -14,7 +14,7 @@ class PropertyTariffList(models.Model):
|
||||
month = fields.Char(string='所属月')
|
||||
tariff_meter_reading = fields.Float(string='电费读数')
|
||||
tariff_fee_standard = fields.Float(string='电费标准')
|
||||
original_amount = fields.Float(string='原金额')
|
||||
original_amount = fields.Float(string='金额')
|
||||
deduction_amount = fields.Float(string='减免金额')
|
||||
remarks = fields.Text(string='备注')
|
||||
is_cancel = fields.Boolean(string='作废')
|
||||
|
||||
@@ -83,27 +83,11 @@
|
||||
sequence="4"
|
||||
name="应收"
|
||||
parent="yuthon_property_estate_menu"/>
|
||||
<menuitem id="yuthon_property_management_list"
|
||||
sequence="23"
|
||||
name="管理费列表"
|
||||
parent="yuthon_property_fee_management"
|
||||
action="view_property_management_list_action"/>
|
||||
<menuitem id="yuthon_property_penalty_list"
|
||||
sequence="25"
|
||||
name="违约金列表"
|
||||
parent="yuthon_property_fee_management"
|
||||
action="view_property_penalty_list_action"/>
|
||||
<menuitem id="yuthon_property_water_list"
|
||||
sequence="28"
|
||||
name="水费列表"
|
||||
parent="yuthon_property_fee_management"
|
||||
action="view_property_water_list_action"/>
|
||||
<menuitem id="yuthon_property_tariff_list"
|
||||
sequence="32"
|
||||
name="电费列表"
|
||||
parent="yuthon_property_fee_management"
|
||||
action="view_property_tariff_list_action"/>
|
||||
|
||||
<menuitem id="yuthon_property_estate_works_menu"
|
||||
sequence="5"
|
||||
name="建设工程"
|
||||
@@ -114,26 +98,6 @@
|
||||
sequence="11"
|
||||
name="仪表"
|
||||
parent="yuthon_property_menu_root"/>
|
||||
<menuitem id="yuthon_property_meter_ele_task_menu"
|
||||
sequence="1"
|
||||
name="电表抄表任务"
|
||||
parent="yuthon_property_meter_menu"
|
||||
action="view_property_meter_archives_task_action"/>
|
||||
<menuitem id="yuthon_property_meter_water_task_menu"
|
||||
sequence="5"
|
||||
name="水表抄表任务"
|
||||
parent="yuthon_property_meter_menu"
|
||||
action="view_property_meter_water_task_action"/>
|
||||
<menuitem id="yuthon_property_archives_power_menu"
|
||||
sequence="10"
|
||||
name="电表库"
|
||||
parent="yuthon_property_meter_menu"
|
||||
action="action_property_meter_archives"/>
|
||||
<menuitem id="yuthon_property_archives_water_menu"
|
||||
sequence="15"
|
||||
name="水表库"
|
||||
parent="yuthon_property_meter_menu"
|
||||
action="action_property_meter_water"/>
|
||||
<menuitem id="yuthon_property_archives_setting_meu"
|
||||
sequence="99"
|
||||
name="配置"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<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"/>
|
||||
@@ -43,7 +42,6 @@
|
||||
<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"/>
|
||||
@@ -85,11 +83,6 @@
|
||||
</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"/>
|
||||
|
||||
@@ -5,32 +5,16 @@
|
||||
<field name="model">property.management.list</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom" string="管理费列表">
|
||||
<field name="contract_code"/>
|
||||
<field name="property_id"/>
|
||||
<field name="lessee_id"/>
|
||||
<field name="due_date"/>
|
||||
<field name="year"/>
|
||||
<field name="month"/>
|
||||
<field name="management_fee_standard"/>
|
||||
<field name="message_standard_id"/>
|
||||
<field name="original_amount"/>
|
||||
<field name="reduction_amount"/>
|
||||
<field name="remarks"/>
|
||||
<field name="is_red"/>
|
||||
<field name="red_date"/>
|
||||
<field name="is_cancel"/>
|
||||
<field name="charge_status"/>
|
||||
<field name="is_invoice"/>
|
||||
<field name="is_suspend"/>
|
||||
<field name="create_time"/>
|
||||
<field name="last_update_time"/>
|
||||
<field name="remarks"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_property_management_list_action" model="ir.actions.act_window">
|
||||
<field name="name">管理费列表</field>
|
||||
<field name="res_model">property.management.list</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<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>
|
||||
@@ -73,11 +72,6 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_property_meter_archives" model="ir.actions.act_window">
|
||||
<field name="name">电表仪表库档案</field>
|
||||
<field name="res_model">property.meter.archives</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<record id="all_data_meter_property" model="ir.actions.server">
|
||||
<field name="name">导入电表</field>
|
||||
<field name="model_id" ref="yuthon_property.model_property_meter_archives"/>
|
||||
@@ -85,11 +79,4 @@
|
||||
<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,7 +14,6 @@
|
||||
<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>
|
||||
@@ -73,11 +72,6 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_property_meter_water" model="ir.actions.act_window">
|
||||
<field name="name">水表仪表库档案</field>
|
||||
<field name="res_model">property.meter.water</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<record id="all_data_meter_water_property" model="ir.actions.server">
|
||||
<field name="name">导入水表</field>
|
||||
<field name="model_id" ref="yuthon_property.model_property_meter_water"/>
|
||||
@@ -85,11 +79,4 @@
|
||||
<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>
|
||||
@@ -5,32 +5,25 @@
|
||||
<field name="model">property.tariff.list</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="电费列表" editable="bottom">
|
||||
<field name="contract_code"/>
|
||||
<field name="contract_code" optional="hide"/>
|
||||
<field name="property_id"/>
|
||||
<field name="lessee_id"/>
|
||||
<field name="tariff_meter_number"/>
|
||||
<field name="tariff_meter_number" optional="hide"/>
|
||||
<field name="due_date"/>
|
||||
<field name="year"/>
|
||||
<field name="month"/>
|
||||
<field name="tariff_meter_reading"/>
|
||||
<field name="tariff_fee_standard"/>
|
||||
<field name="tariff_meter_reading" optional="hide"/>
|
||||
<field name="tariff_fee_standard" optional="hide"/>
|
||||
<field name="original_amount"/>
|
||||
<field name="deduction_amount"/>
|
||||
<field name="deduction_amount" optional="hide"/>
|
||||
<field name="remarks"/>
|
||||
<field name="is_cancel"/>
|
||||
<field name="is_red"/>
|
||||
<field name="red_date"/>
|
||||
<field name="fee_status"/>
|
||||
<field name="is_invoice"/>
|
||||
<field name="is_suspend"/>
|
||||
<field name="create_time"/>
|
||||
<field name="write_time"/>
|
||||
<field name="is_cancel" optional="hide"/>
|
||||
<field name="is_red" optional="hide"/>
|
||||
<field name="red_date" optional="hide"/>
|
||||
<field name="fee_status" optional="hide"/>
|
||||
<field name="is_invoice" optional="hide"/>
|
||||
<field name="is_suspend" optional="hide"/>
|
||||
<field name="create_time" optional="hide"/>
|
||||
<field name="write_time" optional="hide"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id='view_property_tariff_list_action' model="ir.actions.act_window">
|
||||
<field name="name">电费列表</field>
|
||||
<field name="res_model">property.tariff.list</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -5,32 +5,25 @@
|
||||
<field name="model">property.water.list</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="水费列表" editable="bottom">
|
||||
<field name="contract_code"/>
|
||||
<field name="contract_code" optional="hide"/>
|
||||
<field name="property_id"/>
|
||||
<field name="lessee_id"/>
|
||||
<field name="water_meter_number"/>
|
||||
<field name="water_meter_number" optional="hide"/>
|
||||
<field name="due_date"/>
|
||||
<field name="year"/>
|
||||
<field name="month"/>
|
||||
<field name="water_meter_reading"/>
|
||||
<field name="water_fee_standard"/>
|
||||
<field name="water_meter_reading" optional="hide"/>
|
||||
<field name="water_fee_standard" optional="hide"/>
|
||||
<field name="original_amount"/>
|
||||
<field name="deduction_amount"/>
|
||||
<field name="deduction_amount" optional="hide"/>
|
||||
<field name="remarks"/>
|
||||
<field name="is_cancel"/>
|
||||
<field name="is_red"/>
|
||||
<field name="red_date"/>
|
||||
<field name="fee_status"/>
|
||||
<field name="is_invoice"/>
|
||||
<field name="is_suspend"/>
|
||||
<field name="create_time"/>
|
||||
<field name="write_time"/>
|
||||
<field name="is_cancel" optional="hide"/>
|
||||
<field name="is_red" optional="hide"/>
|
||||
<field name="red_date" optional="hide"/>
|
||||
<field name="fee_status" optional="hide"/>
|
||||
<field name="is_invoice" optional="hide"/>
|
||||
<field name="is_suspend" optional="hide"/>
|
||||
<field name="create_time" optional="hide"/>
|
||||
<field name="write_time" optional="hide"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id='view_property_water_list_action' model="ir.actions.act_window">
|
||||
<field name="name">水费列表</field>
|
||||
<field name="res_model">property.water.list</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<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"/>
|
||||
@@ -43,7 +42,6 @@
|
||||
<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"/>
|
||||
@@ -85,11 +83,6 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_property_meter_water_task_action" model="ir.actions.act_window">
|
||||
<field name="name">水表抄表任务</field>
|
||||
<field name="res_model">property.water.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_water_reading"/>
|
||||
|
||||
@@ -28,9 +28,34 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="资产信息">
|
||||
<sheet>
|
||||
<header>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<widget name="web_ribbon" title="待评估" bg_color="text-bg-success"
|
||||
invisible="state != 'to'"/>
|
||||
<widget name="web_ribbon" title="已评估" bg_color="text-bg-success"
|
||||
invisible="state != 'done'"/>
|
||||
<widget name="web_ribbon" title="评估中" bg_color="text-bg-success"
|
||||
invisible="state != 'ing'"/>
|
||||
<widget name="web_ribbon" title="移交中" bg_color="text-bg-success"
|
||||
invisible="state != 'ing_handover'"/>
|
||||
<widget name="web_ribbon" title="已移交" bg_color="text-bg-success"
|
||||
invisible="state != 'done_handover'"/>
|
||||
<widget name="web_ribbon" title="备案中" bg_color="text-bg-success"
|
||||
invisible="state != 'filing'"/>
|
||||
<widget name="web_ribbon" title="挂网" bg_color="text-bg-success"
|
||||
invisible="state != 'net'"/>
|
||||
<widget name="web_ribbon" title="签约中" bg_color="text-bg-success"
|
||||
invisible="state != 'signing'"/>
|
||||
<widget name="web_ribbon" title="已备案" bg_color="text-bg-success"
|
||||
invisible="state != 'signed'"/>
|
||||
<widget name="web_ribbon" title="已租" bg_color="text-bg-success"
|
||||
invisible="state != 'leased'"/>
|
||||
<widget name="web_ribbon" title="空置" bg_color="text-bg-success"
|
||||
invisible="state != 'idle'"/>
|
||||
<widget name="web_ribbon" title="不可租" bg_color="text-bg-success"
|
||||
invisible="state != 'no_lease'"/>
|
||||
<widget name="web_ribbon" title="在租" bg_color="text-bg-success"
|
||||
invisible="state != 'leasing'"/>
|
||||
<widget name="web_ribbon" title="自用" bg_color="text-bg-success"
|
||||
invisible="state != 'self'"/>
|
||||
<field name="code" readonly="1"/>
|
||||
<div class="container">
|
||||
<div class="row justify-content-between position-relative w-100 m-0 mb-2">
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
'data/property_contract_time.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/inherit_rent_list_views.xml',
|
||||
'views/inherit_property_management_list.xml',
|
||||
'views/inherit_property_deposit_list.xml',
|
||||
'views/property_billing_confirmation.xml',
|
||||
'views/property_approval_views.xml',
|
||||
|
||||
@@ -20,9 +20,10 @@ 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)
|
||||
deposit = fields.Float(related='contract_id.deposit', string="押金/履约保证金", store=True)
|
||||
performance_bonds = fields.Float(related='contract_id.performance_bonds', string="经营履约保证金")
|
||||
utility_bills = fields.Float(related='contract_id.utility_bills', string="水电费押金")
|
||||
renovation_deposit = fields.Float(related='contract_id.renovation_deposit', string="装修押金")
|
||||
aggregate = fields.Float(string="合计", store=True)
|
||||
|
||||
|
||||
@@ -50,6 +51,136 @@ class PropertyBankLine(models.Model):
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
|
||||
|
||||
class PropertyTariffList(models.Model):
|
||||
_inherit = 'property.tariff.list'
|
||||
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
|
||||
|
||||
class PropertyWaterList(models.Model):
|
||||
_inherit = 'property.water.list'
|
||||
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
|
||||
class PropertyElectricReading(models.Model):
|
||||
_inherit = 'property.electric.reading'
|
||||
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
|
||||
def button_push_electric(self):
|
||||
pass
|
||||
|
||||
def batch_reading_electric(self):
|
||||
pass
|
||||
|
||||
|
||||
class PropertyWaterReading(models.Model):
|
||||
_inherit = 'property.water.reading'
|
||||
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
|
||||
def button_push_water(self):
|
||||
pass
|
||||
|
||||
def batch_reading_water(self):
|
||||
pass
|
||||
|
||||
class PropertyMeterArchives(models.Model):
|
||||
_inherit = 'property.meter.archives'
|
||||
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
|
||||
def batch_contract_association(self):
|
||||
archives_ids = self.env["property.meter.archives"].browse(self._context.get('active_ids', self._context.get('active_id')))
|
||||
for record in archives_ids:
|
||||
if record.yuthon_property_id.id:
|
||||
contract_id = self.env["property.lease.contract.line"].search([('address_id', '=', record.yuthon_property_id.id)], limit=1)
|
||||
if contract_id:
|
||||
record.sudo().write({
|
||||
'contract_id': contract_id.lease_id.id})
|
||||
|
||||
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,
|
||||
'contract_id':rec.contract_id.id
|
||||
})
|
||||
|
||||
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,
|
||||
'contract_id':record.contract_id.id
|
||||
})
|
||||
|
||||
class PropertyMeterWater(models.Model):
|
||||
_inherit = 'property.meter.water'
|
||||
|
||||
contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批")
|
||||
|
||||
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,
|
||||
'contract_id': rec.contract_id.id
|
||||
})
|
||||
|
||||
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,
|
||||
'contract_id': record.contract_id.id
|
||||
})
|
||||
|
||||
def batch_contract_association_water(self):
|
||||
archives_ids = self.env["property.meter.water"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
for record in archives_ids:
|
||||
if record.yuthon_property_id.id:
|
||||
contract_id = self.env["property.lease.contract.line"].search(
|
||||
[('address_id', '=', record.yuthon_property_id.id)], limit=1)
|
||||
if contract_id:
|
||||
record.sudo().write({
|
||||
'contract_id': contract_id.lease_id.id})
|
||||
|
||||
class PropertyContractLine(models.Model):
|
||||
_name = 'property.contract.line'
|
||||
_description = '物业合同明细行'
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
<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="performance_bonds"/>
|
||||
<field name="utility_bills"/>
|
||||
<field name="renovation_deposit"/>
|
||||
<field name="aggregate"/>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<odoo>
|
||||
<record id="inherit_property_management_list_tree" model="ir.ui.view">
|
||||
<field name="name">property.management.list.tree</field>
|
||||
<field name="model">property.management.list</field>
|
||||
<field name="inherit_id" ref="yuthon_property.view_property_management_list_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='property_id']" position="after">
|
||||
<field name="contract_id" string="合同"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="property_management_list_action" model="ir.actions.act_window">
|
||||
<field name="name">管理费列表</field>
|
||||
<field name="res_model">property.management.list</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -26,4 +26,182 @@
|
||||
<field name="domain">[('is_push', '=', False)]</field>
|
||||
<field name="context">{'search_default_group_contract_id': 1}</field>
|
||||
</record>
|
||||
<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="performance_bonds"/>
|
||||
<field name="utility_bills"/>
|
||||
<field name="renovation_deposit"/>
|
||||
<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>
|
||||
<record id="inherit_property_tariff_list_tree" model="ir.ui.view">
|
||||
<field name="name">property.tariff.list.tree</field>
|
||||
<field name="model">property.tariff.list</field>
|
||||
<field name="inherit_id" ref="yuthon_property.view_property_tariff_list_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='property_id']" position="after">
|
||||
<field name="contract_id" string="合同"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id='view_property_tariff_list_action' model="ir.actions.act_window">
|
||||
<field name="name">电费列表</field>
|
||||
<field name="res_model">property.tariff.list</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
<record id="inherit_property_water_list_tree" model="ir.ui.view">
|
||||
<field name="name">property.water.list.tree</field>
|
||||
<field name="model">property.water.list</field>
|
||||
<field name="inherit_id" ref="yuthon_property.view_property_water_list_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='property_id']" position="after">
|
||||
<field name="contract_id" string="合同"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id='view_property_water_list_action' model="ir.actions.act_window">
|
||||
<field name="name">水费列表</field>
|
||||
<field name="res_model">property.water.list</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
</record>
|
||||
<record id="inherit_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="inherit_id" ref="yuthon_property.view_property_electric_reading_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='property_id']" position="after">
|
||||
<field name="contract_id" string="合同"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='type']" position="after">
|
||||
<button name="button_push_electric" type="object" string="推送" class="btn-primary"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="all_property_electric_reading_push" 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.batch_reading_electric()</field>
|
||||
</record>
|
||||
<record id='view_property_electric_reading_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="inherit_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="inherit_id" ref="yuthon_property.view_property_water_reading_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='property_id']" position="after">
|
||||
<field name="contract_id" string="合同"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='type']" position="after">
|
||||
<button name="button_push_water" type="object" string="推送" class="btn-primary"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="all_property_water_reading_push" model="ir.actions.server">
|
||||
<field name="name">批量推送</field>
|
||||
<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.batch_reading_water()</field>
|
||||
</record>
|
||||
<record id='view_property_water_reading_action' model="ir.actions.act_window">
|
||||
<field name="name">水费抄表任务</field>
|
||||
<field name="res_model">property.water.reading</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
</record>
|
||||
<record id="inherit_property_meter_archives_tree" model="ir.ui.view">
|
||||
<field name="name">property.meter.archives.tree</field>
|
||||
<field name="model">property.meter.archives</field>
|
||||
<field name="inherit_id" ref="yuthon_property.view_property_meter_archives_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='pre_existing_balances']" position="after">
|
||||
<button name="button_reading_push" type="object" string="推送" class="btn-primary"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="inherit_property_meter_archives_form" model="ir.ui.view">
|
||||
<field name="name">property.meter.archives.tree</field>
|
||||
<field name="model">property.meter.archives</field>
|
||||
<field name="inherit_id" ref="yuthon_property.view_property_meter_archives_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='yuthon_property_id']" position="after">
|
||||
<field name="contract_id" string="合同"/>
|
||||
</xpath>
|
||||
</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>
|
||||
<record id="all_batch_contract_association" 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_contract_association()</field>
|
||||
</record>
|
||||
<record id="action_property_meter_archives" model="ir.actions.act_window">
|
||||
<field name="name">电表仪表库档案</field>
|
||||
<field name="res_model">property.meter.archives</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<record id="inherit_property_meter_water_tree" model="ir.ui.view">
|
||||
<field name="name">property.meter.water.tree</field>
|
||||
<field name="model">property.meter.water</field>
|
||||
<field name="inherit_id" ref="yuthon_property.view_property_meter_water_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='pre_existing_balances']" position="after">
|
||||
<button name="button_reading_water_push" type="object" string="推送" class="btn-primary"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="inherit_property_meter_water_form" model="ir.ui.view">
|
||||
<field name="name">property.meter.water.tree</field>
|
||||
<field name="model">property.meter.water</field>
|
||||
<field name="inherit_id" ref="yuthon_property.view_property_meter_water_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='yuthon_property_id']" position="after">
|
||||
<field name="contract_id" string="合同"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_property_meter_water" model="ir.actions.act_window">
|
||||
<field name="name">水表仪表库档案</field>
|
||||
<field name="res_model">property.meter.water</field>
|
||||
<field name="view_mode">tree,form</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>
|
||||
<record id="all_batch_contract_association_water" 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_contract_association_water()</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -327,4 +327,40 @@
|
||||
name="押金列表"
|
||||
parent="yuthon_property.yuthon_property_fee_management"
|
||||
action="property_deposit_list_action"/>
|
||||
<menuitem id="yuthon_property_management_list"
|
||||
sequence="28"
|
||||
name="管理费列表"
|
||||
parent="yuthon_property.yuthon_property_fee_management"
|
||||
action="property_management_list_action"/>
|
||||
<menuitem id="yuthon_property_tariff_list"
|
||||
sequence="32"
|
||||
name="电费列表"
|
||||
parent="yuthon_property.yuthon_property_fee_management"
|
||||
action="view_property_tariff_list_action"/>
|
||||
<menuitem id="yuthon_property_water_list"
|
||||
sequence="40"
|
||||
name="水费列表"
|
||||
parent="yuthon_property.yuthon_property_fee_management"
|
||||
action="view_property_water_list_action"/>
|
||||
|
||||
<menuitem id="yuthon_property_electric_reading_menu"
|
||||
sequence="5"
|
||||
name="电表抄表任务"
|
||||
parent="yuthon_property.yuthon_property_meter_menu"
|
||||
action="view_property_electric_reading_action"/>
|
||||
<menuitem id="yuthon_property_water_reading_menu"
|
||||
sequence="7"
|
||||
name="水表抄表任务"
|
||||
parent="yuthon_property.yuthon_property_meter_menu"
|
||||
action="view_property_water_reading_action"/>
|
||||
<menuitem id="yuthon_property_archives_power_menu"
|
||||
sequence="10"
|
||||
name="电表库"
|
||||
parent="yuthon_property.yuthon_property_meter_menu"
|
||||
action="action_property_meter_archives"/>
|
||||
<menuitem id="yuthon_property_archives_water_menu"
|
||||
sequence="15"
|
||||
name="水表库"
|
||||
parent="yuthon_property.yuthon_property_meter_menu"
|
||||
action="action_property_meter_water"/>
|
||||
</odoo>
|
||||
@@ -16,17 +16,77 @@ class PropertyRentalWizard(models.Model):
|
||||
def create_rent_list(self, record, rent_id, rent_amount, start_date,multiplier):
|
||||
"""封装创建租金记录的逻辑"""
|
||||
property_id = record.lease_ids[0].address_id.id if record.lease_ids else None
|
||||
self.sudo().env["property.rent.list"].create({
|
||||
first_day_of_month = start_date.replace(day=1)
|
||||
last_day_of_month = first_day_of_month + relativedelta(months=1) - timedelta(days=1)
|
||||
rent_id = self.env['property.rent.list'].search([
|
||||
('property_id', '=', property_id),
|
||||
('due_date', '>=', first_day_of_month),
|
||||
('due_date', '<=', last_day_of_month)
|
||||
])
|
||||
if not rent_id:
|
||||
self.sudo().env["property.rent.list"].create({
|
||||
"contract_id": record.id,
|
||||
"due_date": start_date,
|
||||
'multiplier':multiplier,
|
||||
"lessee_id": record.lessee_id.id,
|
||||
"property_id": property_id,
|
||||
"original_amount": rent_amount,
|
||||
"year": self.select_year,
|
||||
"month": self.select_month,
|
||||
})
|
||||
else:
|
||||
rent_id.write({
|
||||
"contract_id": record.id,
|
||||
"due_date": start_date,
|
||||
'multiplier': multiplier,
|
||||
"lessee_id": record.lessee_id.id,
|
||||
"property_id": property_id,
|
||||
"original_amount": rent_amount,
|
||||
"year": self.select_year,
|
||||
"month": self.select_month,
|
||||
})
|
||||
|
||||
def create_deposit_list(self, record):
|
||||
"""封装创建押金记录的逻辑"""
|
||||
property_id = record.lease_ids[0].address_id.id if record.lease_ids else None
|
||||
self.sudo().env["property.deposit.list"].create({
|
||||
"contract_id": record.id,
|
||||
"due_date": start_date,
|
||||
'multiplier':multiplier,
|
||||
"lessee_id": record.lessee_id.id,
|
||||
"property_id": property_id,
|
||||
"original_amount": rent_amount,
|
||||
"year": self.select_year,
|
||||
"month": self.select_month,
|
||||
})
|
||||
|
||||
def create_management_list(self, record,start_date):
|
||||
"""封装创建管理费记录的逻辑"""
|
||||
first_day_of_month = start_date.replace(day=1)
|
||||
last_day_of_month = first_day_of_month + relativedelta(months=1) - timedelta(days=1)
|
||||
for lease_id in record.lease_ids:
|
||||
property_id = lease_id.address_id
|
||||
management_id = self.env['property.management.list'].search([
|
||||
('property_id', '=', property_id.id),
|
||||
('due_date', '>=', first_day_of_month),
|
||||
('due_date', '<=', last_day_of_month)
|
||||
])
|
||||
if property_id.message_standard_id:
|
||||
standard_id = property_id.message_standard_id
|
||||
original_amount = property_id.management_area * standard_id.amount
|
||||
if not management_id:
|
||||
self.sudo().env["property.management.list"].create({
|
||||
"contract_id": record.id,
|
||||
"property_id": property_id.id,
|
||||
'original_amount':original_amount,
|
||||
'message_standard_id': property_id.message_standard_id.id,
|
||||
'lessee_id': property_id.lessee_id.id,
|
||||
"due_date":start_date
|
||||
})
|
||||
else:
|
||||
management_id.write({
|
||||
"contract_id": record.id,
|
||||
"property_id": property_id.id,
|
||||
'original_amount': original_amount,
|
||||
'message_standard_id': property_id.message_standard_id.id,
|
||||
'lessee_id': property_id.lessee_id.id,
|
||||
"due_date": start_date
|
||||
})
|
||||
|
||||
def process_rent_record(self, record, rent_id, date_field_year_month, days, period_month=0, multiplier=1, is_year=0):
|
||||
"""封装处理租金逻辑,增加 multiplier 参数用于乘法"""
|
||||
start_date_adj = rent_id.start_data + relativedelta(months=period_month)
|
||||
@@ -42,15 +102,14 @@ class PropertyRentalWizard(models.Model):
|
||||
multiplier = rent_id.month_number
|
||||
adjusted_rent = rent_amount * multiplier
|
||||
# 调整后的租金
|
||||
now_data = datetime.now()
|
||||
start_date = now_data.replace(day=start_day)
|
||||
start_date = start_date_adj.replace(day=start_day)
|
||||
if start_year_month <= date_field_year_month < end_year_month:
|
||||
self.create_rent_list(record, rent_id, adjusted_rent, start_date,multiplier)
|
||||
|
||||
self.create_management_list(record, start_date)
|
||||
elif start_year_month <= date_field_year_month <= end_year_month:
|
||||
if rent_id.end_data.day < days:
|
||||
self.create_rent_list(record, rent_id, adjusted_rent, rent_id.start_data,multiplier)
|
||||
|
||||
self.create_management_list(record, start_date)
|
||||
# 尝试处理下一个租金分解
|
||||
rent_ids = record.breakdown_ids
|
||||
current_index = rent_ids.ids.index(rent_id.id)
|
||||
@@ -58,6 +117,7 @@ class PropertyRentalWizard(models.Model):
|
||||
next_rent_id = rent_ids[current_index + 1]
|
||||
adjusted_rent_next = ( next_rent_id.period_rent if period_month else next_rent_id.monthly_amount) * multiplier
|
||||
self.create_rent_list(record, next_rent_id, adjusted_rent_next, next_rent_id.start_data,multiplier)
|
||||
self.create_management_list(record, start_date)
|
||||
except (IndexError, ValueError):
|
||||
pass
|
||||
|
||||
@@ -71,7 +131,6 @@ class PropertyRentalWizard(models.Model):
|
||||
|
||||
def confirm(self):
|
||||
"""主逻辑入口"""
|
||||
self.env["property.rent.list"].search([]).unlink()
|
||||
records = self.env['property.lease.contract'].search(
|
||||
[('cycle_dict', 'in', ['monthly', 'quarter', 'half', 'year'])])
|
||||
year, month = int(self.select_year), int(self.select_month)
|
||||
@@ -88,7 +147,8 @@ class PropertyRentalWizard(models.Model):
|
||||
is_year = 1
|
||||
# 获取租金乘数(1 表示按月,3 表示季租金,6 表示半年租金,年后面赋值)
|
||||
multiplier = self.get_multiplier(record.cycle_dict)
|
||||
|
||||
for rent_id in record.breakdown_ids:
|
||||
self.process_rent_record(record, rent_id, date_field_year_month, days, period_month, multiplier, is_year)
|
||||
self.create_deposit_list(record)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user