|
6 | 6 |
|
7 | 7 | from psycopg2 import OperationalError |
8 | 8 |
|
9 | | -from odoo import api, exceptions, fields, models |
| 9 | +from odoo import _, api, exceptions, fields, models |
10 | 10 | from odoo.tools.safe_eval import safe_eval |
11 | 11 |
|
12 | 12 | from odoo.addons.queue_job.delay import chain |
@@ -257,26 +257,23 @@ def action_generate_labels(self): |
257 | 257 |
|
258 | 258 | job_ids = batch_summary.job_ids.ids |
259 | 259 |
|
260 | | - if len(job_ids) == 1: |
261 | | - return { |
262 | | - "type": "ir.actions.act_window", |
263 | | - "name": "Job Detail", |
264 | | - "res_model": "queue.job", |
265 | | - "view_mode": "form", |
266 | | - "res_id": job_ids[0], |
267 | | - "context": self.env.context, |
268 | | - "target": "new", |
269 | | - } |
270 | | - elif len(job_ids) > 1: |
271 | | - return { |
272 | | - "type": "ir.actions.act_window", |
273 | | - "name": "Summary Jobs", |
274 | | - "res_model": "queue.job", |
275 | | - "view_mode": "list", |
276 | | - "domain": [("id", "in", job_ids)], |
277 | | - "context": self.env.context, |
278 | | - "target": "new", |
279 | | - } |
| 260 | + return { |
| 261 | + "type": "ir.actions.client", |
| 262 | + "tag": "display_notification", |
| 263 | + "params": { |
| 264 | + "title": _("Label generation"), |
| 265 | + "message": _( |
| 266 | + """%s job(s) have been created for label generation. |
| 267 | + Labels will be available as soon as those jobs are finished.""" |
| 268 | + ) |
| 269 | + % (len(job_ids),), |
| 270 | + "type": "warning", |
| 271 | + "next": { |
| 272 | + "type": "ir.actions.client", |
| 273 | + "tag": "soft_reload", |
| 274 | + }, |
| 275 | + }, |
| 276 | + } |
280 | 277 |
|
281 | 278 | @api.model |
282 | 279 | def _group_labels_by_file_type(self, labels): |
|
0 commit comments