La mise à jour d'un type de produit ignorait s'il était un type système.
This commit is contained in:
parent
dd480d72c0
commit
dd36390a08
|
@ -56,7 +56,8 @@ class MaterialTypeServiceImpl(repository: MaterialTypeRepository, private val ma
|
|||
MaterialType(
|
||||
id = id,
|
||||
name = if (name.isNotBlank()) name else persistedMaterialType.name,
|
||||
prefix = if (prefix.isNotBlank()) prefix else persistedMaterialType.prefix
|
||||
prefix = if (prefix.isNotBlank()) prefix else persistedMaterialType.prefix,
|
||||
systemType = systemType
|
||||
)
|
||||
})
|
||||
}
|
||||
|
@ -75,7 +76,7 @@ class MaterialTypeServiceImpl(repository: MaterialTypeRepository, private val ma
|
|||
fun saveOrUpdateSystemType(type: MaterialType) {
|
||||
if (existsByName(type.name)) {
|
||||
val persistedMaterialType = getByName(type.name)
|
||||
update(materialType(type, newId = persistedMaterialType.id))
|
||||
update(materialType(type, newId = persistedMaterialType.id, newSystemType = true))
|
||||
} else {
|
||||
save(type)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue