i want to add to add new field "arabic_name" to signup page i add the field in res.partner
,add it to the sign up view , and override the def_prepare_signup_values and add my new field
but the field in the sign up deoen't stored or related to the field on res.partner
what i do
1-override _prepare_signup_values function
class ExtendAuthSignupHome(AuthSignupHome):
def _prepare_signup_values(self, qcontext):
values = { key: qcontext.get(key) for key in ('login', 'name', 'password' , 'arabic_name') }
if not values:
raise UserError(_("The form was not properly filled in."))
if values.get('password') != qcontext.get('confirm_password'):
raise UserError(_("Passwords do not match; please retype them."))
supported_lang_codes = [code for code, _ in request.env['res.lang'].get_installed()]
lang = request.context.get('lang', '')
if lang in supported_lang_codes:
values['lang'] = lang
return values
=========================
2-add field to res.partner
class MoreField(models.Model):
_inherit = 'res.partner'
arabic_name = fields.Char(string="Name In Arabic")
=====================
3-add field to the signup view
expr="//div[@class='form-group field-name']" position="after">
type="text" name="arabic_name" t-att-value="arabic_name" id="arabic_name" class="form-control form-control-sm" placeholder="e.g. أحمد على"
required="required" t-att-readonly="'readonly' if only_passwords else None"
t-att-autofocus="'autofocus' if login and not only_passwords else None" />