From 623d9e63b10d027bdca5c19d8cfecedfc9fed02f Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Thu, 16 Jan 2025 15:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/property_lease_contract.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 60467220f..0ee59f2ec 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -26,6 +26,14 @@ class PropertyDepositList(models.Model): renovation_deposit = fields.Float(related='contract_id.renovation_deposit', string="装修押金") aggregate = fields.Float(string="合计", store=True) + # def push_deposit(self): + # for rec in self: + + + @api.onchange('deposit', 'performance_bonds', 'utility_bills', 'renovation_deposit') + def _onchange_aggregate(self): + for rec in self: + rec.aggregate = rec.deposit + rec.performance_bonds + rec.utility_bills + rec.renovation_deposit class PropertyManagementList(models.Model): _inherit = 'property.management.list' @@ -330,7 +338,7 @@ class PropertyLeaseContract(models.Model): date_payment_month = fields.Char(string="支付日期") date_payment_day = fields.Char(string="支付日期") first_pay = fields.Date(string="首次付款日") - unit_price = fields.Float(string="单价", store=True) + unit_price = fields.Float(string="单价", store=True, digits=(16, 2)) deposit_type = fields.Selection([('deposit', '押金'), ('performance', '履约保证金')], string="押金/履约保证金") deposit_status = fields.Selection([('unpaid', '未支付'), ('paid', '已支付'), ('returned','已退'),('no_paid', '没收')], string='押金状态') deposit = fields.Float(string="押金/履约保证金", store=True)