diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index a17f36831..fdc9b65f8 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -72,7 +72,9 @@ class PropertyLeaseContract(models.Model): lease_term_month = fields.Integer(string="租期(月)") lease_term_day = fields.Integer(string="租期(日)") term_start_time = fields.Date(string="开始时间", default=fields.Datetime.now) + term_start_month_day = fields.Char(string="开始时间", compute="_compute_term_start_month_day") term_end_time = fields.Date(string="结束时间") + term_end_month_day = fields.Char(string="结束时间", compute="_compute_term_end_month_day") cycle_dict =fields.Selection([('monthly','月度'), ('quarter','季度'), ('half','半年'),('year','年度')],string='付款方式', default='monthly', help="应收") cycle_mode = fields.Selection([('fixed_monthly','合同月'), ('floating_monthly','自然月'), ('fixed_quarter', '合同季'), ('floating_quarter', '自然季'), ('fixed_year', '合同年'), ('floating_year', '自然年')], string='周期方式', default='fixed_monthly') @@ -116,6 +118,7 @@ class PropertyLeaseContract(models.Model): miscellaneous = fields.Text(string="其他约定") number = fields.Integer(string="次数", default=0) total_area = fields.Float(string="总面积", digits=(16, 4)) + not_received = fields.Float(string="未收") actual_receivable = fields.Float(string="实际应收") now_receivable = fields.Float(string="当前应收") total_receivable = fields.Float(string="总已收") @@ -146,6 +149,22 @@ class PropertyLeaseContract(models.Model): responsibility_book_id = fields.Many2one('ir.attachment', string="安全生产责任书") handover_time = fields.Date(string="交接日期") + @api.depends('term_start_time') + def _compute_term_start_month_day(self): + for record in self: + if record.term_start_time: + record.term_start_month_day = record.term_start_time.strftime('%Y-%m') + else: + record.term_start_month_day = '' + + @api.depends('term_end_time') + def _compute_term_end_month_day(self): + for record in self: + if record.term_end_time: + record.term_end_month_day = record.term_end_time.strftime('%Y-%m') + else: + record.term_end_month_day = '' + @api.onchange('total_area', 'rent') def _onchange_unit_price(self): for i in self: diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 188592c47..aab02d0f0 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -300,16 +300,19 @@ property.lease.contract - - - - - - + + + + + + + - - + + + +