首页 > 其他分享 >OCA/base_report_to_printer 配置Odoo云打印

OCA/base_report_to_printer 配置Odoo云打印

时间:2024-06-07 11:34:07浏览次数:20  
标签:... deny printer OCA 打印机 base user allow Order

系统结构

安装部署

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/print
  cupsd:
    image: olbat/cupsd
    container_name: cupsd
    ports:
      - "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,deny
  Allow all
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow all
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all
</Location>

# Restrict access to log files...
<Location /admin/log>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all
</Location>

# Set the default printer/job policies...
<Policy default>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues 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 @SYSTEM
    Order 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 Default
    Require user @SYSTEM
    Order 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 Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

# Set the authenticated printer/job policies...
<Policy authenticated>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    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>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order 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 Default
    Require user @SYSTEM
    Order 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 Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

# Set the kerberized printer/job policies...
<Policy kerberos>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Negotiate
    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>
    AuthType Negotiate
    Require user @OWNER @SYSTEM
    Order 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 Default
    Require user @SYSTEM
    Order 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 Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Negotiate
    Require user @OWNER @SYSTEM
    Order 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

标签:...,deny,printer,OCA,打印机,base,user,allow,Order
From: https://www.cnblogs.com/xtanuiha/p/18224437

相关文章

  • Unity DOTS技术(十一) SystemBase详解
    文章目录一.什么是SystemBase二.SystemBase的生命周期三.继承实现四.操控的依据五.组件筛选的限制六.组件监听七.共享组件筛选八.存储筛选结果九.过滤标识组件十.线程操作十一.线程名称修改十二.Burst编译器开关一.什么是SystemBase在之前的分享中我们用到的系统父......
  • 提取PAD LOCATION 坐标
    hiSetBindKey("Layout""F9""smpGUIPadExtract()")procedure(smpGUIPadExtract()let(() padlayerName=hiCreateStringField( ?name`padlayerName ?prompt"LayerName" ) padlayerPpos=hiCreateStringF......
  • codeforces 1442 D Codeforces Round 681 (Div. 1, based on VK Cup 2019-2020 - Fina
    链接大意就是给你n组物品,这n组物品里面每组有\(t_i\)个,且他们是按照价值不降的顺序排列的。现在允许取k个物品,每个物品必须取在数组的开头处,每个物品在被取用后就会消失。问你最大能够拿到多少价值的物品。其中\(n,k\leq1500,\sumt_i\leq1e6,a_i\leq1e8\)很背包吧。可......
  • LocalStorage页面级UI状态存储、将LocalStorage实例从UIAbility共享到一个或多个视图
    参考:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V2/arkts-localstorage-0000001524537149-V2#section13961833151713此处代码只精简了需要的importwindowfrom'@ohos.window';exportdefaultclassEntryAbilityextendsUIAbility{//共享LocalSto......
  • 记录--localStorage是同步还是异步的?为什么?
    ......
  • Ollama,在centos7宿主机上,curl http://宿主机IP:11434 提示拒绝访问 ,但是curl http://l
    Ollama,在centos7宿主机上,curlhttp://宿主机IP:11434提示拒绝访问,但是curlhttp://localhost:11434 正常 1.使用 netstat 或 ss 命令在宿主机上检查 11434 端口的状态[root@localhost~]#netstat-tulnp|grep11434tcp00127.0.0.1:11434......
  • ByteBase安装使用
    1.准备工作mkdir-p/home/bizuser/soft/bytebase/data2.镜像下载dockerpullbytebase/bytebase3.容器启动启动一:dockerrun--init\--namebytebase-test\--publish8080:8080--pullalways\--volume/home/bizuser/soft/bytebase/data:/var/opt/byteba......
  • 重写学习 localStorage 与 sessionStorage
    localStorage与sessionStoragelocalStorage与sessionStorage很多小伙伴对它们俩都很熟悉了;最熟悉的莫过下面这2条1,localStorage存储的数据没有时间限制,理论上永久有效;除非手动清除。sessionStorage存储的数据在关闭当前页面后失效;2,有存储大小限制,两者存储大......
  • git 提交时未触发 Firebase 应用程序托管的推出
    我尝试在现有项目上配置新的应用程序托管服务。除了在配置的Git仓库中出现新提交时无法触发推出之外,其他一切正常。Firebase应用程序托管似乎已安装在GitHub仓库中。我怀疑这是一个地区的问题,因为我安装的项目位于us-east1(据我所知,目前只支持us-central1)。我不......
  • EasyMocap Demo 运行&理解
    安装环境与依赖OpenPoseonLinuxMint21.3(Ubuntu22.04)https://github.com/AClon314/tauri-vuetify-learn/blob/c57c203a27eadd4a39142002fb61230bf750d6d4/src-tauri/capabilities/mobile.json#L31C5-L38C7装好了pytorch,cuda,cuDnn,还需要手动编译Openpose,卡在了make-j8,......