-
-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Portal Email Readonly, pre-commit changes
- Loading branch information
kumarinie
committed
Sep 10, 2024
1 parent
4c426c9
commit a0bdf65
Showing
2 changed files
with
30 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
<odoo> | ||
<data> | ||
<template id="portal_email_readonly" inherit_id="portal.portal_my_details"> | ||
<xpath expr="//div[contains(@t-attf-class, 'email')]" position="replace"> | ||
<t t-set="partner_can_edit_email" t-value="partner.can_edit_email()" /> | ||
<t | ||
|
||
<xpath | ||
expr="//div[contains(@t-attf-class, 'email')]/input[@name='email']" | ||
position="attributes" | ||
> | ||
<attribute name="t-att-style">'display: none;'</attribute> | ||
</xpath> | ||
<xpath | ||
expr="//div[contains(@t-attf-class, 'email')]/label[@for='email']" | ||
position="after" | ||
> | ||
<t t-set="partner_can_edit_email" t-value="partner.can_edit_email()" /> | ||
<t | ||
t-set="email_not_editable_message" | ||
>You cannot change the email address. Please create a new contact person.</t> | ||
<div | ||
t-attf-class="form-group #{error.get('email') and 'o_has_error' or ''} col-xl-6" | ||
> | ||
<label class="col-form-label" for="email">Email</label> | ||
<input | ||
type="email" | ||
name="email" | ||
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}" | ||
t-att-value="email or partner.email" | ||
t-att-readonly="None if partner_can_edit_email else '1'" | ||
t-att-title="None if partner_can_edit_email else email_not_editable_message" | ||
/> | ||
</div> | ||
</xpath> | ||
<input | ||
type="email" | ||
name="email" | ||
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}" | ||
t-att-value="email or partner.email" | ||
t-att-readonly="None if partner_can_edit_email else '1'" | ||
t-att-title="None if partner_can_edit_email else email_not_editable_message" | ||
/> | ||
</xpath> | ||
</template> | ||
</data> | ||
</odoo> |