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'
|
||||
__name__ = 'optical_equipment.maintenance'
|
||||
|
||||
|
||||
code = fields.Char(
|
||||
"Code", select=True,states={'readonly': True })
|
||||
|
||||
@ -17,10 +18,21 @@ class Maintenance(Workflow, ModelSQL, ModelView):
|
||||
], "State",required=True, readonly=True, sort=False)
|
||||
|
||||
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,
|
||||
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
|
||||
def __setup__(cls):
|
||||
@ -65,3 +77,7 @@ class Maintenance(Workflow, ModelSQL, ModelView):
|
||||
@Workflow.transition('finished')
|
||||
def finished(cls, maintenances):
|
||||
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',
|
||||
states={'invisible': Eval('type', 'goods') != 'goods',
|
||||
},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',
|
||||
states={'required': Eval('equipment', False)},
|
||||
depends=['equipment']
|
||||
|
@ -2,18 +2,31 @@
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<form>
|
||||
<label name="code"/>
|
||||
<field name="code"/>
|
||||
<label name="company"/>
|
||||
<field name="company"/>
|
||||
<label name="code"/>
|
||||
<field name="code"/>
|
||||
<label name="propietary"/>
|
||||
<field name="propietary"/>
|
||||
<label 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"/>
|
||||
<field name="state"/>
|
||||
<group col="2" colspan="2" id="button">
|
||||
<button name="draf"/>
|
||||
<group col="4" colspan="4" id="button">
|
||||
<button name="draft"/>
|
||||
<button name="agended"/>
|
||||
<button name="in_progress"/>
|
||||
<button name="finished"/>
|
||||
|
@ -6,4 +6,5 @@
|
||||
<field name="company"/>
|
||||
<field name="propietary"/>
|
||||
<field name="propietary_address"/>
|
||||
<field name="equipment"/>
|
||||
</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">
|
||||
<label name="equipment"/>
|
||||
<field name="equipment"/>
|
||||
<label name="replacement"/>
|
||||
<field name="replacement"/>
|
||||
<label name="maintenance_activity"/>
|
||||
<field name="maintenance_activity"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/notebook/page[@id='general']" position="after">
|
||||
<page string="Features" id="features">
|
||||
|
Loading…
Reference in New Issue
Block a user