Default environmental conditions in the initial button of customer delivery notes
This commit is contained in:
parent
1a13fbfa98
commit
b9aa95516d
@ -145,6 +145,22 @@ class MaintenanceService(Workflow, ModelSQL, ModelView):
|
||||
moisture_min = config.moisture_min
|
||||
return moisture_min
|
||||
|
||||
@staticmethod
|
||||
def default_temperature_uom():
|
||||
pool = Pool()
|
||||
Config = pool.get('optical_equipment.configuration')
|
||||
config = Config(1)
|
||||
temperature_uom = config.temperature_uom.id
|
||||
return temperature_uom
|
||||
|
||||
@staticmethod
|
||||
def default_moisture_uom():
|
||||
pool = Pool()
|
||||
Config = pool.get('optical_equipment.configuration')
|
||||
config = Config(1)
|
||||
moisture_uom = config.moisture_uom.id
|
||||
return moisture_uom
|
||||
|
||||
@staticmethod
|
||||
def default_moisture_max():
|
||||
pool = Pool()
|
||||
@ -152,7 +168,7 @@ class MaintenanceService(Workflow, ModelSQL, ModelView):
|
||||
config = Config(1)
|
||||
moisture_max = config.moisture_max
|
||||
return moisture_max
|
||||
|
||||
|
||||
@classmethod
|
||||
def default_maintenance_type(self):
|
||||
return 'preventive'
|
||||
@ -164,21 +180,7 @@ class MaintenanceService(Workflow, ModelSQL, ModelView):
|
||||
@classmethod
|
||||
def default_state(self):
|
||||
return 'draft'
|
||||
|
||||
@fields.depends('temperature_min', 'temperature_uom')
|
||||
def on_change_temperature_min(self):
|
||||
if self.temperature_min:
|
||||
pool = Pool()
|
||||
Measurements = pool.get('product.uom')
|
||||
self.temperature_uom = Measurements.search(['name', '=', 'Celsius'])[0].id
|
||||
|
||||
|
||||
@fields.depends('moisture_min', 'moisture_uom')
|
||||
def on_change_moisture_min(self):
|
||||
pool = Pool()
|
||||
Measurements = pool.get('product.uom')
|
||||
self.moisture_uom = Measurements.search(['name', '=', 'Relative Humedity'])[0].id
|
||||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
'Return list of Model names for origin Reference'
|
||||
|
8
move.py
8
move.py
@ -170,7 +170,13 @@ class ShipmentOut(metaclass=PoolMeta):
|
||||
check_electric_system = move.equipment.product.check_electric_system,
|
||||
clean_int_ext = move.equipment.product.clean_int_ext,
|
||||
clean_eyes = move.equipment.product.clean_eyes,
|
||||
check_calibration = move.equipment.product.check_calibration)
|
||||
check_calibration = move.equipment.product.check_calibration,
|
||||
temperature_min = maintenanceService.temperature_min,
|
||||
temperature_max = maintenanceService.temperature_max,
|
||||
temperature_uom = maintenanceService.temperature_uom.id,
|
||||
moisture_min = maintenanceService.moisture_min,
|
||||
moisture_max = maintenanceService.moisture_max,
|
||||
moisture_uom = maintenanceService.moisture_uom.id)
|
||||
maintenance.save()
|
||||
shipment.service_maintenance_initial = True
|
||||
shipment.save()
|
||||
|
Loading…
Reference in New Issue
Block a user