diff --git a/yuthon_property/models/property_meter_reading.py b/yuthon_property/models/property_meter_reading.py index 33596fea5..16e037cf6 100644 --- a/yuthon_property/models/property_meter_reading.py +++ b/yuthon_property/models/property_meter_reading.py @@ -3,13 +3,15 @@ from odoo import models, fields, api class PropertyMeterReading(models.Model): _name = 'property.meter.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='合同') - customer_id = fields.Many2one('property.tenant.information', 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='仪表类型') @@ -23,7 +25,7 @@ class PropertyMeterReading(models.Model): price_unit = fields.Float(string='单价') ratio = fields.Float(string='倍率') amount_wastage = fields.Float(string='损耗量') - dosage = fields.Float(string='用量') + dosage = fields.Float(string='用量', tracking=True) generate_charges = fields.Float(string='生成费用') type = fields.Selection([('public', '公共'), ('fees', '收费')], string='收费类型') reading_type = fields.Selection([('done', '已抄'), ('undone', '待抄')], string='类型') @@ -38,4 +40,13 @@ class PropertyMeterReading(models.Model): self.sudo().env["wecom.apps"].sync_send_message_textcard(category='notice', user_id=we_id, title="通知公告", description="您有抄表待处理,请及时处理", - url=str, btntxt="详细信息") \ No newline at end of file + url=str, btntxt="详细信息") + + def button_details(self): + return { + 'name': '抄表详情', + 'type': 'ir.actions.act_window', + 'view_mode': 'form', + 'res_model': 'property.meter.reading', + 'res_id': self.id, + } \ No newline at end of file diff --git a/yuthon_property/models/property_rent_list.py b/yuthon_property/models/property_rent_list.py index 828584e69..46c73eae7 100644 --- a/yuthon_property/models/property_rent_list.py +++ b/yuthon_property/models/property_rent_list.py @@ -6,7 +6,8 @@ class PropertyRentList(models.Model): _description = '租金列表' property_id = fields.Many2one('yuthon.property', string='物业') - lessee_id = fields.Many2one('property.tenant.information', string='承租方') + lessee_id = fields.Many2one(related='property_id.lessee_id', string='承租方') + contract_id = fields.Many2one('property.lease.contract', string="关联租赁合同审批") due_date = fields.Date(string='应收日期') year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2060)], string='所属年',) month = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'), @@ -25,6 +26,7 @@ class PropertyRentList(models.Model): is_suspend = fields.Boolean(string='挂起') create_time = fields.Datetime(string='创建时间', default=fields.Datetime.now) is_push = fields.Boolean(string='已推送') + management_type_id = fields.Many2one('yuthon.management.type', string='管理费类型') last_update_time = fields.Datetime(string='最后修改时间') def write(self, vals): diff --git a/yuthon_property/models/yuthon_resource_mgmt_config.py b/yuthon_property/models/yuthon_resource_mgmt_config.py index e97f71cce..64add33bc 100644 --- a/yuthon_property/models/yuthon_resource_mgmt_config.py +++ b/yuthon_property/models/yuthon_resource_mgmt_config.py @@ -118,4 +118,10 @@ class YuthonPurposeEvidence(models.Model): _name = 'yuthon.purpose.evidence' _description = '证载用途' - name = fields.Char(string="证载用途") \ No newline at end of file + name = fields.Char(string="证载用途") + +class YuthonManagementType(models.Model): + _name = 'yuthon.management.type' + _description = '管理类型' + + name = fields.Char(string="管理类型") \ No newline at end of file diff --git a/yuthon_property/security/ir.model.access.csv b/yuthon_property/security/ir.model.access.csv index 221396729..2b575c946 100644 --- a/yuthon_property/security/ir.model.access.csv +++ b/yuthon_property/security/ir.model.access.csv @@ -58,4 +58,5 @@ access_property_meter_wizard,property_meter_wizard,model_property_meter_wizard,b access_yuthon_industry_setting,yuthon_industry_setting,model_yuthon_industry_setting,base.group_user,1,1,1,1 access_property_tenant_wizard,property_tenant_wizard,model_property_tenant_wizard,base.group_user,1,1,1,1 access_property_water_wizard,property_water_wizard,model_property_water_wizard,base.group_user,1,1,1,1 -access_yuthon_purpose_evidence,yuthon_purpose_evidence,model_yuthon_purpose_evidence,base.group_user,1,1,1,1 \ No newline at end of file +access_yuthon_purpose_evidence,yuthon_purpose_evidence,model_yuthon_purpose_evidence,base.group_user,1,1,1,1 +access_yuthon_management_type,yuthon_management_type,model_yuthon_management_type,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_property/views/menuitem.xml b/yuthon_property/views/menuitem.xml index 48f1734f7..21e8dfd97 100644 --- a/yuthon_property/views/menuitem.xml +++ b/yuthon_property/views/menuitem.xml @@ -366,6 +366,8 @@ action="view_yuthon_industry_setting_action" sequence="60"/> + diff --git a/yuthon_property/views/property_meter_reading_views.xml b/yuthon_property/views/property_meter_reading_views.xml index aec7eab51..8ffec2a1d 100644 --- a/yuthon_property/views/property_meter_reading_views.xml +++ b/yuthon_property/views/property_meter_reading_views.xml @@ -4,14 +4,15 @@ property.meter.reading.tree property.meter.reading - + - + - + + - + @@ -26,6 +27,7 @@ +