[IMP] mail: voip refactoring

Adds useful fields to models needed for VoIP to work.

closes odoo/odoo#115689

Related: odoo/enterprise#38339
Related: odoo/upgrade#5021
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This commit is contained in:
Louis Wicket (wil)
2023-10-10 01:59:33 +00:00
parent daf05d48ac
commit a9ca779a1f
3 changed files with 13 additions and 1 deletions
@@ -45,6 +45,10 @@ export class Persona extends Record {
id;
/** @type {boolean | undefined} */
is_company;
/** @type {string} */
landlineNumber;
/** @type {string} */
mobileNumber;
/** @type {'partner' | 'guest'} */
type;
/** @type {string} */
@@ -61,6 +65,13 @@ export class Persona extends Record {
im_status;
isAdmin = false;
/**
* @returns {boolean}
*/
get hasPhoneNumber() {
return Boolean(this.mobileNumber || this.landlineNumber);
}
get nameOrDisplayName() {
return this.name || this.displayName;
}
+1 -1
View File
@@ -39,7 +39,7 @@
</table>
</div>
<div t-if="activity.note" class="o-mail-Activity-note text-break" t-out="activity.note"/>
<div t-if="activity.mail_template_ids.length > 0" class="o-mail-Activity-mailTemplates">
<div t-if="activity.mail_template_ids?.length > 0" class="o-mail-Activity-mailTemplates">
<ActivityMailTemplate activity="activity" onUpdate="props.onUpdate"/>
</div>
<div t-if="activity.can_write" class="lh-lg">
@@ -120,6 +120,7 @@ insertModelFields("res.users.settings", {
insertRecords("mail.activity.type", [
{ icon: "fa-envelope", id: 1, name: "Email" },
{ icon: "fa-phone", id: 2, name: "Call", category: "phonecall" },
{ icon: "fa-upload", id: 28, name: "Upload Document" },
]);
insertRecords("mail.message.subtype", [