Skip to content

Commit

Permalink
[FIX] account_journal: remove restriction to archived users
Browse files Browse the repository at this point in the history
  • Loading branch information
augusto-weiss committed Jan 26, 2022
1 parent f8794a9 commit b92c2c2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions account_journal_security/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ class Users(models.Model):
'Modification Journals',
context={'active_test': False},
)

# Cuando un usuario es archivado limpiamos los campos modification_journal_ids
# y journal_ids para evitar problemas, ya que en el metodo unset_modification_user_ids(self)
# no se limpiaban los usuarios archivados.
# TODO ver mejora para v15 (posible compute/inverse)
def write(self, vals):
if 'active' in vals and not vals.get('active'):
vals.update({
'modification_journal_ids': [(5, 0, 0)],
'journal_ids': [(5, 0, 0)],
})
return super().write(vals)

0 comments on commit b92c2c2

Please sign in to comment.