add maintenance_lines
This commit is contained in:
parent
97a1f77fbc
commit
a5c58d104e
@ -15,6 +15,7 @@ def register():
|
||||
equipment.OpticalEquipment,
|
||||
configuration_equipment.Configuration,
|
||||
maintenance.Maintenance,
|
||||
maintenance.MaintenanceLine,
|
||||
subscription.Subscription,
|
||||
subscription.SubscriptionEquipment,
|
||||
module='optical_equipment', type_='model')
|
||||
|
@ -1,7 +1,7 @@
|
||||
from trytond.model import (
|
||||
Workflow, ModelSQL, ModelView, Unique, fields)
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pyson import Eval
|
||||
from trytond.pyson import Eval, If
|
||||
|
||||
class Maintenance(Workflow, ModelSQL, ModelView):
|
||||
'Equipment Maintenance'
|
||||
@ -53,7 +53,10 @@ class Maintenance(Workflow, ModelSQL, ModelView):
|
||||
def default_company():
|
||||
return Transaction().context.get('company')
|
||||
|
||||
|
||||
@classmethod
|
||||
def default_state(cls):
|
||||
return 'draft'
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('draft')
|
||||
@ -81,3 +84,13 @@ class Maintenance(Workflow, ModelSQL, ModelView):
|
||||
class MaintenanceLine(ModelSQL, ModelView):
|
||||
'Maintenance Line'
|
||||
__name__ = 'optical_equipment.maintenance.line'
|
||||
|
||||
maintenance_acitivity = fields.Many2One('product.product', 'Product',
|
||||
ondelete='RESTRICT',
|
||||
domain=[If(Eval('state').in_(['draft']),
|
||||
('maintenance_activity', '=', True),()),])
|
||||
|
||||
maintenance_acitivity = fields.Many2One('product.product', 'Product',
|
||||
ondelete='RESTRICT',
|
||||
domain=[If(Eval('state').in_(['draft']),
|
||||
('replacement', '=', True),()),])
|
||||
|
@ -15,14 +15,14 @@
|
||||
<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="maintenance_lines"/>
|
||||
<field name="maintenance_lines"/>
|
||||
<field name="maintenance_lines"/>
|
||||
<newline/>
|
||||
<label name="state"/>
|
||||
<field name="state"/>
|
||||
<group col="4" colspan="4" id="button">
|
||||
|
Loading…
Reference in New Issue
Block a user