hi all,
i have inheritted model 'res.users', added 3 fields. for zone_id (Many2one) i wants to inherit /addons/auth_signup/controllers/main.py and implement my code, i want guidance as it is difficult for me as beginner and as per its odoo's very important controller. my model file and code for the controller file are below, please have your expert opinion and guidance where it needed. the Manu2one zone_id is empty when run Signup: form http://localhost:8069/web/signup
model:
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")
controller:
from odoo.addons.auth_signup.controllers.main import AuthSignupHome
class AuthSignupHome(AuthSignupHome):
@http.route('/web/signup', type='http', auth='public', website=True, sitemap=False)
def zone_fill (self, **kw):
zone_rec = request.env['tests.zones'].sudo().search([])
return http.request.render('auth_signup.signup', {'zone_rec':zone_rec})
my xml template code for zone_id:
<div class="form-group">
<label for="zone_id" class="control-label">Zone</label>
<select name="zone_id" class="form-control link-style">
<t t-foreach="zone_rec" t-as="zone">
<option t-esc="zone.name" t-att-value="zone.id"/>
</t>
</select>
</div>
regards