[MODULE][VIEW] ~multiple customization
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Fri, 6 Nov 2015 15:11:50 +0000 (16:11 +0100)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Fri, 6 Nov 2015 15:11:50 +0000 (16:11 +0100)
__init__.py
__openerp__.py
velocampus_nantes.py [new file with mode: 0644]
view/bikecoop.xml [new file with mode: 0644]

index ba6f153..672e4cd 100644 (file)
@@ -2,24 +2,25 @@
 ##############################################################################
 #
 #    velocampus_nantes module for OpenERP, Vélocampus Nantes specifities
-#    Copyright (C) 2013-2014 Vélocampus Nantes (<http://www.velocampus.net/>)
+#    Copyright (C) 2013-2015 Vélocampus Nantes (<http://www.velocampus.net/>)
 #
 #    This file is a part of velocampus_nantes
 #
-#    velocampus_nantes module is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
+#    velocampus_nantes module is free software: you can redistribute it and/or
+#    modify it under the terms of the GNU General Public License as published
+#    by the Free Software Foundation, either version 3 of the License, or (at
+#    your option) any later version.
 #
-#    velocampus_nantes module is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
+#    velocampus_nantes module is distributed in the hope that it will be
+#    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+#    Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
 
+import velocampus_nantes
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 720c39d..7dc3207 100644 (file)
@@ -2,19 +2,19 @@
 ##############################################################################
 #
 #    velocampus_nantes module for OpenERP, Vélocampus Nantes specifities
-#    Copyright (C) 2013-2014 Vélocampus Nantes (<http://www.velocampus.net/>)
+#    Copyright (C) 2013-2015 Vélocampus Nantes (<http://www.velocampus.net/>)
 #
 #    This file is a part of velocampus_nantes
 #
-#    velocampus_nantes module is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
+#    velocampus_nantes module is free software: you can redistribute it and/or
+#    modify it under the terms of the GNU General Public License as published
+#    by the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
-#    velocampus_nantes module is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
+#    velocampus_nantes module is distributed in the hope that it will be
+#    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+#    Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
@@ -45,6 +45,8 @@ It installs the profile for bike co-ops to manage some features like:
         'data/base.xml',
         'data/products_categories.xml',
         'data/products_products.xml',
+        'data/bikecoop.xml',
+        'view/bikecoop.xml',
     ],
     'installable': True,
     'auto_install': False,
diff --git a/velocampus_nantes.py b/velocampus_nantes.py
new file mode 100644 (file)
index 0000000..38c221d
--- /dev/null
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    velocampus_nantes module for OpenERP, Vélocampus Nantes specifities
+#    Copyright (C) 2013-2015 Vélocampus Nantes (<http://www.velocampus.net/>)
+#
+#    This file is a part of velocampus_nantes
+#
+#    velocampus_nantes module is free software: you can redistribute it and/or
+#    modify it under the terms of the GNU General Public License as published
+#    by the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    velocampus_nantes module is distributed in the hope that it will be
+#    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+#    Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv
+
+
+class Partner(osv.osv):
+    _inherit = 'res.partner'
+
+    _columns = {
+        'crous': fields.boolean('Logement CROUS?'),
+        'highschool_years': fields.selection([('1', '1'),
+                                              ('2', '2'),
+                                              ('3', '3'),
+                                              ('4', '4'),
+                                              ('5', '5'),
+                                              ('6', '6'),
+                                              ('7', '7'),
+                                              ('8', '8'),
+                                              ('9', '9')], 'Highschool years'),
+        'is_volunteer': fields.boolean('Is volunteer'),
+    }
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/view/bikecoop.xml b/view/bikecoop.xml
new file mode 100644 (file)
index 0000000..e9d0c10
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <record id="view_bikecoop_l10n_fr_members_form" model="ir.ui.view">
+            <field name="name">res.partner.form</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="bikecoop.view_bikecoop_members_form"/>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='nationality_id']" position="replace">
+                    <field name="nationality_id" placeholder="France"/>
+                </xpath>
+                <field name="mobile" position="replace"/>
+                <xpath expr="//field[@name='occupation_id']" position="after">
+                    <field name="highschool_years" />
+                </xpath>
+                <xpath expr="//label[@string='Want to be volunteer in ...']" position="replace">
+                </xpath>
+                <xpath expr="//field[@name='volunteer_ids']" position="replace">
+                    <group>
+                        <field name="is_volunteer" string="Do you want to be volunteer?"/>
+                    </group>
+                    <label for="volunteer_ids" string="Want to be volunteer in …" attrs="{'invisible': [('is_volunteer','=', False)]}"/>
+                    <field name="volunteer_ids" attrs="{'invisible': [('is_volunteer','=', False)]}" domain="[('domain','=', 'volunteer')]">
+                        <form string="Volunteer activities" version="7.0">
+                            <field name="name"/>
+                        </form>
+                        <tree string="Volunteer activities">
+                            <field name="name"/>
+                        </tree>
+                    </field>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>