Here i need the following,
1.add country while user signing up in web/signup url.
Here is my code...
<label class="control-label" for="country_id">Country</label>
<select name="country_id" id="country_id" class="form-control">
<t t-foreach="countries or " t-as="country">
<option t-att-value="country.id" t-att-selected="country.id == auth_signup.get('country_id')"><t t-esc="country.name"/></option>
but it not listing the countries list from res.country
please give any ideas / suggestions
thanks in advance...!
I recently came across this problem and found a solution.
Now, the t-att-selected in your xml option will still fail as auth_signup does not have anything with country-id. I'd just remove the t-att-selected.
You'll have to modify the controller 'main.py' of the module auth_signup. Or inherit it (preferred way)
Then add the following code to the top of the method 'web_auth_signup':
orm_country = request.registry.get('res.country')
country_ids = orm_country.search(request.cr, SUPERUSER_ID, , context=request.context)
countries = orm_country.browse(request.cr, SUPERUSER_ID, country_ids, context=request.context)
qcontext = self.get_auth_signup_qcontext() # This line is already present in this method.
qcontext['countries'] = countries
# Paste the rest of the original method here.
Hope my explanation was clear
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 9/9/15, 1:53 PM|
|Seen: 1354 times|
|Last updated: 11/19/16, 7:54 PM|