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)
|
setattr(target, name, new_value)
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
# System defaults being synced are expected to be usable in the firm.
|
# IMPORTANT:
|
||||||
if hasattr(target, "is_active") and getattr(target, "is_active", None) is not True:
|
# is_active is copied from ServiceDefaultTaskTemplate above because it is
|
||||||
target.is_active = True
|
# a shared mapped column. Do NOT force FirmServiceTaskTemplate back to True.
|
||||||
changed = 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
|
return changed
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user