Skip to Content
Menu
This question has been flagged
1 Reply
1587 Views

want to show Many2one field on website (on page/form) but don't know how to, please help.

my base model on which 2nd model based on:

class Zones(models.Model):
    _name = 'tests.zones'
    _rec_name = 'name'
    _description = "Tests Zones"
    name = fields.Char(string="Zone Name", required=True)
    description = fields.Text(string="Zone Description")
    zone_status = fields.Selection([
        ('active', 'Active'),
        ('inactive', 'In-Active')
    ], string="Zone Status", required=True, default='active')

model which contains inheritance and used for website, requires to add in wesite form/page:

class ResUsersExt(models.Model):
    _inherit = 'res.users'
    contact_no = fields.Char(string='Contact No.')
    address = fields.Text(string='Your Address', required=True, default='00')
    zone_id = fields.Many2one('tests.zones', string="Your Zone", required=True, default="1")

regards


Avatar
Discard
Best Answer

Hi,

See this example illustrating the same: How To Add Dynamic Selection Field In Odoo Website Form

Thanks

Avatar
Discard
Author

thanks @Niyas Raphy for quick response and link for video tutorial, definitely i will check it and will try to implement and give feedback.

Related Posts Replies Views Activity
1
Mar 21
1458
1
Feb 21
2620
2
Apr 23
1454
2
May 24
35830
2
Nov 22
1484