OCA/base_report_to_printer 配置Odoo云打印

news/2025/3/11 10:34:10/文章来源:https://www.cnblogs.com/xtanuiha/p/18224437

系统结构

安装部署

Odoo

安装模块依赖pip install pycups
安装OCA模块report-print-send/base_report_to_printer

cups

cups简介

CUPS(Common UNIX Printing System)是一个开源的打印系统,用于在 Unix-like 操作系统上管理打印任务。它提供了打印机驱动程序、打印队列管理、打印作业控制等功能,使得用户可以轻松地添加和管理打印机,以及打印文档。

CUPS 最初由 Easy Software Products 开发,后来由 Apple 接手并开源,现在由开源社区维护。它是一个符合 IPP(Internet Printing Protocol)标准的打印系统,这意味着它支持网络打印和打印机共享。

CUPS 的主要特点包括:

  • IPP 支持:CUPS 支持 IPP,这是一个用于网络打印的标准协议,允许客户端通过网络发送打印作业给打印服务器。
  • 打印队列管理:CUPS 允许用户创建和管理打印队列,每个打印队列可以对应一个或多个打印机。
  • 打印机驱动支持:CUPS 支持多种打印机驱动,包括 PostScript 和 PCL 等。它还支持将打印机映射到其他网络打印机上。
  • 打印机共享:CUPS 允许用户共享打印机,使得网络上的其他用户可以访问和打印。
  • 认证和权限控制:CUPS 支持用户认证和权限控制,可以限制哪些用户可以访问特定的打印机。
  • 兼容性:CUPS 设计为与现有的打印系统(如 LPD、LPRng、BSD 打印系统等)兼容,同时提供了更好的打印管理功能。

以上内容由AI生成

cups的安装方式比较灵活,安装在能够连接到打印机的环境中即可(物理机,虚拟机,容器,树霉派等均可)
我们选择使用容器来部署运行

docker-compose.yml

version: "3"services:# The admin user/password for the Cups server is print/printcupsd:image: olbat/cupsdcontainer_name: cupsdports:- "631:631"volumes:- /var/run/dbus:/var/run/dbus- ./cupsd.conf:/etc/cups/cupsd.conf

cupsd.conf

#
# Configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
## Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn
PageLogFormat# Specifies the maximum size of the log files before they are rotated.  The value "0" disables log rotation.
MaxLogSize 0# Default error policy for printers
ErrorPolicy retry-job# Allow remote access
Listen *:631# Show shared printers on the local network.
Browsing Yes
BrowseLocalProtocols dnssd# Default authentication type, when authentication is required...
DefaultAuthType Basic
DefaultEncryption IfRequested# Web interface setting...
WebInterface Yes# Timeout after cupsd exits if idle (applied only if cupsd runs on-demand - with -l)
IdleExitTimeout 60# Restrict access to the server...
<Location />Order allow,denyAllow all
</Location># Restrict access to the admin pages...
<Location /admin>Order allow,denyAllow all
</Location># Restrict access to configuration files...
<Location /admin/conf>AuthType DefaultRequire user @SYSTEMOrder allow,denyAllow all
</Location># Restrict access to log files...
<Location /admin/log>AuthType DefaultRequire user @SYSTEMOrder allow,denyAllow all
</Location># Set the default printer/job policies...
<Policy default># Job/subscription privacy...JobPrivateAccess defaultJobPrivateValues defaultSubscriptionPrivateAccess defaultSubscriptionPrivateValues default# Job-related operations must be done by the owner or an administrator...<Limit Create-Job Print-Job Print-URI Validate-Job>Order deny,allow</Limit><Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>Require user @OWNER @SYSTEMOrder deny,allow</Limit># All administration operations require an administrator to authenticate...<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>AuthType DefaultRequire user @SYSTEMOrder deny,allow</Limit># All printer operations require a printer operator to authenticate...<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>AuthType DefaultRequire user @SYSTEMOrder deny,allow</Limit># Only the owner or an administrator can cancel or authenticate a job...<Limit Cancel-Job CUPS-Authenticate-Job>Require user @OWNER @SYSTEMOrder deny,allow</Limit><Limit All>Order deny,allow</Limit>
</Policy># Set the authenticated printer/job policies...
<Policy authenticated># Job/subscription privacy...JobPrivateAccess defaultJobPrivateValues defaultSubscriptionPrivateAccess defaultSubscriptionPrivateValues default# Job-related operations must be done by the owner or an administrator...<Limit Create-Job Print-Job Print-URI Validate-Job>AuthType DefaultOrder deny,allow</Limit><Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>AuthType DefaultRequire user @OWNER @SYSTEMOrder deny,allow</Limit># All administration operations require an administrator to authenticate...<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>AuthType DefaultRequire user @SYSTEMOrder deny,allow</Limit># All printer operations require a printer operator to authenticate...<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>AuthType DefaultRequire user @SYSTEMOrder deny,allow</Limit># Only the owner or an administrator can cancel or authenticate a job...<Limit Cancel-Job CUPS-Authenticate-Job>AuthType DefaultRequire user @OWNER @SYSTEMOrder deny,allow</Limit><Limit All>Order deny,allow</Limit>
</Policy># Set the kerberized printer/job policies...
<Policy kerberos># Job/subscription privacy...JobPrivateAccess defaultJobPrivateValues defaultSubscriptionPrivateAccess defaultSubscriptionPrivateValues default# Job-related operations must be done by the owner or an administrator...<Limit Create-Job Print-Job Print-URI Validate-Job>AuthType NegotiateOrder deny,allow</Limit><Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>AuthType NegotiateRequire user @OWNER @SYSTEMOrder deny,allow</Limit># All administration operations require an administrator to authenticate...<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>AuthType DefaultRequire user @SYSTEMOrder deny,allow</Limit># All printer operations require a printer operator to authenticate...<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>AuthType DefaultRequire user @SYSTEMOrder deny,allow</Limit># Only the owner or an administrator can cancel or authenticate a job...<Limit Cancel-Job CUPS-Authenticate-Job>AuthType NegotiateRequire user @OWNER @SYSTEMOrder deny,allow</Limit><Limit All>Order deny,allow</Limit>
</Policy>

配置

cups

在浏览器输入http://cups-ip:631/进入cups管理页面

进入Administration页面根据提示添加打印机,这里可能会碰到各种不同品牌打印机驱动的问题,需要多方尝试与搜索解决。

Odoo

安装base_report_to_printer模块之后,系统设置中会增加Printing菜单

在Servers菜单下添加打印服务器,地址与端口均为cups服务相应的配置;
配置好服务器信息后点击Update Printers更新打印机列表。

以上操作如无异常,服务器下方会出来打印机列表,可点开一个打印机进行打印页测试。

参考

https://github.com/OCA/report-print-send/tree/17.0

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/721326.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

2024 Web 新特性 - 使用 Popover API 创建弹窗

Popover API 为开发者提供了一种声明式的方式来创建各种类型的弹窗。目前已在所有三大浏览器引擎中可用,并正式成为 Baseline 2024 的一部分。Popover API 为开发者提供了一种声明式的方式来创建各种类型的弹窗。目前已在所有三大浏览器引擎中可用,并正式成为 Baseline 2024 …

ubuntu 16.8升级nodejs

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - $node --version v16.20.2

lodash已死?radash库方法介绍及源码解析 —— 判断方法篇

目前为止,radash库的所有方法我们已经分享完毕。如果你想尝试使用,又或者想了解下源码,阿瓜的文章都值得一读,相信你总能有所收获。后续我们回整理一份使用说明进行发布。前言 大家好,我是阿瓜。一个励志分享更多技术的前端瓜 ~ 我们已经分享了 radash 库中数组、对象等相…

PyCharm的安装

PyCharm的安装 PyCharm是一款由JetBrains公司开发的强大的Python集成开发环境(IDE),它提供了代码分析、图形化调试器、集成单元测试、版本控制等功能,极大地提高了Python开发者的工作效率。以下是PyCharm社区版的详细安装步骤。 一、下载PyCharm安装包 首先,我们需要访问P…

allure安装配置使用 简单版

环境安装 一、安装配置JDK 先检查是否安装JDK,cmd中查看java版本:java -version若未安装,以下面的步骤安装: 1、Oracle官网下载JDK:https://www.oracle.com/java/technologies/downloads/,请下载安装JDK8及以上版本 2、安装JDK 3、JDK配置环境变量:win10系统右击“我的电…

dubbo~全局异常拦截器的使用与设计缺陷

异常拦截器ExceptionMapper 在JAX-RS(Java API for RESTful Web Services)中,ExceptionMapper接口用于将Java异常映射到HTTP响应。通过实现ExceptionMapper接口,你可以自定义如何处理特定类型的异常,并生成相应的HTTP响应。 优先级和选择 当有多个ExceptionMapper可用于处…

RPC--远程过程调用协议

简单介绍一下RPC什么是RPC? RPC的全称是:Remote Procedure Call,远程过程调用。它的作用就是允许一台机器上的程序去调用另一台机器上的程序,而不会意识到这个过程是远程的,也就是程序员不需要知道网络通信中的任何细节。 为什么要使用RPC?提高开发效率:程序员不需要再关…

echarts 曲线中显示最大值进行标签样式的设置和修改

曲线中最大值最小值需要完善一些相关的信息 let color = [ #ee6666, #73c0de, #3ba272, #fc8452, #9a60b4, #ea7ccc] let xData =[00:00, 04:00, 08:00, 12:00, 16:00, 20:00, 24:00] //item 是循环的后台返回的数据,用来构造有几条曲线 //关键代码还是markPoint中的内容 data…

终于搞懂了!原来vue3中template使用ref无需.value是因为这个

前言 众所周知,vue3的template中使用ref变量无需使用.value。还可以在事件处理器中进行赋值操作时,无需使用.value就可以直接修改ref变量的值,比如:<button @click="msg = Hello Vue3">change msg</button>。你猜vue是在编译时就已经在代码中生成了.…

用 Python 撸一个 Web 服务器-第2章:Hello World

从一个 Hello World 程序说起 要编写 Web 服务器,需要用到一个 Python 内置库 socket。Socket 是一个比较抽象的概念,中文叫套接字,它代表一个网络连接。两台计算机之间要进行通讯,大概分为三个步骤:建立连接,传输数据,关闭连接。而 socket 库为我们提供了这个能力。 按…

go pool

来自: sync.Pool 原理 sync.Pool 核心对象有三个New:函数,负责对象初始化 Get:获取 Pool 中的对象,如果 Pool 中对象不存在则会调用 New Put:将对象放入 Pool 中New func Pool 的结构很简单,就 5 个字段 type Pool struct { ... New func() interface{} }字段 New 是…

CSP历年复赛题-P2119 [NOIP2016 普及组] 魔法阵

原题链接:https://www.luogu.com.cn/problem/P2119 题意解读:在一组数里找出所有的Xa,Xb,Xc,Xd的组合,使得满足Xa<Xb<Xc<Xd, Xb-Xa=2(Xd-Xc), Xb-Xa<(Xc-Xb)/3,并统计出每个数作为A,B,C,D出现的次数。 解题思路: 1、枚举(O(n^4)) 首先想到的是通过4重循环枚…