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)