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