Files
test/sf_base/commons/Printer.py

30 lines
888 B
Python

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)
type = fields.Selection([('zpl', 'ZPL'), ('normal', '普通')], string='类型', default='zpl')
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)
printer_id = fields.Many2one('printer', string='打印机')
model = fields.Many2one('ir.model', string='模型名称')
# # 其他相关字段...