Changeset 16 for isp module


Ignore:
Timestamp:
Jul 15, 2011, 10:15:05 AM (13 years ago)
Author:
chronos
Message:
 
Location:
isp module
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • isp module/__init__.py

    r14 r16  
    1 # -*- coding: utf-8 -*-
     1# -*- encoding: utf-8 -*-
    22##############################################################################
    3 #
     3#   
    44#    OpenERP, Open Source Management Solution
    5 #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
     5#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
    66#
    77#    This program is free software: you can redistribute it and/or modify
     
    1616#
    1717#    You should have received a copy of the GNU Affero General Public License
    18 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
     18#    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
    1919#
    2020##############################################################################
    2121
     22import isp
     23# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
    2224
    23 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
  • isp module/__openerp__.py

    r14 r16  
    2424    'description': """This module is usable for network management for wide range of ISP.""",
    2525    'author': 'Chronos',
    26     'depends': [
     26    'website': 'http://wiki.zdechov.net/wiki/OpenERP',
     27    'depends': [ 'base_tools'
    2728                ],
    28     'init_xml': [],
    29     'update_xml': [
     29    'init_xml': [
     30     ],
     31    'update_xml': [ 'isp_view.xml', 'isp_demo.xml'
    3032                   ],
    3133    'demo_xml': [],
  • isp module/isp.py

    r14 r16  
    2323from osv import fields, osv
    2424
     25class network_address(osv.osv):
     26    _name = "network.address"
     27    _columns = {
     28        'name': fields.char('IPv4', size=15, required=True, help='IPv4 address in form nnn.nnn.nnn.nnn'),
     29        'ipv6': fields.char('IPv6', size=39, help='IPv6 address in form hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh'),
     30    }
     31network_address()
     32
    2533class network_device_type(osv.osv):
    2634    _name = "network.device.type"
     
    3745        'name': fields.char('Name', size=32, required=True),
    3846        'partner_id': fields.many2one('res.partner', 'Partner', required=True),
     47        'interface_ids': fields.one2many('network.interface', 'device_id', 'Interfaces'),
    3948        'location_partner_id': fields.many2one('res.partner', 'Location', required=True),
     49        'type_id': fields.many2one('network.device.type', 'Type', required=True),
    4050        'pos_latitude': fields.float('Position latitude'),
    41         'pos_logitude': fields.float('Position longitude'),
     51        'pos_longitude': fields.float('Position longitude'),
    4252        'used': fields.boolean('Used'),
    4353        'online': fields.boolean('Online', readonly=True, help='Network reachability state of device'),
    4454        'last_online': fields.datetime('Last online', readonly=True),
    45         'InboundNATPriority': fields.integer('Inbound NAT priority', help="If multiple device is hidden by same NATed public ip, this gives their priority and thus which device will be used for ingoing   traffic"),
     55        'inbound_nat_priority': fields.integer('Inbound NAT priority', help="If multiple device is hidden by same NATed public ip, this gives their priority and thus which device will be used for ingoing   traffic"),
    4656    }
    4757network_device()
     
    6171    _columns = {
    6272        'name': fields.char('Name', size=32),
    63         'type': fields.many2one('network.device.type', 'Type', required=True),
     73        'type_id': fields.many2one('network.interface.type', 'Type', required=True),
    6474        'mac': fields.char('MAC', size=17, help='Physical address in form XX:XX:XX:XX:XX:XX'),
    65         'local_ipv4': fields.char('Local IPv4', size=15, help='Local IPv4 address in form nnn.nnn.nnn.nnn'),
    66         'external_ipv4': fields.char('External IPv4', size=15, help='External IPv4 address in form nnn.nnn.nnn.nnn'),
    67         'local_ipv6': fields.char('Local IPv6', size=39, help='Local IPv6 address in form hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh'),
    68         'device': fields.many2one('network.device', 'Device', required=True),
     75        'local_address_id': fields.many2one('network.address', 'Local address', help='Local IPv4 address in form nnn.nnn.nnn.nnn'),
     76        'external_address_id': fields.many2one('network.address', 'External address'),
     77        'device_id': fields.many2one('network.device', 'Device', required=True),
    6978        'online': fields.boolean('Online', readonly=True, help='Network reachability state of device'),
    7079        'last_online': fields.datetime('Last online', readonly=True),
    7180    }
    7281network_interface()
     82
     83class network_domain(osv.osv):
     84    _name = "network.domain"
     85    _columns = {
     86        'name': fields.char('Name', size=32, required=True),
     87        'parent': fields.many2one('network.domain', 'Parent'),
     88        'alias': fields.char('Alias', size=32),
     89    }
     90network_domain()
     91   
     92class network_subnet(osv.osv):
     93    _name = "network.subnet"
     94    _columns = {
     95        'name': fields.char('Name', size=32, required=True),
     96        'address': fields.char('Address', size=15, required=True),
     97        'prefix': fields.integer('Prefix', required=True),
     98        'dhcp_id': fields.many2one('network.address', 'DHCP'),
     99        'gateway_id': fields.many2one('network.address', 'Default gateway'),
     100        'dns_ids': fields.many2many('network.address', 'network_subnet_dns_rel', 'subnet_id', 'address_id', 'DNS servers'),
     101        'ntp_ids': fields.many2many('network.address', 'network_subnet_ntp_rel', 'subnet_id', 'address_id',  'NTP servers'),
     102        'domain_id': fields.many2one('network.domain', 'Domain'),
     103        'wins_id': fields.many2one('network.address', 'WINS server'),
     104        'partner_id': fields.many2one('res.partner', 'Partner'),       
     105    }
     106network_subnet()
     107
     108class network_billing_period(osv.osv):
     109    _name = "network.billing.period"
     110    _columns = {
     111        'name': fields.char('Name', size=32, required=True),
     112    }
     113network_billing_period()
     114
     115class network_service_type(osv.osv):
     116    _name = "network.service.type"
     117    _columns = {
     118        'name': fields.char('Name', size=32, required=True),
     119    }
     120network_service_type()
     121
     122class network_service(osv.osv):
     123    _name = "network.service"
     124    _columns = {
     125        'name': fields.char('Name', size=32, required=True),
     126        'type_id': fields.many2one('network.service.type', 'Type'),
     127        'price': fields.integer('Price', help='Price per period'),
     128        'price_period_id': fields.many2one('network.billing.period', 'Price period'),
     129        'available': fields.boolean('Available', help='Define if service is available for customers'),
     130    }
     131network_service()
Note: See TracChangeset for help on using the changeset viewer.