changes
This commit is contained in:
@@ -104,7 +104,7 @@ class FusionAccountingRule(models.Model):
|
||||
if (rec.approval_tier == 'needs_approval'
|
||||
and rec.total_uses >= rec.min_sample_size
|
||||
and rec.confidence_score >= rec.promotion_threshold):
|
||||
rec.approval_tier = 'auto'
|
||||
rec.write({'approval_tier': 'auto'})
|
||||
_logger.info(
|
||||
"Rule '%s' promoted to auto-approved (confidence=%.2f, uses=%d)",
|
||||
rec.name, rec.confidence_score, rec.total_uses,
|
||||
@@ -116,5 +116,6 @@ class FusionAccountingRule(models.Model):
|
||||
def action_rollback(self):
|
||||
for rec in self:
|
||||
if rec.parent_rule_id:
|
||||
rec.active = False
|
||||
rec.parent_rule_id.active = True
|
||||
# M5: Use write() to trigger tracking on tracked fields
|
||||
rec.write({'active': False})
|
||||
rec.parent_rule_id.write({'active': True})
|
||||
|
||||
Reference in New Issue
Block a user