Merge pull request #4198 from expsa/samir-aladawi-applicant-name-benefit
[UPD] odex_benefit
This commit is contained in:
commit
b7a3a5ac6d
|
|
@ -11,6 +11,8 @@ class CreatePortalAccount(http.Controller):
|
|||
def create_portal_account(self, **kw):
|
||||
try:
|
||||
data = {}
|
||||
applicant_name = kw.get('applicant_name')
|
||||
applicant_relation = kw.get('relation_type')
|
||||
first_name = kw.get('first_name')
|
||||
second_name = kw.get('second_name')
|
||||
login = kw.get('otp_mobile_phone')
|
||||
|
|
@ -45,10 +47,13 @@ class CreatePortalAccount(http.Controller):
|
|||
raise_exception=False).replace('+', '')
|
||||
|
||||
benefit_data = {
|
||||
'name': first_name + " " + second_name,
|
||||
'father_name': first_name,
|
||||
'father_family_name': second_name,
|
||||
'sms_phone' : login,
|
||||
'email' : email,
|
||||
'is_from_portal': True
|
||||
'is_from_portal': True,
|
||||
'applicant_name': applicant_name,
|
||||
'request_producer_relation': int(applicant_relation) if applicant_relation else False
|
||||
}
|
||||
|
||||
# Check relation type
|
||||
|
|
|
|||
|
|
@ -14653,3 +14653,7 @@ msgstr "إرجاع إلى المسودة"
|
|||
msgid "Are you sure you want to set the state to Draft?"
|
||||
msgstr "هل أنت متأكد أنك تريد إرجاع الحالة إلى المسودة؟"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__applicant_name
|
||||
msgid "Applicant Name"
|
||||
msgstr "اسم مقدم الطلب"
|
||||
|
|
|
|||
|
|
@ -573,6 +573,7 @@ class GrantBenefitProfile(models.Model):
|
|||
family_approval_attachment_ids = fields.Many2many('ir.attachment', 'rel_approval_attachment','benefit_id','attachment_id',string='Family approval of transfer')
|
||||
seasonal_service_id = fields.Many2one('seasonal.service', string="Seasonal Service")
|
||||
is_from_portal = fields.Boolean(string='is Created from Portal?', default=False, readonly=True)
|
||||
applicant_name = fields.Char(readonly=True)
|
||||
|
||||
_sql_constraints = [
|
||||
('unique_code', "unique (code) WHERE state NOT IN ('draft', 'new')", 'This code already exists')
|
||||
|
|
@ -1067,6 +1068,8 @@ class GrantBenefitProfile(models.Model):
|
|||
@api.model
|
||||
def create(self, vals):
|
||||
res = super(GrantBenefitProfile, self).create(vals)
|
||||
if "applicant_name" not in vals:
|
||||
res.applicant_name = self.env.user.display_name
|
||||
if "name" in vals and res.user_id:
|
||||
res.user_id.sudo().write({"name": vals.get("name")})
|
||||
# res = super(GrantBenefitProfile, self).create(vals)
|
||||
|
|
@ -2025,7 +2028,7 @@ class GrantBenefitProfile(models.Model):
|
|||
})
|
||||
user = self.env['res.users'].sudo().with_context(no_reset_password=True).create({
|
||||
'name': self.name,
|
||||
'login': self.email or self.sms_phone,
|
||||
'login': self.sms_phone or self.email,
|
||||
'partner_id': self.partner_id.id,
|
||||
'active': True
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1194,7 +1194,8 @@
|
|||
readonly="1" force_save="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="request_producer_id"/>
|
||||
<!-- <field name="request_producer_id"/> -->
|
||||
<field name="applicant_name"/>
|
||||
<field name="request_producer" readonly="1" force_save="1" invisible="1"/>
|
||||
<field name="request_producer_relation"
|
||||
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue