Commits

Jordi Esteve (Zikzakmedia) committed 5bc40dd

Moved protocols from logins to softwares (a software has several protocols-ports)

  • Participants
  • Parent commits fc5a82d

Comments (0)

Files changed (4)

         )
     logins = fields.One2Many('network.software.login', 'software',
         'Login Users')
+    protocols = fields.One2Many('network.protocol', 'software',
+        'Connection Protocols')
 
     def get_network(self, name):
         return self.hardware.network.id
             'get_hardware',
         )
     superuser = fields.Boolean('Super User')
-    protocols = fields.One2Many('network.protocol', 'software_login',
-        'Connection Protocols')
 
     def get_hardware(self, login):
         return self.software.hardware.id
         super(NetworkProtocolType, cls).__setup__()
         cls._order.insert(0, ('name', 'ASC'))
 
+
 class NetworkProtocol(ModelSQL, ModelView):
     'Network Protocol'
     __name__ = 'network.protocol'
     name = fields.Many2One('network.protocol.type', 'Protocol', required=True)
     note = fields.Text('Notes')
     port = fields.Integer('Port', required=True)
-    software_login = fields.Many2One('network.software.login',
-            'Software Login', required=True)
+    software = fields.Many2One('network.software', 'Software', required=True)

view/login_form.xml

 <!-- This file is part of network module for Tryton.
 The COPYRIGHT file at the top level of this repository contains the full
 copyright notices and license terms. -->
-<form string="Software Type" col="6">
+<form string="Login" col="6">
     <label name='login'/>
     <field name='login'/>
     <label name='password'/>
     <field name='hardware'/>
     <label name='software'/>
     <field name='software'/>
-    <notebook colspan="6">
-        <page string="Connection Protocols" id="protocols">
-            <field name="protocols" colspan="6"/>
-        </page>
-        <page string="Notes" id="note">
-            <field name="note" colspan="6"/>
-        </page>
-    </notebook>
+    <separator name="note" colspan="6"/>
+    <field name="note" colspan="6"/>
 </form>

view/login_tree.xml

 <!-- This file is part of network module for Tryton.
 The COPYRIGHT file at the top level of this repository contains the full
 copyright notices and license terms. -->
-<tree string="Softwares">
+<tree string="Logins">
     <field name='login'/>
     <field name='superuser'/>
 </tree>

view/software_form.xml

     <label name='hardware'/>
     <field name='hardware'/>
     <notebook colspan="6">
-        <page string="Login Users" id="logins">
+        <page string="Login Protocols and Users" id="logins">
+            <field name="protocols" colspan="6"/>
             <field name='logins' colspan="6"/>
         </page>
         <page string="Notes" id="note">