from odoo import fields, models class CommunityBenefitPartner(models.Model): _name = 'community.benefit.partner' _description = 'Benefit Centre' _order = 'name' name = fields.Char(related='partner_id.name', store=True, readonly=False) partner_id = fields.Many2one('res.partner', required=True) category = fields.Selection( [ ('retail', 'Retail'), ('food', 'Food & Dining'), ('services', 'Services'), ('health', 'Health & Wellness'), ('other', 'Other'), ], default='other', required=True, ) description = fields.Html() logo = fields.Binary(attachment=True) locations = fields.Text(help="Free-text addresses / areas served.") active = fields.Boolean(default=True) benefit_ids = fields.One2many('community.benefit', 'benefit_partner_id')