[19.0][ADD] base_report_to_printer_websocket#448
[19.0][ADD] base_report_to_printer_websocket#448DavidJForgeFlow wants to merge 5 commits intoOCA:19.0from
Conversation
74d0f3d to
67c0781
Compare
etobella
left a comment
There was a problem hiding this comment.
Please, do the assignation through channels by using specific users. You might do something like: user id in the system, this way it is cleaner. (if you want several systems, you might one user for each system)
| "base_report_to_printer.printing_group_user" | ||
| ) | ||
| if not is_printing_user: | ||
| channels = [ch for ch in channels if ch not in ws_channels] |
There was a problem hiding this comment.
you should attach the channels and use the printers
| .mapped("websocket_channel") | ||
| ) | ||
| is_printing_user = self.env.uid and self.env.user.has_group( | ||
| "base_report_to_printer.printing_group_user" |
There was a problem hiding this comment.
If you have 2 users with this group, everything will be crazy.
| selection_add=[("websocket", "WebSocket")], | ||
| ondelete={"websocket": "cascade"}, | ||
| ) | ||
| websocket_channel = fields.Char( |
There was a problem hiding this comment.
don't force channels this way... it is better to assign users
etobella
left a comment
There was a problem hiding this comment.
some minor comments
In general looks good 😄
| "file_type": doc_format, | ||
| } | ||
| self.env["bus.bus"]._sendone(self, "print_job", payload) | ||
| _logger.info("Print job sent via WebSocket to printer '%s'", self.name) |
| @@ -0,0 +1,16 @@ | |||
| 1. Install and configure *base_report_to_printer* as usual. | |||
There was a problem hiding this comment.
I think that installing module is not necessary part of the configuration steps, isn't it? 😆
| 3. Set the **System Name** to the name of the target printer as known by | ||
| the client-side listener (e.g. ``MFC-L3750CDW``). Leave it empty to | ||
| use the default system printer. | ||
| 4. Assign the printer as the default globally, per user, or per report |
There was a problem hiding this comment.
we should change it to include the user configuration here.
… have access to them.
0c78713 to
7f467dd
Compare
7f467dd to
b97a3a1
Compare
|
@etobella The tests and the README have been updated |
| "password": "qwerty", | ||
| } | ||
| ) | ||
| cls.demo_user = cls.env.ref("base.user_admin") |
| ppd_contents = self.build_ppd(input_slots) | ||
| with open(file_name, "w") as fp: | ||
| fp.write(ppd_contents) | ||
| if file_name: |
This module extends base_report_to_printer to send print jobs through the Odoo Bus (WebSocket) instead of a traditional print server like CUPS.
Depends on fix #447
@etobella