26 lines
885 B
Python
26 lines
885 B
Python
# -*- coding: utf-8 -*-
|
|
from odoo import api, fields, models, tools, _
|
|
from datetime import datetime, time, timedelta
|
|
from odoo.exceptions import UserError
|
|
|
|
|
|
class WifiMessage(models.Model):
|
|
_name = 'wifi.message'
|
|
_description = 'wifi名称管理'
|
|
_order = 'mac asc'
|
|
|
|
mac_ids = fields.Many2many('mac.line', 'wifi_id', string='MAC地址')
|
|
mac = fields.Char(string='MAC地址')
|
|
name = fields.Char(string='详细地址')
|
|
bssid = fields.Char(string='BSSID')
|
|
create_time = fields.Date(string='创建日期', default=lambda self: fields.Date.today())
|
|
company_id = fields.Many2one("res.company", string="公司", default=lambda self: self.env.company)
|
|
|
|
|
|
class MacLine(models.Model):
|
|
_name = 'mac.line'
|
|
_description = 'mac地址管理'
|
|
|
|
mac = fields.Char(string='名称')
|
|
wifi_id = fields.Many2one('wifi.message', string='关联wifi名称')
|