-
-
Notifications
You must be signed in to change notification settings - Fork 791
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] report_py3o: Migration to 15.0
- Loading branch information
1 parent
2e0aedf
commit 12edc1e
Showing
13 changed files
with
86 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ addons: | |
apt: | ||
packages: | ||
- expect-dev # provides unbuffer utility | ||
- "libreoffice" | ||
|
||
stages: | ||
- test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,13 @@ Py3o Report Engine | |
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github | ||
:target: https://github.com/OCA/reporting-engine/tree/14.0/report_py3o | ||
:target: https://github.com/OCA/reporting-engine/tree/15.0/report_py3o | ||
:alt: OCA/reporting-engine | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-report_py3o | ||
:target: https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_py3o | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/143/14.0 | ||
:target: https://runbot.odoo-community.org/runbot/143/15.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
@@ -203,7 +203,7 @@ Bug Tracker | |
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_py3o%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_py3o%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
|
@@ -225,6 +225,7 @@ Contributors | |
* Guewen Baconnier <[email protected]> | ||
* Omar Castiñeira <[email protected]> | ||
* Holger Brunn <[email protected]> | ||
* Phuc Tran Thanh <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
@@ -239,6 +240,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose | |
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/14.0/report_py3o>`_ project on GitHub. | ||
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/15.0/report_py3o>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
* Guewen Baconnier <[email protected]> | ||
* Omar Castiñeira <[email protected]> | ||
* Holger Brunn <[email protected]> | ||
* Phuc Tran Thanh <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** @odoo-module **/ | ||
|
||
import {download} from "@web/core/network/download"; | ||
import {registry} from "@web/core/registry"; | ||
|
||
registry | ||
.category("ir.actions.report handlers") | ||
.add("py3o_handler", async function (action, options, env) { | ||
if (action.report_type === "py3o") { | ||
let url = `/report/py3o/${action.report_name}`; | ||
const actionContext = action.context || {}; | ||
if ( | ||
_.isUndefined(action.data) || | ||
_.isNull(action.data) || | ||
(_.isObject(action.data) && _.isEmpty(action.data)) | ||
) { | ||
// Build a query string with `action.data` (it's the place where reports | ||
// using a wizard to customize the output traditionally put their options) | ||
if (actionContext.active_ids) { | ||
var activeIDsPath = "/" + actionContext.active_ids.join(","); | ||
url += activeIDsPath; | ||
} | ||
} else { | ||
var serializedOptionsPath = | ||
"?options=" + encodeURIComponent(JSON.stringify(action.data)); | ||
serializedOptionsPath += | ||
"&context=" + encodeURIComponent(JSON.stringify(actionContext)); | ||
url += serializedOptionsPath; | ||
} | ||
env.services.ui.block(); | ||
try { | ||
await download({ | ||
url: "/report/download", | ||
data: { | ||
data: JSON.stringify([url, action.report_type]), | ||
context: JSON.stringify(env.services.user.context), | ||
}, | ||
}); | ||
} finally { | ||
env.services.ui.unblock(); | ||
} | ||
const onClose = options.onClose; | ||
if (action.close_on_report_download) { | ||
return env.services.action.doAction( | ||
{type: "ir.actions.act_window_close"}, | ||
{onClose} | ||
); | ||
} else if (onClose) { | ||
onClose(); | ||
} | ||
return Promise.resolve(true); | ||
} | ||
return Promise.resolve(false); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.