调整打印机模型结构

This commit is contained in:
mgw
2024-03-20 17:32:17 +08:00
parent c788392b36
commit ba79b358a9
5 changed files with 100 additions and 22 deletions

View File

@@ -1,12 +1,28 @@
from odoo import models, fields
class Printer(models.Model):
_name = 'printer'
_description = 'Printer'
name = fields.Char(string='名称', required=True)
ip_address = fields.Char(string='IP 地址', required=True)
port = fields.Integer(string='端口', default=9100)
class TableStyle(models.Model):
_name = 'table.style'
_description = '标签样式'
name = fields.Char(string='名称', required=True)
# todo
class PrinterConfiguration(models.Model):
_name = 'printer.configuration'
_description = 'Printer Configuration'
name = fields.Char(string='名称', required=True)
ip_address = fields.Char(string='IP 地址', required=True)
port = fields.Integer(string='端口', default=9100)
printer_id = fields.Many2one('printer', string='打印机')
model = fields.Many2one('ir.model', string='模型名称')
# 其他相关字段...
# # 其他相关字段...