Unify asset and elevator and allow to override module data

This commit is contained in:
Sergi Almacellas Abellana 2014-12-23 12:48:27 +01:00
parent 2aaece3d70
commit 1caf080441
10 changed files with 1681 additions and 1404 deletions

View File

@ -1,3 +1,5 @@
* Allow to modify data loaded from xml files
* Unify asset and elevator
* Add unique constraint on asset
* Fix elevator components page layout

View File

@ -15,5 +15,5 @@ def register():
Suspension,
DoorType,
Guide,
Elevator,
Asset,
module='asset_elevator', type_='model')

313
asset.py
View File

@ -1,9 +1,13 @@
#The COPYRIGHT file at the top level of this repository contains the full
#copyright notices and license terms.
from trytond.model import ModelSQL, ModelView, fields
from trytond.pool import PoolMeta
from trytond.pyson import Eval
__all__ = ['Building', 'ElevatorType', 'Finish', 'ManeveurType', 'HoseType',
'Situation', 'Suspension', 'DoorType', 'Guide', 'Elevator']
__all__ = ['Building', 'ElevatorType', 'Finish', 'ManeveurType',
'HoseType', 'Situation', 'Suspension', 'DoorType', 'Guide', 'Asset']
__metaclass__ = PoolMeta
class Building(ModelSQL, ModelView):
@ -11,6 +15,10 @@ class Building(ModelSQL, ModelView):
__name__ = 'asset.building'
name = fields.Char('Name', required=True, translate=True)
@classmethod
def check_xml_record(cls, records, values):
return True
class ElevatorType(ModelSQL, ModelView):
'Elevator Type'
@ -18,6 +26,10 @@ class ElevatorType(ModelSQL, ModelView):
code = fields.Char('Code')
name = fields.Char('Name', required=True, translate=True)
@classmethod
def check_xml_record(cls, records, values):
return True
def get_rec_name(self, name):
if self.code:
return '[' + self.code + '] ' + self.name
@ -43,6 +55,10 @@ class ManeveurType(ModelSQL, ModelView):
__name__ = 'asset.maneveur.type'
name = fields.Char('Name', required=True, translate=True)
@classmethod
def check_xml_record(cls, records, values):
return True
class HoseType(ModelSQL, ModelView):
'Hose Type'
@ -55,12 +71,20 @@ class Situation(ModelSQL, ModelView):
__name__ = 'asset.situation'
name = fields.Char('Name', required=True, translate=True)
@classmethod
def check_xml_record(cls, records, values):
return True
class Suspension(ModelSQL, ModelView):
'Suspension Type'
__name__ = 'asset.suspension.type'
name = fields.Char('Name', required=True, translate=True)
@classmethod
def check_xml_record(cls, records, values):
return True
class DoorType(ModelSQL, ModelView):
'Door Type'
@ -81,147 +105,232 @@ class Guide(ModelSQL, ModelView):
def default_type():
return 'cabin'
_STATES = {
'invisible': Eval('type') != 'elevator',
}
_DEPENDS = ['type']
class Elevator(ModelSQL, ModelView):
'Elevator'
__name__ = 'asset.elevator'
asset = fields.Many2One('asset', 'Asset', required=True,
ondelete='CASCADE')
active = fields.Function(fields.Boolean('Active'),
'get_active', searcher='search_active')
administrator = fields.Many2One('party.party', 'Administrator')
code = fields.Char('Code')
registry_number = fields.Char('R.A.E.', help='Elevator machine number')
material_brand = fields.Many2One('product.brand', 'Material brand')
class Asset:
__name__ = 'asset'
administrator = fields.Many2One('party.party', 'Administrator',
states=_STATES, depends=_DEPENDS)
registry_number = fields.Char('R.A.E.', help='Elevator machine number',
states=_STATES, depends=_DEPENDS)
material_brand = fields.Many2One('product.brand', 'Material brand',
states=_STATES, depends=_DEPENDS)
provenance = fields.Selection([
('', ''),
('new_work', 'New Work'),
('old_work', 'Old Work'),
('another_conservative', 'Another conservative')], 'Proveanence')
type = fields.Many2One('asset.elevator.type', 'Type')
building = fields.Many2One('asset.building', 'Building')
stops = fields.Integer('Stops')
payload = fields.Integer('Payload')
persons = fields.Integer('Persons')
velocity = fields.Float('Velocity', digits=(16, 2))
landing_door_type = fields.Many2One('asset.door.type', 'Landing door type')
('another_conservative', 'Another conservative')], 'Proveanence',
states=_STATES, depends=_DEPENDS)
elevator_type = fields.Many2One('asset.elevator.type', 'Type',
states=_STATES, depends=_DEPENDS)
building = fields.Many2One('asset.building', 'Building', states=_STATES,
depends=_DEPENDS)
stops = fields.Integer('Stops', states=_STATES, depends=_DEPENDS)
payload = fields.Integer('Payload', states=_STATES, depends=_DEPENDS)
persons = fields.Integer('Persons', states=_STATES, depends=_DEPENDS)
velocity = fields.Float('Velocity', digits=(16, 2), states=_STATES,
depends=_DEPENDS)
landing_door_type = fields.Many2One('asset.door.type', 'Landing door type',
states=_STATES, depends=_DEPENDS)
hand = fields.Selection([
('', ''),
('left', 'Left'),
('right', 'Right'),
], 'Hand')
light_height = fields.Float('Height', digits=(16, 2))
light_width = fields.Float('Width', digits=(16, 2))
doors_number = fields.Integer('Doors Number')
doors_brand = fields.Many2One('product.brand', 'Doors brand')
], 'Hand', states=_STATES, depends=_DEPENDS)
light_height = fields.Float('Height', digits=(16, 2), states=_STATES,
depends=_DEPENDS)
light_width = fields.Float('Width', digits=(16, 2), states=_STATES,
depends=_DEPENDS)
doors_number = fields.Integer('Doors Number', states=_STATES,
depends=_DEPENDS)
doors_brand = fields.Many2One('product.brand', 'Doors brand',
states=_STATES, depends=_DEPENDS)
doors_product = fields.Many2One('product.product', 'Doors Product',
states=_STATES, depends=_DEPENDS,
domain=[
('type', '!=', 'service'),
])
locks_brand = fields.Many2One('product.brand', 'Locks brand')
cabin_depth = fields.Float('Depth', digits=(16, 2))
cabin_width = fields.Float('Width', digits=(16, 2))
lateral_finish = fields.Many2One('asset.finish', 'Lateral Finish')
ground_finish = fields.Many2One('asset.finish', 'Ground Finish')
roof_finish = fields.Many2One('asset.finish', 'Roof Finish')
phone = fields.Char('Phone')
door_motor_brand = fields.Many2One('product.brand', 'Door Motor Brand')
locks_brand = fields.Many2One('product.brand', 'Locks brand',
states=_STATES, depends=_DEPENDS)
cabin_depth = fields.Float('Depth', digits=(16, 2), states=_STATES,
depends=_DEPENDS)
cabin_width = fields.Float('Width', digits=(16, 2), states=_STATES,
depends=_DEPENDS)
cabin_accesses = fields.Integer('Cabin Accesses', states=_STATES,
depends=_DEPENDS)
cabin_doors = fields.Integer('Cabin Doors', states=_STATES,
depends=_DEPENDS)
cabin_doors_module = fields.Char('Cabin Doors Module', states=_STATES,
depends=_DEPENDS)
lateral_finish = fields.Many2One('asset.finish', 'Lateral Finish',
states=_STATES, depends=_DEPENDS)
ground_finish = fields.Many2One('asset.finish', 'Ground Finish',
states=_STATES, depends=_DEPENDS)
roof_finish = fields.Many2One('asset.finish', 'Roof Finish',
states=_STATES, depends=_DEPENDS)
phone = fields.Char('Phone', states=_STATES, depends=_DEPENDS)
door_motor_brand = fields.Many2One('product.brand', 'Door Motor Brand',
states=_STATES, depends=_DEPENDS)
door_motor_product = fields.Many2One('product.product',
'Door Motor Product',
'Door Motor Product', states=_STATES, depends=_DEPENDS,
domain=[
('type', '!=', 'service'),
])
maneveur_type = fields.Many2One('asset.maneveur.type', 'Maneveur Type')
maneveur_type = fields.Many2One('asset.maneveur.type', 'Maneveur Type',
states=_STATES, depends=_DEPENDS)
manevuer_manufacturer = fields.Many2One('party.party',
'Manevuer Manufacturer')
input_voltage = fields.Integer('Input Voltage', help='Voltage at the '
'entrance of the property (in volts')
lleva_voltage = fields.Integer('Lleva Voltage', help='Lleva voltage '
'(in volts)')
brake_voltage = fields.Integer('Brake Voltage', help='Brake voltage '
'(in volts)')
'Manevuer Manufacturer', states=_STATES, depends=_DEPENDS)
input_voltage = fields.Integer('Input Voltage', states=_STATES,
depends=_DEPENDS, help='Voltage at the entrance of the property (in '
'volts')
lleva_voltage = fields.Integer('Lleva Voltage', states=_STATES,
depends=_DEPENDS, help='Lleva voltage (in volts)')
brake_voltage = fields.Integer('Brake Voltage', states=_STATES,
depends=_DEPENDS, help='Brake voltage (in volts)')
contactor_types = fields.Many2One('product.product', 'Contactor Types',
states=_STATES, depends=_DEPENDS,
domain=[
('type', '!=', 'service'),
])
contactor_voltage = fields.Integer('Contactor Voltage', help='Contactor '
'voltage (in volts)')
hose_type = fields.Many2One('asset.hose.type', 'Hose Type')
number_of_conductors = fields.Integer('Number of conductors')
conductors_length = fields.Integer('Conductors Length')
situation = fields.Many2One('asset.situation', 'Situation')
buttons_brand = fields.Many2One('product.brand', 'Buttons brand')
contactor_voltage = fields.Integer('Contactor Voltage', states=_STATES,
depends=_DEPENDS, help='Contactor voltage (in volts)')
hose_type = fields.Many2One('asset.hose.type', 'Hose Type',
states=_STATES, depends=_DEPENDS)
number_of_conductors = fields.Integer('Number of conductors',
states=_STATES, depends=_DEPENDS)
conductors_length = fields.Integer('Conductors Length', states=_STATES,
depends=_DEPENDS)
conductors_connection = fields.Selection([
('', ''),
('CM', 'CM'),
('MC', 'MC'),
], 'Conductors Connection', states=_STATES, depends=_DEPENDS)
situation = fields.Many2One('asset.situation', 'Situation', states=_STATES,
depends=_DEPENDS)
buttons_brand = fields.Many2One('product.brand', 'Buttons brand',
states=_STATES, depends=_DEPENDS)
buttons_product = fields.Many2One('product.product', 'Buttons product',
states=_STATES, depends=_DEPENDS,
domain=[
('type', '!=', 'service'),
])
ligths_voltage = fields.Integer('Ligths Voltage', help='Ligths voltage '
'(in volts)')
displays_brand = fields.Many2One('product.brand', 'Displays brand')
cabin_buttons = fields.Char('Cabin Buttons', states=_STATES,
depends=_DEPENDS)
main_buttons = fields.Char('Main Floor Buttons', states=_STATES,
depends=_DEPENDS)
other_buttons = fields.Char('Other floors Buttons', states=_STATES,
depends=_DEPENDS)
ligths_voltage = fields.Integer('Ligths Voltage', states=_STATES,
depends=_DEPENDS, help='Ligths voltage (in volts)')
displays_brand = fields.Many2One('product.brand', 'Displays brand',
states=_STATES, depends=_DEPENDS)
displays_product = fields.Many2One('product.product', 'Displays product',
states=_STATES, depends=_DEPENDS,
domain=[
('type', '!=', 'service'),
])
bidirectional_brand = fields.Many2One('product.brand',
'Bidirectional brand')
'Bidirectional brand', states=_STATES, depends=_DEPENDS)
bidirectional_product = fields.Many2One('product.product',
'Bidirectional product',
'Bidirectional product', states=_STATES, depends=_DEPENDS,
domain=[
('type', '!=', 'service'),
])
gsm = fields.Boolean('GSM')
machine_brand = fields.Many2One('product.brand', 'Machine brand')
gsm = fields.Boolean('GSM', states=_STATES, depends=_DEPENDS)
machine_brand = fields.Many2One('product.brand', 'Machine brand',
states=_STATES, depends=_DEPENDS)
machine_product = fields.Many2One('product.product', 'Machine product',
states=_STATES, depends=_DEPENDS,
domain=[
('type', '!=', 'service'),
])
pulley = fields.Integer('Pulley', help='Milimeters of the pulley '
'diamenter')
power = fields.Float('Power', digits=(16, 2), help='Power (in kw)')
rpm_motor = fields.Integer('RPM Motor')
wire_number = fields.Integer('Wire number')
wire_diameter = fields.Integer('Wire diameter')
wire_lenght = fields.Integer('Wire lenght')
deflection_pulley = fields.Boolean('Deflection pulley')
brake_brand = fields.Many2One('product.brand', 'Brake Brand')
cilinder_brand = fields.Many2One('product.brand', 'Cilinder Brand')
path_length = fields.Float('Path Length', digits=(16, 2))
door_width = fields.Float('Door Width', digits=(16, 2))
door_height = fields.Float('Door Height', digits=(16, 2))
pulley = fields.Integer('Pulley', states=_STATES, depends=_DEPENDS,
help='Milimeters of the pulley diamenter')
power = fields.Float('Power', digits=(16, 2), states=_STATES,
depends=_DEPENDS, help='Power (in kw)')
rpm_motor = fields.Integer('RPM Motor', states=_STATES, depends=_DEPENDS)
wire_number = fields.Integer('Wire number', states=_STATES,
depends=_DEPENDS)
wire_diameter = fields.Integer('Wire diameter', states=_STATES,
depends=_DEPENDS)
wire_lenght = fields.Integer('Wire lenght', states=_STATES,
depends=_DEPENDS)
deflection_pulley = fields.Boolean('Deflection pulley', states=_STATES,
depends=_DEPENDS)
brake_brand = fields.Many2One('product.brand', 'Brake Brand',
states=_STATES, depends=_DEPENDS)
cilinder_brand = fields.Many2One('product.brand', 'Cilinder Brand',
states=_STATES, depends=_DEPENDS)
path_length = fields.Float('Path Length', digits=(16, 2), states=_STATES,
depends=_DEPENDS)
door_width = fields.Float('Door Width', digits=(16, 2), states=_STATES,
depends=_DEPENDS)
door_height = fields.Float('Door Height', digits=(16, 2), states=_STATES,
depends=_DEPENDS)
suspension_type = fields.Many2One('asset.suspension.type',
'Suspension Type')
hose_diameter = fields.Integer('Hose diameter')
hose_lenght = fields.Integer('Hose lenght')
'Suspension Type', states=_STATES, depends=_DEPENDS)
hose_diameter = fields.Integer('Hose diameter', states=_STATES,
depends=_DEPENDS)
hose_lenght = fields.Integer('Hose lenght', states=_STATES,
depends=_DEPENDS)
cabin_guides = fields.Many2One('asset.guide', 'Cabin Guides',
states=_STATES, depends=_DEPENDS,
domain=[
('type', '=', 'cabin'),
])
counterweight_guides = fields.Many2One('asset.guide',
'Counterweight Guides',
domain=[
('type', '=', 'counterweight'),
])
limiter_brand = fields.Many2One('product.brand', 'Limiter Brand')
limiter_lenght = fields.Integer('Limiter Length')
limiter_diameter = fields.Integer('Limiter Diamater')
cabin_chassis_brand = fields.Many2One('product.brand',
'Cabin chasis brand')
cabin_chassis_product = fields.Many2One('product.product',
'Cabin chasis product',
counterweight_product = fields.Many2One('product.product',
'Counterweight Product', states=_STATES, depends=_DEPENDS,
domain=[
('type', '!=', 'service'),
])
parachute_brand = fields.Many2One('product.brand', 'Parachute brand')
parachute_counterweight = fields.Boolean('Parachute counterweight')
notes = fields.Text('Notes')
counterweight_guides = fields.Many2One('asset.guide',
'Counterweight Guides', states=_STATES, depends=_DEPENDS,
domain=[
('type', '=', 'counterweight'),
])
limiter_brand = fields.Many2One('product.brand', 'Limiter Brand',
states=_STATES, depends=_DEPENDS)
limiter_diameter = fields.Integer('Limiter Diamater', states=_STATES,
depends=_DEPENDS)
limiter_wire_diameter = fields.Integer('Limiter Wire Diamater',
states=_STATES, depends=_DEPENDS)
limiter_wire_lenght = fields.Integer('Limiter Wire Length', states=_STATES,
depends=_DEPENDS)
cabin_chassis_brand = fields.Many2One('product.brand',
'Cabin chasis brand', states=_STATES, depends=_DEPENDS)
cabin_chassis_product = fields.Many2One('product.product',
'Cabin chasis product',
states=_STATES, depends=_DEPENDS,
domain=[
('type', '!=', 'service'),
])
parachute_brand = fields.Many2One('product.brand', 'Parachute brand',
states=_STATES, depends=_DEPENDS)
parachute_counterweight = fields.Boolean('Parachute counterweight',
states=_STATES, depends=_DEPENDS)
notes = fields.Text('Notes', states=_STATES, depends=_DEPENDS)
manufacturer = fields.Many2One('party.party', 'Manufacturer',
states=_STATES, depends=_DEPENDS)
conservative = fields.Many2One('party.party', 'Conservative',
states=_STATES, depends=_DEPENDS)
general_state = fields.Char('General State', states=_STATES,
depends=_DEPENDS)
reformed = fields.Boolean('Reformed', states=_STATES, depends=_DEPENDS)
in_normative = fields.Boolean('In Normative', states=_STATES,
depends=_DEPENDS)
piston_diameter = fields.Integer('Piston diameter', states=_STATES,
depends=_DEPENDS)
@classmethod
def __setup__(cls):
super(Elevator, cls).__setup__()
cls._sql_constraints += [
('asset_unique', 'UNIQUE(asset)', 'The Asset must be unique.'),
]
super(Asset, cls).__setup__()
elevator = ('elevator', 'Elevator')
if not elevator in cls.type.selection:
cls.type.selection.append(elevator)
@staticmethod
def default_provenance():
@ -232,19 +341,5 @@ class Elevator(ModelSQL, ModelView):
return ''
@staticmethod
def default_active():
return True
def get_rec_name(self, name):
return self.asset.name
@classmethod
def search_rec_name(cls, name, clause):
return [('asset.name',) + tuple(clause[1:])]
def get_active(self, name):
return self.asset.active
@classmethod
def search_active(cls, name, clause):
return [('asset.active',) + tuple(clause[1:])]
def default_conductors_connection():
return ''

View File

@ -1,7 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<tryton>
<data>
<record model="ir.ui.view" id="asset_view_form">
<field name="model">asset</field>
<field name="type">form</field>
<field name="inherit" ref="asset.asset_view_form"/>
<field name="name">asset_form</field>
</record>
<record model="ir.ui.view" id="asset_building_view_form">
<field name="model">asset.building</field>
<field name="type">form</field>
@ -80,44 +85,21 @@
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
</record>
<record model="ir.ui.view" id="asset_elevator_view_form">
<field name="model">asset.elevator</field>
<field name="type">form</field>
<field name="name">asset_elevator_form</field>
</record>
<record model="ir.ui.view" id="asset_elevator_view_list">
<field name="model">asset.elevator</field>
<field name="type">tree</field>
<field name="name">asset_elevator_list</field>
</record>
<record model="ir.action.act_window" id="act_asset_elevator">
<record model="ir.action.act_window" id="act_asset_elevators">
<field name="name">Elevators</field>
<field name="res_model">asset.elevator</field>
<field name="res_model">asset</field>
<field name="domain">[('type', '=', 'elevator')]</field>
<field name="context">{'type': 'elevator'}</field>
</record>
<record model="ir.action.act_window.view" id="act_asset_elevator_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="asset_elevator_view_list"/>
<field name="act_window" ref="act_asset_elevator"/>
<field name="view" ref="asset.asset_view_list"/>
<field name="act_window" ref="act_asset_elevators"/>
</record>
<record model="ir.action.act_window.view" id="act_asset_elevator_view2">
<field name="sequence" eval="20"/>
<field name="view" ref="asset_elevator_view_form"/>
<field name="act_window" ref="act_asset_elevator"/>
</record>
<record model="ir.model.access" id="access_asset_elevator">
<field name="model" search="[('model', '=', 'asset.elevator')]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_delete" eval="False"/>
</record>
<record model="ir.model.access" id="access_asset_elevator_admin">
<field name="model" search="[('model', '=', 'asset.elevator')]"/>
<field name="group" ref="asset.group_asset"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
<field name="view" ref="asset.asset_view_form"/>
<field name="act_window" ref="act_asset_elevators"/>
</record>
<record model="ir.ui.view" id="asset_elevator_type_view_form">
<field name="model">asset.elevator.type</field>
@ -396,7 +378,7 @@
<menuitem id="menu_asset_elevator" parent="asset.menu_configuration"
sequence="20" name="Elevator"/>
<menuitem action="act_asset_elevator" id="menu_asset_elevator_from"
<menuitem action="act_asset_elevators" id="menu_asset_elevator_from"
parent="asset.menu_asset" sequence="20"/>
<menuitem action="act_asset_elevator_type"

View File

@ -81,6 +81,7 @@
<field name="name">Selective Upload-Download</field>
</record>
<!-- asset.suspension.type-->
<record model="asset.suspension.type" id="telescopic_suspension">
<field name="name">Telescopic</field>
</record>
@ -92,5 +93,16 @@
<record model="asset.suspension.type" id="2_1_suspension">
<field name="name">2:1</field>
</record>
<!-- asset.situation-->
<record model="asset.situation" id="upper_situation">
<field name="name">Upper</field>
</record>
<record model="asset.situation" id="lateral_situation">
<field name="name">Lateral</field>
</record>
<record model="asset.situation" id="lower_situation">
<field name="name">Lower</field>
</record>
</data>
</tryton>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,231 +0,0 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<form string="Elevator">
<label name="code"/>
<field name="code"/>
<label name="active"/>
<field name="active"/>
<label name="asset"/>
<field name="asset"/>
<label name="registry_number"/>
<field name="registry_number"/>
<notebook>
<page id="general" string="General Info">
<label name="type"/>
<field name="type"/>
<label name="building"/>
<field name="building"/>
<label name="provenance"/>
<field name="provenance"/>
<label name="persons"/>
<field name="persons"/>
<label name="stops"/>
<field name="stops"/>
<label name="power"/>
<field name="power"/>
<label name="payload"/>
<field name="payload"/>
<label name="rpm_motor"/>
<field name="rpm_motor"/>
<label name="velocity"/>
<field name="velocity"/>
<label name="path_length"/>
<field name="path_length"/>
<label name="situation"/>
<field name="situation"/>
<label name="administrator"/>
<field name="administrator"/>
<label name="phone"/>
<field name="phone"/>
<label name="gsm"/>
<field name="gsm"/>
</page>
<page id="components" string="Components" col="3">
<group id="machine" col="2">
<separator id="machine" string="Machine" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="machine_brand"/>
<label id="product" string="Product"/>
<field name="machine_product"/>
</group>
<group id="bidirectional" col="2">
<separator id="bidirectional" string="Bidirectional" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="bidirectional_brand"/>
<label id="product" string="Product"/>
<field name="bidirectional_product"/>
</group>
<group id="brake" col="2">
<separator id="brake" string="Brakes" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="brake_brand"/>
<label id="voltage" string="Voltage"/>
<field name="brake_voltage"/>
</group>
<group id="buttons" col="2">
<separator id="buttons" string="Buttons" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="buttons_brand"/>
<label id="product" string="Product"/>
<field name="buttons_product"/>
</group>
<group id="cabin" col="2">
<separator id="cabin" string="Cabin" colspan="2"/>
<label id="depth" string="Depth"/>
<field name="cabin_depth"/>
<label id="width" string="Width"/>
<field name="cabin_width"/>
</group>
<group id="door" col="2">
<separator id="door" string="Door" colspan="2"/>
<label name="door_width"/>
<field name="door_width"/>
<label name="door_height"/>
<field name="door_height"/>
</group>
<group id="displays" col="2">
<separator id="displays" string="Displays" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="displays_brand"/>
<label id="product" string="Product"/>
<field name="displays_product"/>
</group>
<group id="conductors" col="2">
<separator id="conductors" string="Conductors" colspan="2"/>
<label id="number" string="Number"/>
<field name="number_of_conductors"/>
<label id="length" string="Length"/>
<field name="conductors_length"/>
</group>
<group id="contactor" col="2">
<separator id="contactor" string="Contactors" colspan="2"/>
<label id="type" string="Type"/>
<field name="contactor_types"/>
<label id="voltage" string="Voltage"/>
<field name="contactor_voltage"/>
</group>
<group id="pulley" col="2">
<separator id="pulley" string="Pulley" colspan="2"/>
<label name="pulley"/>
<field name="pulley"/>
<label name="deflection_pulley"/>
<field name="deflection_pulley"/>
</group>
<group id="wires" col="2">
<separator id="wires" string="Wires" colspan="2"/>
<label id="number" string="Number"/>
<field name="wire_number"/>
<label id="diameter" string="Diameter"/>
<field name="wire_diameter"/>
<label id="length" string="Length"/>
<field name="wire_lenght"/>
</group>
<group id="hose" col="2">
<separator id="hose" string="Hose" colspan="2"/>
<label id="type" string="Type"/>
<field name="hose_type"/>
<label id="diameter" string="Diameter"/>
<field name="hose_diameter"/>
<label id="length" string="Length"/>
<field name="hose_lenght"/>
</group>
<group id="limiter" col="2">
<separator id="limiter" string="Limiter" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="limiter_brand"/>
<label id="diameter" string="Diameter"/>
<field name="limiter_diameter"/>
<label id="length" string="Length"/>
<field name="limiter_lenght"/>
</group>
<group id="ligth" col="2">
<separator id="light" string="Lights" colspan="2"/>
<label name="light_height"/>
<field name="light_height"/>
<label name="light_width"/>
<field name="light_width"/>
<label name="ligths_voltage"/>
<field name="ligths_voltage"/>
</group>
<group id="cabin_chassis" col="2">
<separator id="cabin_chasis" string="Cabin Chassis" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="cabin_chassis_brand"/>
<label id="product" string="Product"/>
<field name="cabin_chassis_product"/>
<label name="cilinder_brand"/>
<field name="cilinder_brand"/>
</group>
<group id="finish" col="2">
<separator id="finish" string="Finish" colspan="2"/>
<label name="ground_finish"/>
<field name="ground_finish"/>
<label name="roof_finish"/>
<field name="roof_finish"/>
<label name="lateral_finish"/>
<field name="lateral_finish"/>
<newline/>
</group>
<group id="maneveur" col="2">
<separator id="maneveur" string="Maneveur" colspan="2"/>
<label id="type" string="Type"/>
<field name="maneveur_type"/>
<label id="manufacturer" string="Manufacturer"/>
<field name="manevuer_manufacturer"/>
</group>
<group id="parachute" col="2">
<separator id="parachute" string="Parachute" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="parachute_brand"/>
<label name="parachute_counterweight"/>
<field name="parachute_counterweight"/>
</group>
<group id="door_motor" col="2">
<separator id="door_motor" string="Door Motor" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="door_motor_brand"/>
<label id="product" string="Product"/>
<field name="door_motor_product"/>
</group>
<group id="guides" col="2" yfill="1">
<separator id="guides" string="Guides" colspan="2"/>
<label name="cabin_guides"/>
<field name="cabin_guides"/>
<label name="counterweight_guides"/>
<field name="counterweight_guides"/>
</group>
<group id="doors" colspan="2" col="4" yfill="1">
<separator id="doors" string="Doors" colspan="4"/>
<label id="number" string="Number"/>
<field name="doors_number"/>
<label id="brand" string="Brand"/>
<field name="doors_brand"/>
<label id="product" string="Product"/>
<field name="doors_product"/>
<label name="hand"/>
<field name="hand"/>
</group>
<group id="other" col="6" colspan="6">
<separator id="other" string="Other" colspan="6"/>
<label name="suspension_type"/>
<field name="suspension_type"/>
<label name="material_brand"/>
<field name="material_brand"/>
<label name="lleva_voltage"/>
<field name="lleva_voltage"/>
<label name="input_voltage"/>
<field name="input_voltage"/>
<label name="locks_brand"/>
<field name="locks_brand"/>
<label name="landing_door_type"/>
<field name="landing_door_type"/>
</group>
</page>
<page name="notes">
<field name="notes"/>
</page>
</notebook>
</form>

View File

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<tree string="Elevators">
<field name="code"/>
<field name="rec_name"/>
<field name="registry_number"/>
<field name="type"/>
<field name="administrator"/>
<field name="phone"/>
<field name="active" tree_invisible="1"/>
</tree>

268
view/asset_form.xml Normal file
View File

@ -0,0 +1,268 @@
<?xml version="1.0"?>
<!-- The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<data>
<xpath expr="/form/notebook" position="before">
<separator id="elevator" string="Elevator Info" states="{'invisible': Eval('type') != 'elevator'}" colspan="4"/>
<label name="elevator_type"/>
<field name="elevator_type"/>
<label name="administrator"/>
<field name="administrator"/>
<label name="payload"/>
<field name="payload"/>
<label name="persons"/>
<field name="persons"/>
<label name="velocity"/>
<field name="velocity"/>
<label name="path_length"/>
<field name="path_length"/>
<label name="stops"/>
<field name="stops"/>
<label name="registry_number"/>
<field name="registry_number"/>
<label name="building"/>
<field name="building"/>
<label name="provenance"/>
<field name="provenance"/>
<!-- TODO: Add zone here -->
</xpath>
<xpath expr="/form/notebook" position="inside">
<page id="components" string="Components" col="2" states="{'invisible': Eval('type') != 'elevator'}">
<group id="doors_limiter" col="1">
<group id="doors" col="2">
<separator id="doors" string="Doors" colspan="2"/>
<label name="landing_door_type"/>
<field name="landing_door_type"/>
<label id="measurements" string="Mesurements"/>
<group id="door" col="5">
<field name="door_width"/>
<label id="x" string="x" xalign="0.5" xfill="1" xexpand="1"/>
<field name="door_height"/>
<label id="x" string="x" xalign="0.5" xfill="1" xexpand="1"/>
<field name="doors_number"/>
</group>
<label id="brand" string="Brand"/>
<field name="doors_brand"/>
<label name="hand"/>
<field name="hand"/>
<label name="locks_brand"/>
<field name="locks_brand"/>
<label id="product" string="Product"/>
<field name="doors_product"/>
</group>
<group id="limiter" col="2">
<separator id="limiter" string="Limiter" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="limiter_brand"/>
<label id="diameter" string="Diameter"/>
<group col="2" id="limiter_diameter">
<field name="limiter_diameter"/>
<label id="mm" string="mm" xalign="0.0" xexpand="1"/>
</group>
<label id="wire" string="Wire"/>
<group col="3" id="limiter_wire">
<field name="limiter_wire_diameter"/>
<label id="x" string="x" xalign="0.5" xfill="1" xexpand="1"/>
<field name="limiter_wire_lenght"/>
</group>
</group>
</group>
<group id="machine" col="2">
<separator id="machine" string="Machine" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="machine_brand"/>
<label id="product" string="Product"/>
<field name="machine_product"/>
<label name="power"/>
<group col="2" id="power">
<field name="power" xexpand="0"/>
<label id="kw" string="kw" xalign="0.0" xexpand="1"/>
</group>
<label name="pulley"/>
<group col="2" id="pulley">
<field name="pulley" xexpand="0"/>
<label id="mm" string="mm" xalign="0.0" xexpand="1"/>
</group>
<label name="rpm_motor"/>
<field name="rpm_motor"/>
<label id="piston" string="Piston"/>
<field name="piston_diameter"/>
<label name="hose_type"/>
<field name="hose_type"/>
<label id="hose" string="Hose"/>
<group id="hose_group" col="3">
<field name="hose_diameter"/>
<label id="x" string="x" xalign="0.5" xfill="1" xexpand="1"/>
<field name="hose_lenght"/>
</group>
<label name="situation"/>
<field name="situation"/>
<label name="suspension_type"/>
<field name="suspension_type"/>
<label id="wires" string="Wires"/>
<group id="wires" col="5">
<field name="wire_number"/>
<label id="x" string="x" xalign="0.5" xfill="1" xexpand="1"/>
<field name="wire_diameter"/>
<label id="x" string="x" xalign="0.5" xfill="1" xexpand="1"/>
<field name="wire_lenght"/>
</group>
</group>
<group id="guides_fields" colspan="2" col="4">
<label name="cabin_guides"/>
<field name="cabin_guides"/>
<label name="parachute_brand"/>
<field name="parachute_brand"/>
<label name="counterweight_guides"/>
<field name="counterweight_guides"/>
<label name="counterweight_product"/>
<field name="counterweight_product"/>
<label name="parachute_counterweight"/>
<field name="parachute_counterweight"/>
</group>
<group id="cabin" col="2">
<separator id="cabin" string="Cabin" colspan="2"/>
<label id="measurements" string="Mesurements"/>
<group id="cabin_measurements" col="4">
<field name="cabin_depth"/>
<label id="x" string="x" xalign="0.5" xfill="1" xexpand="1"/>
<field name="cabin_width"/>
<label id="mm" string="mm" xalign="0.0" xexpand="1"/>
</group>
<label id="accesses" string="Accesses"/>
<field name="cabin_accesses"/>
<label id="doors" string="Doors"/>
<field name="cabin_doors"/>
<label name="phone"/>
<field name="phone"/>
<label id="doors_module" string="Doors Module"/>
<field name="cabin_doors_module"/>
<label id="ligths" string="Ligths"/>
<group id="ligth" col="3">
<field name="light_height"/>
<label id="x" string="x" xalign="0.5" xfill="1" xexpand="1"/>
<field name="light_width"/>
</group>
<label name="ground_finish"/>
<field name="ground_finish"/>
<label name="roof_finish"/>
<field name="roof_finish"/>
<label name="lateral_finish"/>
<field name="lateral_finish"/>
</group>
<group id="voltages_buttons" col="1">
<group id="maneveur" col="2">
<separator id="maneveur" string="Maneveur" colspan="2"/>
<label id="manufacturer" string="Manufacturer"/>
<field name="manevuer_manufacturer"/>
<label id="type" string="Type"/>
<field name="maneveur_type"/>
</group>
<group id="voltages" col="2">
<separator id="voltages" string="Voltages" colspan="2"/>
<label name="input_voltage"/>
<field name="input_voltage"/>
<label name="brake_voltage"/>
<field name="brake_voltage"/>
<label name="contactor_voltage"/>
<field name="contactor_voltage"/>
<label name="lleva_voltage"/>
<field name="lleva_voltage"/>
<label name="ligths_voltage"/>
<field name="ligths_voltage"/>
</group>
<group id="buttons" col="2">
<separator id="buttons" string="Buttons" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="buttons_brand"/>
<label id="product" string="Product"/>
<field name="buttons_product"/>
</group>
</group>
<group id="displays" col="2">
<separator id="displays" string="Displays" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="displays_brand"/>
<label id="product" string="Product"/>
<field name="displays_product"/>
</group>
<group id="conductors" col="2">
<separator id="conductors" string="Hose Maneveur" colspan="2"/>
<label id="conductors" string="Conductors"/>
<group id="conductors" col="3">
<field name="number_of_conductors"/>
<label id="x" string="x" xalign="0.5" xfill="1" xexpand="1"/>
<field name="conductors_length"/>
</group>
<label name="conductors_connection"/>
<field name="conductors_connection"/>
</group>
<group id="buttons_numeration" col="2">
<separator id="buttons_numeration" string="Buttons Numeration"
colspan="2"/>
<label id="cabin" string="Cabin"/>
<field name="cabin_buttons"/>
<label id="main_floor" string="Main Floor"/>
<field name="main_buttons"/>
<label id="other_floor" string="Other Floor"/>
<field name="other_buttons"/>
</group>
<group id="bidirectional" col="2">
<separator id="bidirectional" string="Bidirectional" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="bidirectional_brand"/>
<label id="product" string="Product"/>
<field name="bidirectional_product"/>
<label name="gsm"/>
<field name="gsm"/>
</group>
<group id="contactor" col="2">
<separator id="contactor" string="Contactors" colspan="2"/>
<label id="type" string="Type"/>
<field name="contactor_types"/>
</group>
<group id="other" col="6" colspan="6">
<separator id="other" string="Other" colspan="6"/>
<label name="manufacturer"/>
<field name="manufacturer"/>
<label name="conservative"/>
<field name="conservative"/>
<label name="general_state"/>
<field name="general_state"/>
<label name="reformed"/>
<field name="reformed"/>
<label name="in_normative"/>
<field name="in_normative"/>
</group>
<group id="cabin_chassis" col="2">
<separator id="cabin_chasis" string="Cabin Chassis" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="cabin_chassis_brand"/>
<label id="product" string="Product"/>
<field name="cabin_chassis_product"/>
<label name="cilinder_brand"/>
<field name="cilinder_brand"/>
</group>
<group id="door_motor" col="2">
<separator id="door_motor" string="Door Motor" colspan="2"/>
<label id="brand" string="Brand"/>
<field name="door_motor_brand"/>
<label id="product" string="Product"/>
<field name="door_motor_product"/>
<label name="deflection_pulley"/>
<field name="deflection_pulley"/>
</group>
<group id="brands" col="6" colspan="2">
<separator id="brands" string="Brands" colspan="6"/>
<label name="material_brand"/>
<field name="material_brand"/>
<label name="brake_brand"/>
<field name="brake_brand"/>
</group>
</page>
<page name="notes">
<field name="notes"/>
</page>
</xpath>
</data>