Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions l10n_uy_ux/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _uy_get_legends_recs(self, tipo_leyenda, record):
res |= rec
return res

@api.constrains("move_type", "journal_id", "name")
@api.constrains("move_type", "journal_id")
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the 'name' field from the constraint may allow invalid records to pass validation. The constraint was previously triggered when the name field changed, which could be important for detecting when draft moves get sequence numbers assigned. Consider whether this validation should still run when the name field is modified.

Suggested change
@api.constrains("move_type", "journal_id")
@api.constrains("move_type", "journal_id", "name")

Copilot uses AI. Check for mistakes.
def _uy_ux_check_moves_use_documents(self):
"""Do not let to create not invoices entries in journals that use documents"""
# TODO simil to _check_moves_use_documents. integrate somehow
Expand All @@ -314,7 +314,6 @@ def _uy_ux_check_moves_use_documents(self):
and x.journal_id.type in ["sale", "purchase"]
and x.l10n_latam_use_documents
and not x.is_invoice()
and x.name not in ["/", False]
)
if not_invoices:
raise ValidationError(
Expand Down