You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.9 KiB

  1. from odoo import api, fields, models
  2. class ResCompany(models.Model):
  3. _inherit = 'res.company'
  4. def _get_base_logo(self):
  5. base_url = self.env['ir.config_parameter'].get_param('web.base.url')
  6. self.logo_url = base_url + "/logo.png"
  7. coop_email_contact = fields.Char(string="Contact email address for the"
  8. " cooperator")
  9. subscription_maximum_amount = fields.Float(string="Maximum authorised"
  10. " subscription amount")
  11. default_country_id = fields.Many2one('res.country',
  12. string="Default country",
  13. default=lambda self: self.country_id)
  14. default_lang_id = fields.Many2one('res.lang',
  15. string="Default lang")
  16. allow_id_card_upload = fields.Boolean(string="Allow ID Card upload")
  17. create_user = fields.Boolean(string="Create user for cooperator",
  18. default=False)
  19. board_representative = fields.Char(string="Board representative name")
  20. signature_scan = fields.Binary(string="Board representative signature")
  21. property_cooperator_account = fields.Many2one('account.account',
  22. company_dependent=True,
  23. string="Cooperator Account",
  24. domain=[('internal_type', '=', 'receivable'),
  25. ('deprecated', '=', False)],
  26. help="This account will be"
  27. " the default one as the"
  28. " receivable account for the"
  29. " cooperators",
  30. required=True)
  31. unmix_share_type = fields.Boolean(string="Unmix share type",
  32. default=True,
  33. help="If checked, A cooperator will be"
  34. " authorised to have only one type"
  35. " of share")
  36. display_logo1 = fields.Boolean(string="Display logo 1")
  37. display_logo2 = fields.Boolean(string="Display logo 2")
  38. bottom_logo1 = fields.Binary(string="Bottom logo 1")
  39. bottom_logo2 = fields.Binary(string="Bottom logo 2")
  40. logo_url = fields.Char(string="logo url",
  41. compute="_get_base_logo")
  42. display_data_policy_approval = fields.Boolean(
  43. help="Choose to display a data policy checkbox on the cooperator"
  44. " website form."
  45. )
  46. data_policy_approval_required = fields.Boolean(
  47. string="Is data policy approval required?"
  48. )
  49. data_policy_approval_text = fields.Html(
  50. translate=True,
  51. help="Text to display aside the checkbox to approve data policy."
  52. )
  53. display_internal_rules_approval = fields.Boolean(
  54. help="Choose to display an internal rules checkbox on the"
  55. " cooperator website form."
  56. )
  57. internal_rules_approval_required = fields.Boolean(
  58. string="Is internal rules approval required?"
  59. )
  60. internal_rules_approval_text = fields.Html(
  61. translate=True,
  62. help="Text to display aside the checkbox to approve internal rules."
  63. )
  64. @api.onchange('data_policy_approval_required')
  65. def onchange_data_policy_approval_required(self):
  66. if self.data_policy_approval_required:
  67. self.display_data_policy_approval = True
  68. @api.onchange('internal_rules_approval_required')
  69. def onchange_internal_rules_approval_required(self):
  70. if self.internal_rules_approval_required:
  71. self.display_internal_rules_approval = True