2
0

[FIX] account_move_name_sequence: computed fields raising warning

This commit is contained in:
remi-filament 2023-03-15 11:45:31 +01:00
parent d1a9010e50
commit 550df5a298
2 changed files with 7 additions and 1 deletions

View File

@ -34,6 +34,9 @@ class AccountJournal(models.Model):
)
# Redefine the default to True as <=v13.0
refund_sequence = fields.Boolean(default=True)
# has_sequence_holes is not relevant anymore (since based on sequence_prefix/number)
# -> compute=False to improve perf and to avoid displaying warning
has_sequence_holes = fields.Boolean(compute=False)
@api.constrains("refund_sequence_id", "sequence_id")
def _check_journal_sequence(self):

View File

@ -9,11 +9,14 @@ class AccountMove(models.Model):
_inherit = "account.move"
name = fields.Char(compute="_compute_name_by_sequence")
# highest_name, sequence_prefix and sequence_number are not needed any more
# highest_name, sequence_prefix, sequence_number are not needed any more
# -> compute=False to improve perf
highest_name = fields.Char(compute=False)
sequence_prefix = fields.Char(compute=False)
sequence_number = fields.Integer(compute=False)
# made_sequence_hole is not relevant anymore (since based on sequence_prefix/number)
# -> compute=False to improve perf and to avoid displaying warning
made_sequence_hole = fields.Boolean(compute=False)
_sql_constraints = [
(