mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] report_async 14.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
|
||||
|
||||
from odoo import models
|
||||
from odoo import fields, models
|
||||
|
||||
# Define all supported report_type
|
||||
REPORT_TYPES = ["qweb-pdf", "qweb-text", "qweb-xml", "csv", "excel", "xlsx"]
|
||||
@@ -10,6 +10,18 @@ REPORT_TYPES = ["qweb-pdf", "qweb-text", "qweb-xml", "csv", "excel", "xlsx"]
|
||||
class Report(models.Model):
|
||||
_inherit = "ir.actions.report"
|
||||
|
||||
async_report = fields.Boolean(default=False)
|
||||
async_no_records = fields.Integer(
|
||||
string="Min of Records",
|
||||
default=100,
|
||||
help="Min no of records to use async report functionality; e.g 100+",
|
||||
)
|
||||
async_mail_recipient = fields.Char(
|
||||
string="Mail Recipient",
|
||||
help="The email that will receive the async report",
|
||||
default=lambda self: self.env.user.email,
|
||||
)
|
||||
|
||||
def report_action(self, docids, data=None, config=True):
|
||||
res = super(Report, self).report_action(docids, data=data, config=config)
|
||||
if res["context"].get("async_process", False):
|
||||
|
||||
Reference in New Issue
Block a user