Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG][11.0] Migrate base_report_to_printer #109

Closed

Conversation

Garamotte
Copy link

Migration of the base_report_to_printer module to v11.0 (currently tested on master as the 11.0 branch has not already been created on Odoo's repo).

eLBati and others added 30 commits October 3, 2017 18:05
…t: because if an exception occurs,

a postgresql transaction will be leaked.
The except clause should properly rollback the cr
replaced by isinstance(printer, basestring)
…nd orm.TransientModel instead of osv aliases
@pedrobaeza pedrobaeza added this to the 11.0 milestone Oct 31, 2017
@gdgellatly
Copy link
Contributor

@sylvain-garancher et al, lets work to get this done. If you are busy I can take over. I think its nearly there.

@Garamotte
Copy link
Author

Yes, sorry, I'm very busy at the moment...
You can fix the latest things discussed here in your PR that merges printer_tray into base_report_to_printer, and I'll close this one.

@gdgellatly
Copy link
Contributor

@sylvain-garancher I missed this, anyway I was just doing something else and I noticed they refactored the web client post release, so the js is going to need to change now anyway as there is no more web.Model

@gdgellatly
Copy link
Contributor

@lasley Can I ask you for a quick bit of help please. In this module we had a javascript call to select the action, either print or send to client. With changes to the web client it is no longer valid and I can't work out how it needs to be changed to still work. Do you know how to call a models method in 11.0 web client?

@lasley
Copy link
Contributor

lasley commented Dec 5, 2017

@gdgellatly - Sure, can you point me to the old code we're trying to replace?


if ('report_type' in action_val && action_val.report_type === 'qweb-pdf') {
framework.blockUI();
new Model('ir.actions.report').
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gdgellatly Is this what we're replacing?

@gdgellatly
Copy link
Contributor

@lasley Yes,

web.Model no longer exists, I tried a straight swap with Basic and Abstract but no dice. The call method fails so I'm guessing its a bit more complicated than that. When I debug it, I see that the args are being passed as the main arguments, instead of the method and method args.

@lasley
Copy link
Contributor

lasley commented Dec 6, 2017

@gdgellatly - sweet thanks for the elaboration. And when you say you used the basic and abstract, you're referring to web.BasicModel?

From what I understand, the models just allow for the basic CRUD operations. You've honestly got me if there is a new entrypoint for any method call, but I think an easy solution here would just be to use RPC directly instead:

var rpc = require('web.rpc');
...
rpc.query({
    model: 'ir.actions.report',
    method: 'print_action_for_report_name',
    args: [action_val.report_name]
}).then(...

@gdgellatly
Copy link
Contributor

@lasley Thanks. Yes its quite different now and completely undocumented and I never really understood the last one, so not having fun. I'm going with what you did. That was very close to my hackish attempts.

@lasley
Copy link
Contributor

lasley commented Dec 6, 2017

If I understand correctly, things would be different if we actually had a record to attach to. I haven't actually tried it, but I feel like you can require('web.BasicModel').get(id).a_method(arg1, arg2)

@gdgellatly
Copy link
Contributor

@lasley thanks it worked, I've done up the outstanding details of this PR and done a full review and pushed to #110 as a single PR

@Garamotte
Copy link
Author

I close this PR to avoid splitting the conversations :)
Superseded by #110

@Garamotte Garamotte closed this Dec 6, 2017
gdgellatly added a commit to odoonz/report-print-send that referenced this pull request Jan 30, 2019
Migration of printer_tray to v11 and integration with base_report_to_printer
gdgellatly added a commit to odoonz/report-print-send that referenced this pull request May 12, 2019
Migration of printer_tray to v11 and integration with base_report_to_printer
gdgellatly added a commit to odoonz/report-print-send that referenced this pull request May 12, 2019
Migration of printer_tray to v11 and integration with base_report_to_printer
schout-it pushed a commit to schout-it/report-print-send that referenced this pull request Sep 30, 2019
Migration of printer_tray to v11 and integration with base_report_to_printer
schout-it pushed a commit to schout-it/report-print-send that referenced this pull request Oct 14, 2019
Migration of printer_tray to v11 and integration with base_report_to_printer
AaronHForgeFlow pushed a commit to ForgeFlow/report-print-send that referenced this pull request Apr 15, 2020
Migration of printer_tray to v11 and integration with base_report_to_printer
hildickethan-S73 pushed a commit to Studio73/report-print-send that referenced this pull request Oct 15, 2020
Migration of printer_tray to v11 and integration with base_report_to_printer
alexis-via pushed a commit to akretion/report-print-send that referenced this pull request Dec 15, 2020
Migration of printer_tray to v11 and integration with base_report_to_printer
CarlosRoca13 pushed a commit to Tecnativa/report-print-send that referenced this pull request Dec 22, 2020
Migration of printer_tray to v11 and integration with base_report_to_printer
CarlosRoca13 pushed a commit to Tecnativa/report-print-send that referenced this pull request Jan 11, 2021
Migration of printer_tray to v11 and integration with base_report_to_printer
CarlosRoca13 pushed a commit to Tecnativa/report-print-send that referenced this pull request Jan 12, 2021
Migration of printer_tray to v11 and integration with base_report_to_printer
BT-dmontull pushed a commit to BT-dmontull/report-print-send that referenced this pull request Mar 3, 2022
Migration of printer_tray to v11 and integration with base_report_to_printer
flachica pushed a commit to flachica/report-print-send that referenced this pull request Oct 1, 2022
Migration of printer_tray to v11 and integration with base_report_to_printer
glitchov pushed a commit to acsone/report-print-send that referenced this pull request Dec 7, 2022
Migration of printer_tray to v11 and integration with base_report_to_printer
john-herholz-dt pushed a commit to DeineTuer-GmbH/OCA_report-print-send that referenced this pull request Jan 17, 2024
Migration of printer_tray to v11 and integration with base_report_to_printer
john-herholz-dt pushed a commit to DeineTuer-GmbH/OCA_report-print-send that referenced this pull request Mar 8, 2024
Migration of printer_tray to v11 and integration with base_report_to_printer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet