changeset 3527:19ffd9d59dc6

task #15549: Include description field in modules // Create field in model, form and tree views
author Luis Falcon <falcon@gnuhealth.org>
date Sat, 15 Feb 2020 20:09:31 +0000
parents d9f5d6d1afe3
children f68057c49814
files tryton/health/__init__.py tryton/health/health.py tryton/health/health_view.xml tryton/health/view/modules_form.xml tryton/health/view/modules_tree.xml
diffstat 5 files changed, 39 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health/__init__.py
+++ b/tryton/health/__init__.py
@@ -97,6 +97,7 @@
         ProductTemplate,
         PageOfLife,
         Commands,
+        Modules,
         module='health', type_='model')
     Pool.register(
         OpenAppointmentReport,
--- a/tryton/health/health.py
+++ b/tryton/health/health.py
@@ -2,8 +2,8 @@
 ##############################################################################
 #
 #    GNU Health: The Free Health and Hospital Information System
-#    Copyright (C) 2008-2019 Luis Falcon <falcon@gnuhealth.org>
-#    Copyright (C) 2011-2019 GNU Solidario <health@gnusolidario.org>
+#    Copyright (C) 2008-2020 Luis Falcon <falcon@gnuhealth.org>
+#    Copyright (C) 2011-2020 GNU Solidario <health@gnusolidario.org>
 #    Copyright (C) 2015 Cédric Krier
 #    Copyright (C) 2014-2015 Chris Zimmerman <siv@riseup.net>
 #
@@ -80,7 +80,7 @@
     'PatientVaccination','PatientEvaluation',
     'Directions', 'SecondaryCondition', 'DiagnosticHypothesis',
     'SignsAndSymptoms', 'PatientECG', 'ProductTemplate', 'PageOfLife',
-    'Commands']
+    'Commands','Modules']
 
 
 sequences = ['patient_sequence', 'patient_evaluation_sequence',
@@ -5622,3 +5622,9 @@
         cls.__rpc__.update({
                 'sysinfo': RPC(check_access=False),
                 })
+
+class Modules(ModelSQL, ModelView):
+    __name__ = 'ir.module'
+
+    # Add the module description field
+    description = fields.Char("Description")
--- a/tryton/health/health_view.xml
+++ b/tryton/health/health_view.xml
@@ -98,7 +98,7 @@
         </record>
 
 <!-- Replace default Tryton module icons -->
-        
+
         <!-- Party -->
         <record model="ir.ui.icon" id="party_icon">
             <field name="name">gnuhealth-party</field>
@@ -2149,6 +2149,21 @@
             parent="gnuhealth_conf_misc" icon="gnuhealth-list"/>
 
 
+        <!-- Modules: Include description information for each package -->
+
+        <record model="ir.ui.view" id="view_module_form">
+            <field name="model">ir.module</field>
+            <field name="inherit" ref="ir.module_view_form"/>
+            <field name="name">modules_form</field>
+        </record>
+
+        <record model="ir.ui.view" id="view_module_tree">
+            <field name="model">ir.module</field>
+            <field name="inherit" ref="ir.module_view_tree"/>
+            <field name="name">modules_tree</field>
+        </record>
+
+
 <!-- GNU Health Federation Country Config -->
 
         <record model="ir.ui.view" id="gnuhealth_federation_country_config_view">
new file mode 100644
--- /dev/null
+++ b/tryton/health/view/modules_form.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<data>
+    <xpath expr="/form/field[@name=&quot;name&quot;]" position="after">
+        <label name="description"/>
+        <field name="description"/>
+    </xpath>
+</data>
new file mode 100644
--- /dev/null
+++ b/tryton/health/view/modules_tree.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<data>
+    <xpath expr="/tree/field[@name=&quot;name&quot;]" position="after">
+        <field name="description" expand="1"/>
+    </xpath>
+</data>