bemade-addons/odoo_unifi_manager/models/firewall_rule.py
xtremxpert 7783b04e73 wip
2024-12-02 15:12:08 -05:00

43 lines
965 B
Python

from odoo import models, fields, api
class FirewallRule(models.Model):
_name = 'unifi.firewall.rule'
_description = 'Unifi Firewall Rule'
name = fields.Char(
string='Rule Name',
required=True
)
action = fields.Selection(
selection=[
('accept', 'Accept'),
('drop', 'Drop')
],
string='Action',
required=True
)
src_ip = fields.Char(
string='Source IP',
help="Source IP address (can be left empty)"
)
dst_ip = fields.Char(
string='Destination IP',
help="Destination IP address (can be left empty)"
)
protocol = fields.Selection(
selection=[
('tcp', 'TCP'),
('udp', 'UDP')
],
string='Protocol',
required=True
)
port = fields.Char(
string='Port',
help="Port or port range (e.g., 80 or 8000-9000)"
)