add atribute template of product 'replacement' and 'maintenance_activity'
This commit is contained in:
parent
6ee312bb2e
commit
97a1f77fbc
@ -7,6 +7,7 @@ class Maintenance(Workflow, ModelSQL, ModelView):
|
|||||||
'Equipment Maintenance'
|
'Equipment Maintenance'
|
||||||
__name__ = 'optical_equipment.maintenance'
|
__name__ = 'optical_equipment.maintenance'
|
||||||
|
|
||||||
|
|
||||||
code = fields.Char(
|
code = fields.Char(
|
||||||
"Code", select=True,states={'readonly': True })
|
"Code", select=True,states={'readonly': True })
|
||||||
|
|
||||||
@ -17,11 +18,22 @@ class Maintenance(Workflow, ModelSQL, ModelView):
|
|||||||
], "State",required=True, readonly=True, sort=False)
|
], "State",required=True, readonly=True, sort=False)
|
||||||
|
|
||||||
company = fields.Many2One('company.company', "Company", readonly=True)
|
company = fields.Many2One('company.company', "Company", readonly=True)
|
||||||
propietary = fields.Many2One('party.party', "Propietary")
|
propietary = fields.Many2One('party.party', "Propietary", required=True)
|
||||||
propietary_address = fields.Many2One('party.address', "Propietary Address", required=True,
|
propietary_address = fields.Many2One('party.address', "Propietary Address", required=True,
|
||||||
domain=[('party', '=', Eval('propietary'))]
|
domain=[('party', '=', Eval('propietary'))]
|
||||||
)
|
)
|
||||||
|
equipment = fields.Many2One('optical_equipment.equipment', "Equipment",
|
||||||
|
domain=[])
|
||||||
|
|
||||||
|
|
||||||
|
#when the maintenance is in agended status
|
||||||
|
estimated_agended = fields.DateTime("Date Maintenance")
|
||||||
|
technical = fields.Many2One('company.employee')
|
||||||
|
|
||||||
|
maintenance_lines = fields.One2Many('optical_equipment.maintenance.line', 'maintenance',
|
||||||
|
'Maintenance Lines', states={
|
||||||
|
'readonly': Eval('state') != 'draft',})
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
super(Maintenance, cls).__setup__()
|
super(Maintenance, cls).__setup__()
|
||||||
@ -65,3 +77,7 @@ class Maintenance(Workflow, ModelSQL, ModelView):
|
|||||||
@Workflow.transition('finished')
|
@Workflow.transition('finished')
|
||||||
def finished(cls, maintenances):
|
def finished(cls, maintenances):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class MaintenanceLine(ModelSQL, ModelView):
|
||||||
|
'Maintenance Line'
|
||||||
|
__name__ = 'optical_equipment.maintenance.line'
|
||||||
|
@ -50,6 +50,14 @@ class Template(metaclass=PoolMeta):
|
|||||||
equipment = fields.Boolean('It is equipment',
|
equipment = fields.Boolean('It is equipment',
|
||||||
states={'invisible': Eval('type', 'goods') != 'goods',
|
states={'invisible': Eval('type', 'goods') != 'goods',
|
||||||
},depends=['type'])
|
},depends=['type'])
|
||||||
|
|
||||||
|
maintenance_activity = fields.Boolean('Maintenance Activity',
|
||||||
|
states={'invisible': Eval('type', 'service') != 'service',
|
||||||
|
},depends=['type'])
|
||||||
|
replacement = fields.Boolean('Replacement',
|
||||||
|
states={'invisible': Eval('type', 'goods') != 'goods',
|
||||||
|
},depends=['type'])
|
||||||
|
|
||||||
equipment_type = fields.Selection(_EQUIPMENT_TYPE, 'Equipment type',
|
equipment_type = fields.Selection(_EQUIPMENT_TYPE, 'Equipment type',
|
||||||
states={'required': Eval('equipment', False)},
|
states={'required': Eval('equipment', False)},
|
||||||
depends=['equipment']
|
depends=['equipment']
|
||||||
|
@ -2,18 +2,31 @@
|
|||||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||||
this repository contains the full copyright notices and license terms. -->
|
this repository contains the full copyright notices and license terms. -->
|
||||||
<form>
|
<form>
|
||||||
<label name="code"/>
|
|
||||||
<field name="code"/>
|
|
||||||
<label name="company"/>
|
<label name="company"/>
|
||||||
<field name="company"/>
|
<field name="company"/>
|
||||||
|
<label name="code"/>
|
||||||
|
<field name="code"/>
|
||||||
<label name="propietary"/>
|
<label name="propietary"/>
|
||||||
<field name="propietary"/>
|
<field name="propietary"/>
|
||||||
<label name="propietary_address"/>
|
<label name="propietary_address"/>
|
||||||
<field name="propietary_address"/>
|
<field name="propietary_address"/>
|
||||||
|
<label name="equipment"/>
|
||||||
|
<field name="equipment"/>
|
||||||
|
<newline/>
|
||||||
|
<label name="estimated_agended"/>
|
||||||
|
<field name="estimated_agended"/>
|
||||||
|
<label name="estimated_date"/>
|
||||||
|
<field name="estimated_date"/>
|
||||||
|
<label name="estimated_hour"/>
|
||||||
|
<field name="estimated_hour"/>
|
||||||
|
<newline/>
|
||||||
|
<label name="technical"/>
|
||||||
|
<field name="technical"/>
|
||||||
|
<newline/>
|
||||||
<label name="state"/>
|
<label name="state"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<group col="2" colspan="2" id="button">
|
<group col="4" colspan="4" id="button">
|
||||||
<button name="draf"/>
|
<button name="draft"/>
|
||||||
<button name="agended"/>
|
<button name="agended"/>
|
||||||
<button name="in_progress"/>
|
<button name="in_progress"/>
|
||||||
<button name="finished"/>
|
<button name="finished"/>
|
||||||
|
@ -6,4 +6,5 @@
|
|||||||
<field name="company"/>
|
<field name="company"/>
|
||||||
<field name="propietary"/>
|
<field name="propietary"/>
|
||||||
<field name="propietary_address"/>
|
<field name="propietary_address"/>
|
||||||
|
<field name="equipment"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
@ -5,6 +5,10 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<xpath expr="/form/notebook/page[@id='general']/group[@id='checkboxes']" position="inside">
|
<xpath expr="/form/notebook/page[@id='general']/group[@id='checkboxes']" position="inside">
|
||||||
<label name="equipment"/>
|
<label name="equipment"/>
|
||||||
<field name="equipment"/>
|
<field name="equipment"/>
|
||||||
|
<label name="replacement"/>
|
||||||
|
<field name="replacement"/>
|
||||||
|
<label name="maintenance_activity"/>
|
||||||
|
<field name="maintenance_activity"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="/form/notebook/page[@id='general']" position="after">
|
<xpath expr="/form/notebook/page[@id='general']" position="after">
|
||||||
<page string="Features" id="features">
|
<page string="Features" id="features">
|
||||||
|
Loading…
Reference in New Issue
Block a user