savoirfairelinux-openerp team mailing list archive
-
savoirfairelinux-openerp team
-
Mailing list archive
-
Message #00638
[Merge] lp:~savoirfairelinux-openerp/openerp-travel/multitranpo into lp:~savoirfairelinux-openerp/openerp-travel/travel
Sandy Carter (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/openerp-travel/multitranpo into lp:~savoirfairelinux-openerp/openerp-travel/travel with lp:~savoirfairelinux-openerp/openerp-travel/airport_airline_railwaystation_travel as a prerequisite.
Requested reviews:
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter)
For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-travel/multitranpo/+merge/197245
[IMP] show some fields if type=plane ou type=train
--
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-travel/multitranpo/+merge/197245
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/openerp-travel/airport_airline_railwaystation_travel.
=== modified file 'airline/__openerp__.py'
--- airline/__openerp__.py 2013-11-26 23:43:23 +0000
+++ airline/__openerp__.py 2013-11-29 17:03:50 +0000
@@ -41,6 +41,7 @@
'external_dependencies': {},
'data': [
'data/airline_data.xml'
+ 'res_partner_view.xml'
],
'demo': [],
'test': [],
=== added file 'airline/res_partner_view.xml'
--- airline/res_partner_view.xml 1970-01-01 00:00:00 +0000
+++ airline/res_partner_view.xml 2013-11-29 17:03:50 +0000
@@ -0,0 +1,18 @@
+<?xml version = "1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_partner_airline_form" model="ir.ui.view">
+ <field name="name">res.partner.airline.form.inherit</field>
+ <field name="model">res.partner</field>
+ <field name="inherit_id" ref="travel.view_travel_form"/>
+ <field name="arch" type="xml">
+ <page string="Travel" position="inside">
+ <group>
+ <separator string="airline" colspan="2"/>
+ <field name="airline" />
+ </group>
+ </page>
+ </field>
+ </record>
+ </data>
+</openerp>
=== modified file 'airport/__openerp__.py'
--- airport/__openerp__.py 2013-11-26 23:43:23 +0000
+++ airport/__openerp__.py 2013-11-29 17:03:50 +0000
@@ -43,6 +43,7 @@
'external_dependencies': {},
'data': [
'data/airport_data.xml',
+ 'res_partner_view.xml'
],
'demo': [],
'test': [],
=== added file 'airport/res_partner_view.xml'
--- airport/res_partner_view.xml 1970-01-01 00:00:00 +0000
+++ airport/res_partner_view.xml 2013-11-29 17:03:50 +0000
@@ -0,0 +1,19 @@
+<?xml version = "1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_partner_airport_form" model="ir.ui.view">
+ <field name="name">res.partner.airport.form.inherit</field>
+ <field name="model">res.partner</field>
+ <field name="inherit_id" ref="travel.view_travel_form"/>
+ <field name="arch" type="xml">
+ <page string="Travel" position="inside">
+ <group>
+ <separator string="Airport" colspan="2"/>
+ <field name="airport" />
+ <field name="iata_code" attrs="{'invisible': [('airport','=',False)]}"/>
+ </group>
+ </page>
+ </field>
+ </record>
+ </data>
+</openerp>
=== modified file 'railwaystation/__openerp__.py'
--- railwaystation/__openerp__.py 2013-11-26 23:43:23 +0000
+++ railwaystation/__openerp__.py 2013-11-29 17:03:50 +0000
@@ -39,7 +39,9 @@
'website': 'http://www.savoirfairelinux.com',
'license': 'AGPL-3',
'depends': ['crm', 'travel', ],
- 'data': [],
+ 'data': [
+ 'res_partner_view.xml'
+ ],
'demo': [],
'test': [],
'installable': True,
=== added file 'railwaystation/res_partner_view.xml'
--- railwaystation/res_partner_view.xml 1970-01-01 00:00:00 +0000
+++ railwaystation/res_partner_view.xml 2013-11-29 17:03:50 +0000
@@ -0,0 +1,18 @@
+<?xml version = "1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_partner_railwaystation_form" model="ir.ui.view">
+ <field name="name">res.partner.railwaystation.form.inherit</field>
+ <field name="model">res.partner</field>
+ <field name="inherit_id" ref="travel.view_travel_form"/>
+ <field name="arch" type="xml">
+ <page string="Travel" position="inside">
+ <group>
+ <separator string="Railway station" colspan="2"/>
+ <field name="railwaystation" />
+ </group>
+ </page>
+ </field>
+ </record>
+ </data>
+</openerp>
=== modified file 'travel/partner_view.xml'
--- travel/partner_view.xml 2013-11-13 21:14:34 +0000
+++ travel/partner_view.xml 2013-11-29 17:03:50 +0000
@@ -7,7 +7,7 @@
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<notebook position="inside">
- <page string="Travel" />
+ <page string="Travel" attrs="{'invisible': [('is_company','=',False), ('child_ids', '=', [])]}" autofocus="autofocus"/>
</notebook>
</field>
</record>
=== modified file 'travel_journey/__init__.py'
--- travel_journey/__init__.py 2013-11-19 20:27:11 +0000
+++ travel_journey/__init__.py 2013-11-29 17:03:50 +0000
@@ -23,5 +23,6 @@
import travel_journey
import travel_journey_class
import travel_passenger
+import travel_journey_type
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'travel_journey/__openerp__.py'
--- travel_journey/__openerp__.py 2013-11-26 23:43:23 +0000
+++ travel_journey/__openerp__.py 2013-11-29 17:03:50 +0000
@@ -27,14 +27,15 @@
'maintainer': 'Savoir-faire Linux',
'website': 'http://www.savoirfairelinux.com',
'category': 'Customer Relationship Management',
- 'description': """\
- Travel journey
-===============
+ 'description': """
+Travel journey
+==============
This module allows to add a starting point and destination to a travel.
Contributors
------------
* Sandy Carter (sandy.carter@xxxxxxxxxxxxxxxxxxxx)
+* EL HADJI DEM (elhadji.dem@xxxxxxxxxxxxxxxxxxxx)
""",
'depends': ['travel', 'city', 'product', ],
'external_dependencies': {},
=== modified file 'travel_journey/travel_journey.py'
--- travel_journey/travel_journey.py 2013-11-27 19:29:53 +0000
+++ travel_journey/travel_journey.py 2013-11-29 17:03:50 +0000
@@ -23,6 +23,13 @@
from openerp.osv import fields, orm
+def _get_type(self, cr, uid, context=None):
+ acc_type_obj = self.pool.get('travel.journey.type')
+ ids = acc_type_obj.search(cr, uid, [])
+ res = acc_type_obj.read(cr, uid, ids, ['code', 'name'], context)
+ return [(r['code'], r['name']) for r in res]
+
+
class travel_journey(orm.Model):
_description = 'Journey of travel'
_name = 'travel.journey'
@@ -57,6 +64,13 @@
'comment': fields.text('Comments'),
'passenger_id': fields.many2one('travel.passenger', 'Passenger', required=True,
help='Passenger on this journey.'),
+ #'type': fields.many2one('travel.journey.type', 'Travel journey type',
+ # help='Travel journey type.'),
+ 'type': fields.selection(_get_type, 'Travel journey type',
+ help='Travel journey type.'),
+ 'reservation': fields.char('Reservation Number', size=256,
+ help="Number of the ticket reservation."),
+ 'cancellation': fields.text('Cancellation', help='Notes on cancellation.'),
}
def _default_class(self, cr, uid, context=None):
=== modified file 'travel_journey/travel_journey_data.xml'
--- travel_journey/travel_journey_data.xml 2013-11-27 18:45:37 +0000
+++ travel_journey/travel_journey_data.xml 2013-11-29 17:03:50 +0000
@@ -16,5 +16,13 @@
<record id="travel_journey_class_premium" model="travel.journey.class">
<field name="name">Premium</field>
</record>
+ <record id="travel_journey_type_plane" model="travel.journey.type">
+ <field name="code">plane</field>
+ <field name="name">Plane</field>
+ </record>
+ <record id="travel_journey_type_rail" model="travel.journey.type">
+ <field name="code">rail</field>
+ <field name="name">Rail</field>
+ </record>
</data>
</openerp>
=== added file 'travel_journey/travel_journey_type.py'
--- travel_journey/travel_journey_type.py 1970-01-01 00:00:00 +0000
+++ travel_journey/travel_journey_type.py 2013-11-29 17:03:50 +0000
@@ -0,0 +1,36 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2013 Savoir-faire Linux
+# (<http://www.savoirfairelinux.com>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, orm
+
+
+class travel_journey_type(orm.Model):
+ _description = 'Travel journey type'
+ _name = 'travel.journey.type'
+ _columns = {
+ 'code': fields.char('Code', size=10, required=True,
+ help='Code of travel journey type.'),
+ 'name': fields.char('Name', size=256, required=True, select=True,
+ help='Name of travel journey type.'),
+ }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'travel_journey/travel_journey_view.xml'
--- travel_journey/travel_journey_view.xml 2013-11-27 19:29:53 +0000
+++ travel_journey/travel_journey_view.xml 2013-11-29 17:03:50 +0000
@@ -16,9 +16,8 @@
<group string="Cities" col="2" colspan="2">
<field name="origin" on_change="on_change_location(origin)"/>
<field name="destination" />
-
<group string="Cities" col="2" colspan="2"
- attrs="{'invisible': [('return', '=', False)]}">
+ attrs="{'invisible': [('return', '=', False)], 'required': [('return', '=', False)]}">
<field name="return_origin"/>
<field name="origin"/>
</group>
@@ -53,5 +52,20 @@
</form>
</field>
</record>
+ <!--Add travel journey type -->
+ <record model="ir.ui.view" id="travel_journey_form_view_inherit_type">
+ <field name="name">Travel Passenger Type Form View</field>
+ <field name="model">travel.journey</field>
+ <field name="inherit_id" ref="travel_journey_form_view"/>
+ <field name="priority" eval="3.0"/>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <field name="return" position="before">
+ <group colspan="4">
+ <field name="type"/>
+ </group>
+ </field>
+ </field>
+ </record>
</data>
</openerp>
=== modified file 'travel_journey_plane/__openerp__.py'
--- travel_journey_plane/__openerp__.py 2013-11-26 23:43:23 +0000
+++ travel_journey_plane/__openerp__.py 2013-11-29 17:03:50 +0000
@@ -28,18 +28,18 @@
'website': 'http://www.savoirfairelinux.com',
'category': 'Customer Relationship Management',
'description': """
- Travel journey Plane
-=====================
+Travel journey Plane
+====================
This module allows to create a travel by plane.
Contributors
------------
* Sandy Carter (sandy.carter@xxxxxxxxxxxxxxxxxxxx)
+* EL HADJI DEM (elhadji.dem@xxxxxxxxxxxxxxxxxxxx)
""",
'depends': ['travel_journey', 'airport', 'airline'],
'external_dependencies': {},
'data': ['travel_journey_view.xml',
- 'travel_passenger_view.xml',
],
'demo': [],
'test': [],
=== modified file 'travel_journey_plane/travel_journey.py'
--- travel_journey_plane/travel_journey.py 2013-11-25 20:48:56 +0000
+++ travel_journey_plane/travel_journey.py 2013-11-29 17:03:50 +0000
@@ -29,8 +29,6 @@
'airline': fields.many2one('res.partner', 'Airline',
domain="[('airline','=',True)]",
help="Airline company."),
- 'reservation': fields.char('Reservation Number', size=256,
- help="Number of the ticket reservation."),
'airport_from': fields.many2one('res.partner', 'Origin',
domain="[('airport','=',True)]",
help="Departure airport."),
@@ -41,7 +39,6 @@
help='Date and time of the departure of the flight.'),
'fight_arrival': fields.datetime('Flight Arrival',
help='Date and time of the arrival of the flight.'),
- 'cancellation': fields.text('Cancellation', help='Notes on cancellation.'),
}
=== modified file 'travel_journey_plane/travel_journey_view.xml'
--- travel_journey_plane/travel_journey_view.xml 2013-11-25 20:48:56 +0000
+++ travel_journey_plane/travel_journey_view.xml 2013-11-29 17:03:50 +0000
@@ -7,21 +7,21 @@
<field name="model">travel.journey</field>
<field name="inherit_id" ref="travel_journey.travel_journey_form_view"/>
<field name="arch" type="xml">
- <group name="Info">
- <group string="Plane" col="4">
- <field name="airline"/>
- <field name="reservation"/>
- <group string="Airports" col="2" colspan="2">
- <field name="airport_from"/>
- <field name="airport_to"/>
- </group>
- <group string="Times" col="2" colspan="2">
- <field name="fight_departure"/>
- <field name="fight_arrival"/>
- </group>
- <group string="Cancellation" colspan="4">
- <field name="cancellation" nolabel="1"/>
- </group>
+ <group name="Info" position="inside">
+ <group string="Plane" col="4" attrs="{'invisible': ['|',('type', '=', 'rail'), ('type', '=', False)]}">
+ <field name="airline"/>
+ <field name="reservation"/>
+ <group string="Airports" col="2" colspan="2">
+ <field name="airport_from"/>
+ <field name="airport_to"/>
+ </group>
+ <group string="Time" col="2" colspan="2">
+ <field name="fight_departure"/>
+ <field name="fight_arrival"/>
+ </group>
+ <group string="Cancellation" colspan="4">
+ <field name="cancellation" nolabel="1"/>
+ </group>
</group>
</group>
</field>
=== added directory 'travel_journey_rail'
=== added file 'travel_journey_rail/__init__.py'
--- travel_journey_rail/__init__.py 1970-01-01 00:00:00 +0000
+++ travel_journey_rail/__init__.py 2013-11-29 17:03:50 +0000
@@ -0,0 +1,25 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2013 Savoir-faire Linux
+# (<http://www.savoirfairelinux.com>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import travel_journey
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'travel_journey_rail/__openerp__.py'
--- travel_journey_rail/__openerp__.py 1970-01-01 00:00:00 +0000
+++ travel_journey_rail/__openerp__.py 2013-11-29 17:03:50 +0000
@@ -0,0 +1,50 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2013 Savoir-faire Linux
+# (<http://www.savoirfairelinux.com>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+ 'name': 'Travel Journey by Rail',
+ 'version': '0.1',
+ 'author': 'Savoir-faire Linux',
+ 'maintainer': 'Savoir-faire Linux',
+ 'website': 'http://www.savoirfairelinux.com',
+ 'category': 'Customer Relationship Management',
+ 'description': """
+Travel journey Rail
+===================
+This module allows to create a travel by rail.
+
+Contributors
+------------
+* Sandy Carter (sandy.carter@xxxxxxxxxxxxxxxxxxxx)
+* EL HADJI DEM (elhadji.dem@xxxxxxxxxxxxxxxxxxxx)
+""",
+ 'depends': ['travel_journey', 'railwaystation'],
+ 'external_dependencies': {},
+ 'data': ['travel_journey_view.xml',
+ ],
+ 'demo': [],
+ 'test': [],
+ 'installable': True,
+ 'active': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'travel_journey_rail/travel_journey.py'
--- travel_journey_rail/travel_journey.py 1970-01-01 00:00:00 +0000
+++ travel_journey_rail/travel_journey.py 2013-11-29 17:03:50 +0000
@@ -0,0 +1,45 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2013 Savoir-faire Linux
+# (<http://www.savoirfairelinux.com>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, orm
+
+
+class travel_journey_rail(orm.Model):
+ _inherit = 'travel.journey'
+ _columns = {
+ 'railwaystation': fields.many2one('res.partner', 'Railway station',
+ domain="[('railwaystation','=',True)]",
+ help="Airline company."),
+ 'railwaystation_from': fields.many2one('res.partner', 'Origin',
+ domain="[('railwaystation','=',True)]",
+ help="Departure Railway station."),
+ 'railwaystation_to': fields.many2one('res.partner', 'Destination',
+ domain="[('railwaystation','=',True)]",
+ help="Destination Railway station."),
+ 'railwaystation_departure': fields.datetime('Departure',
+ help='Date and time of the departure of the rail.'),
+ 'railwaystation_arrival': fields.datetime('Arrival',
+ help='Date and time of the arrival of the rail.'),
+ }
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'travel_journey_rail/travel_journey_view.xml'
--- travel_journey_rail/travel_journey_view.xml 1970-01-01 00:00:00 +0000
+++ travel_journey_rail/travel_journey_view.xml 2013-11-29 17:03:50 +0000
@@ -0,0 +1,30 @@
+<?xml version = "1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- View form inherit from travel_journey.travel_journey_form_view -->
+ <record id="view_travel_journey_rail_form" model="ir.ui.view">
+ <field name="name">travel.journey.rail.form.inherit</field>
+ <field name="model">travel.journey</field>
+ <field name="inherit_id" ref="travel_journey.travel_journey_form_view"/>
+ <field name="arch" type="xml">
+ <group name="Info" position="inside">
+ <group string="Railway station" col="4" attrs="{'invisible': ['|',('type', '=', 'plane'), ('type', '=', False)]}">
+ <field name="railwaystation"/>
+ <field name="reservation"/>
+ <group string="Railway station" col="2" colspan="2">
+ <field name="railwaystation_from"/>
+ <field name="railwaystation_to"/>
+ </group>
+ <group string="Times" col="2" colspan="2">
+ <field name="railwaystation_departure"/>
+ <field name="railwaystation_arrival"/>
+ </group>
+ <group string="Cancellation" colspan="4">
+ <field name="cancellation" nolabel="1"/>
+ </group>
+ </group>
+ </group>
+ </field>
+ </record>
+ </data>
+</openerp>
Follow ups