Refactor Journal and Journal Entry models to strictly use Vision ID string pattern
Updated Journal_Base and Journal_Entry_Base to explicitly remove integer IDs (journal_id, journal_entry_id) during validation to prevent mixed-type ID collisions. This ensures the Journal module adheres to the highest V3 Vision standard compliance.
This commit is contained in:
@@ -130,7 +130,7 @@ class Journal_Entry_Base(BaseModel):
|
||||
values['parent_id'] = p_rid
|
||||
|
||||
# 2. Prevent "Collision Population"
|
||||
for k in ['id', 'journal_id', 'account_id', 'parent_id']:
|
||||
for k in ['id', 'journal_entry_id', 'journal_id', 'account_id', 'parent_id']:
|
||||
if k in values and not isinstance(values[k], str):
|
||||
del values[k]
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ class Journal_Base(BaseModel):
|
||||
values['user_id'] = u_rid
|
||||
|
||||
# 2. Prevent "Collision Population"
|
||||
for k in ['id', 'account_id', 'person_id', 'user_id']:
|
||||
for k in ['id', 'journal_id', 'account_id', 'person_id', 'user_id']:
|
||||
if k in values and not isinstance(values[k], str):
|
||||
del values[k]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user