Skip to content

[14.0][FIX] l10n_br_account_payment_order safe guard mig #3785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from

Conversation

rvalyi
Copy link
Member

@rvalyi rvalyi commented May 9, 2025

safe guard migration se a tabela l10n_br_cnab_boleto_wallet_code não existe, por exemplo porque o banco é migrado a partir da 12.0.

o l10n_br_cnab.code pode tb não ser possível de criar caso já existe um código com a mesma restrição de unicidade. Por isso eu botei um try.

O segundo commit evita blocar em casos como:

  File "/odoo/external-src/l10n-brazil/l10n_br_account_payment_order/migrations/14.0.7.0.0/post-migration.py", line 113, in update_payment_mode_inbound
    cnab_config.write(
  File "/odoo/src/addons/mail/models/mail_thread.py", line 322, in write
    result = super(MailThread, self).write(values)
  File "/odoo/external-src/connector/component_event/models/base.py", line 109, in write
    result = super(Base, self).write(vals)
  File "/odoo/src/odoo/models.py", line 3716, in write
    real_recs._validate_fields(vals, inverse_fields)
  File "/odoo/src/odoo/models.py", line 1277, in _validate_fields
    check(self)
  File "/odoo/external-src/l10n-brazil/l10n_br_account_payment_order/models/l10n_br_cnab_config.py", line 139, in _check_sequences
    raise ValidationError(
odoo.exceptions.ValidationError: Sequence Own Number already in use by Cooperativa Central de Crédito - Ailos - CNAB 240 (inbound)!

@OCA-git-bot
Copy link
Contributor

Hi @mbcosta,
some modules you are maintaining are being modified, check this out!

@rvalyi rvalyi requested review from mbcosta and antoniospneto May 9, 2025 16:36
@rvalyi rvalyi added the 14.0 label May 9, 2025
@rvalyi rvalyi force-pushed the 14.0-safe-guard-payment-migr branch from a5fada1 to de89b35 Compare May 9, 2025 16:44
@rvalyi rvalyi force-pushed the 14.0-safe-guard-payment-migr branch from de89b35 to abae4d4 Compare May 9, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants