Update property_management_conf.py

This commit is contained in:
zainab2097 2024-09-03 12:50:20 +03:00 committed by GitHub
parent 15192124d6
commit d14f21be2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 3 deletions

View File

@ -10,9 +10,12 @@ class ResConfigSettings(models.TransientModel):
commission_percentage = fields.Float(string='Commission Percentage', help="The commission percentage.")
commission_account_id = fields.Many2one('account.account', string='Commission Account', help="The account used to record commissions.")
collecting_company_id = fields.Many2one('res.partner', string='Collecting Company', help="The company responsible for collecting the commission.")
def set_values(self):
super(ResConfigSettings, self).set_values()
# Save the values to ir.config_parameter
self.env['ir.config_parameter'].sudo().set_param('property_management.commission_percentage', self.commission_percentage)
self.env['ir.config_parameter'].sudo().set_param('property_management.commission_account_id', self.commission_account_id.id)
self.env['ir.config_parameter'].sudo().set_param('property_management.collecting_company_id', self.collecting_company_id.id)
class RentType(models.Model):
_name = 'rent.type'
_description = 'Rent Type'