mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-22 06:52:00 +02:00
Initial commit: Core packages
This commit is contained in:
commit
12c29a983b
9512 changed files with 8379910 additions and 0 deletions
|
|
@ -0,0 +1,64 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { registerPatch } from '@mail/model/model_core';
|
||||
|
||||
registerPatch({
|
||||
name: 'Message',
|
||||
recordMethods: {
|
||||
/**
|
||||
* Cancels the 'snailmail.letter' corresponding to this message.
|
||||
*
|
||||
* @returns {Deferred}
|
||||
*/
|
||||
async cancelLetter() {
|
||||
// the result will come from the bus: message_notification_update
|
||||
await this.messaging.rpc({
|
||||
model: 'mail.message',
|
||||
method: 'cancel_letter',
|
||||
args: [[this.id]],
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Opens the action about 'snailmail.letter' format error.
|
||||
*/
|
||||
openFormatLetterAction() {
|
||||
this.env.services.action.doAction(
|
||||
'snailmail.snailmail_letter_format_error_action',
|
||||
{
|
||||
additionalContext: {
|
||||
message_id: this.id,
|
||||
},
|
||||
},
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Opens the action about 'snailmail.letter' missing fields.
|
||||
*/
|
||||
async openMissingFieldsLetterAction() {
|
||||
const letterIds = await this.messaging.rpc({
|
||||
model: 'snailmail.letter',
|
||||
method: 'search',
|
||||
args: [[['message_id', '=', this.id]]],
|
||||
});
|
||||
this.env.services.action.doAction(
|
||||
'snailmail.snailmail_letter_missing_required_fields_action',
|
||||
{
|
||||
additionalContext: {
|
||||
default_letter_id: letterIds[0],
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Retries to send the 'snailmail.letter' corresponding to this message.
|
||||
*/
|
||||
async resendLetter() {
|
||||
// the result will come from the bus: message_notification_update
|
||||
await this.messaging.rpc({
|
||||
model: 'mail.message',
|
||||
method: 'send_letter',
|
||||
args: [[this.id]],
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue