[FIX] support for attachment to record

This commit is contained in:
KKamaa
2022-08-26 11:49:40 +03:00
parent 65e4a41a89
commit cb5bbcff6a
3 changed files with 44 additions and 1 deletions

View File

@@ -46,6 +46,9 @@ odoo.define("report_async.ActionMenus", function (require) {
const is_report_async = this.$(
"#async_report_checker"
).prop("checked");
const save_report_attachment = this.$(
"#async-save-report-checker"
).prop("checked");
const user_email = this.$("#async-user-email").val();
if (user_email !== "" && is_report_async) {
// Try basic email validation
@@ -64,6 +67,7 @@ odoo.define("report_async.ActionMenus", function (require) {
to_email: user_email,
data: action.data || {},
context: action.context || {},
save_attachment_to_records: save_report_attachment
},
})
.then(() => {

View File

@@ -20,6 +20,26 @@
via queue job and sent to a below email address.
</small>
</div>
<!-- Allow saving of attachment to record -->
<div class="form-group">
<div class="form-check">
<input
type="checkbox"
class="form-check-input"
checked="checked"
id="async-save-report-checker"
/>
<label class="form-check-label"
for="async-save-report-checker">
Save attachment to records
</label>
</div>
<small id="async-save-report-checker-help"
class="form-text text-muted">
Checker enables async report attachment to be created and
saved to the records. NB: Records should support attachments
</small>
</div>
<!-- Email Input -->
<div class="form-group">
<label for="async-user-email">Email Address</label>