Skip to content

Instantly share code, notes, and snippets.

@aannganyelne
Last active September 6, 2022 02:01
Show Gist options
  • Save aannganyelne/6d898693fe633dbd118ee35bcbc8cf34 to your computer and use it in GitHub Desktop.
Save aannganyelne/6d898693fe633dbd118ee35bcbc8cf34 to your computer and use it in GitHub Desktop.
Odoo 12 Add value to selection field
class ModelA(models.Model):
_name = "model.a"
alias_contact = fields.Selection([
('everyone', 'Everyone'),
('partners', 'Authenticated Partners'),
('followers', 'Followers only')], default='everyone',
string='Alias Contact Security', required=True,
help="Policy to post a message on the document using the mailgateway.\n"
"- everyone: everyone can post\n"
"- partners: only authenticated partners\n"
"- followers: only followers of the related document or members of following channels\n")
class ModelB(models.Model):
_inherit = "model.a"
alias_contact = fields.Selection(selection_add=[('employees', 'Authenticated Employees')])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment