Sync system default active state to firm tasks
This commit is contained in:
@@ -70,11 +70,16 @@ def _copy_default_columns(
|
||||
setattr(target, name, new_value)
|
||||
changed = True
|
||||
|
||||
# System defaults being synced are expected to be usable in the firm.
|
||||
if hasattr(target, "is_active") and getattr(target, "is_active", None) is not True:
|
||||
target.is_active = True
|
||||
changed = True
|
||||
|
||||
# IMPORTANT:
|
||||
# is_active is copied from ServiceDefaultTaskTemplate above because it is
|
||||
# a shared mapped column. Do NOT force FirmServiceTaskTemplate back to True.
|
||||
#
|
||||
# This makes System Default activation state authoritative during sync:
|
||||
# System Default disabled -> Firm Task disabled
|
||||
# System Default enabled -> Firm Task enabled
|
||||
#
|
||||
# Firm-only/custom tasks remain untouched because this function is called
|
||||
# only for tasks matched to current System Defaults.
|
||||
return changed
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user