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
|
moisture_min = config.moisture_min
|
||||||
return 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
|
@staticmethod
|
||||||
def default_moisture_max():
|
def default_moisture_max():
|
||||||
pool = Pool()
|
pool = Pool()
|
||||||
@ -165,20 +181,6 @@ class MaintenanceService(Workflow, ModelSQL, ModelView):
|
|||||||
def default_state(self):
|
def default_state(self):
|
||||||
return 'draft'
|
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
|
@classmethod
|
||||||
def _get_origin(cls):
|
def _get_origin(cls):
|
||||||
'Return list of Model names for origin Reference'
|
'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,
|
check_electric_system = move.equipment.product.check_electric_system,
|
||||||
clean_int_ext = move.equipment.product.clean_int_ext,
|
clean_int_ext = move.equipment.product.clean_int_ext,
|
||||||
clean_eyes = move.equipment.product.clean_eyes,
|
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()
|
maintenance.save()
|
||||||
shipment.service_maintenance_initial = True
|
shipment.service_maintenance_initial = True
|
||||||
shipment.save()
|
shipment.save()
|
||||||
|
Loading…
Reference in New Issue
Block a user