Skip to content
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

[16.0] update in Odoo account module broke l10n_br_account module #3617

Open
rvalyi opened this issue Feb 10, 2025 · 1 comment
Open

[16.0] update in Odoo account module broke l10n_br_account module #3617

rvalyi opened this issue Feb 10, 2025 · 1 comment
Labels

Comments

@rvalyi
Copy link
Member

rvalyi commented Feb 10, 2025

Depois da atualização odoo/odoo@cc3a060 os testes na localização na v16 não passam mais. Essas mudanças ficaram incompativeis com as extensões do account.move ou do account.move.line no modulo l10n_br_account.

Erros como esse aparecem:

2025-02-10 14:47:49,240 22786 INFO odoo16 odoo.addons.l10n_br_account.tests.test_invoice_refund: Starting TestInvoiceRefund.test_refund ...
2025-02-10 14:47:49,516 22786 INFO odoo16 odoo.models.unlink: User #1 deleted account.move.line records with IDs: [946]
2025-02-10 14:47:50,032 22786 INFO odoo16 odoo.models.unlink: User #1 deleted account.move.line records with IDs: [949]
2025-02-10 14:47:50,374 22786 INFO odoo16 odoo.models.unlink: User #1 deleted account.move.line records with IDs: [952]
2025-02-10 14:47:50,432 22786 INFO odoo16 odoo.addons.l10n_br_account.tests.test_invoice_refund: ======================================================================
2025-02-10 14:47:50,433 22786 ERROR odoo16 odoo.addons.l10n_br_account.tests.test_invoice_refund: ERROR: TestInvoiceRefund.test_refund
Traceback (most recent call last):
  File "/home/rvalyi/DEV/odoo16/odoo/external-src/l10n-brazil/l10n_br_account/tests/test_invoice_refund.py", line 126, in test_refund
    reversal = move_reversal.reverse_moves()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rvalyi/DEV/odoo16/odoo/external-src/l10n-brazil/l10n_br_account/wizards/account_move_reversal.py", line 23, in reverse_moves
    ).reverse_moves()
      ^^^^^^^^^^^^^^^
  File "/home/rvalyi/DEV/odoo16/odoo/src/addons/account/wizard/account_move_reversal.py", line 150, in reverse_moves
    new_moves = moves._reverse_moves(default_values_list, cancel=is_cancel_needed)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rvalyi/DEV/odoo16/odoo/external-src/l10n-brazil/l10n_br_account/models/account_move.py", line 583, in _reverse_moves
    raise UserError(
odoo.exceptions.UserError: Document without Return Fiscal Operation!
 Force one!

[...]

2025-02-10 13:56:28,419 30389 INFO odoo16 odoo.tests.suite: ======================================================================
2025-02-10 13:56:28,419 30389 ERROR odoo16 odoo.tests.suite: ERROR: setUpClass (odoo.addons.l10n_br_account.tests.test_account_move_sn.AccountMoveSimpleNacional)
Traceback (most recent call last):
  File "/home/rvalyi/DEV/odoo16/odoo/external-src/l10n-brazil/l10n_br_account/tests/test_account_move_sn.py", line 41, in setUpClass
    cls.move_out_revenda = cls.init_invoice(
                           ^^^^^^^^^^^^^^^^^
  File "/home/rvalyi/DEV/odoo16/odoo/external-src/l10n-brazil/l10n_br_account/tests/common.py", line 341, in init_invoice
    rslt = move_form.save()
           ^^^^^^^^^^^^^^^^
  File "/home/rvalyi/DEV/odoo16/odoo/src/odoo/tests/common.py", line 2374, in save
    r = self._model.create(values)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<decorator-gen-116>", line 2, in create
  File "/home/rvalyi/DEV/odoo16/odoo/src/odoo/api.py", line 414, in _model_create_multi
    return create(self, [arg])
           ^^^^^^^^^^^^^^^^^^^
  File "/home/rvalyi/DEV/odoo16/odoo/external-src/l10n-brazil/l10n_br_account/models/account_move.py", line 442, in create
    invoice = super(AccountMove, self.with_context(create_from_move=True)).create(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<decorator-gen-66>", line 2, in create
  File "/home/rvalyi/DEV/odoo16/odoo/src/odoo/api.py", line 415, in _model_create_multi
    return create(self, arg)
           ^^^^^^^^^^^^^^^^^
  File "/home/rvalyi/DEV/odoo16/odoo/src/addons/account/models/account_move.py", line 2303, in create
    with self._check_balanced(container):
  File "/usr/lib/python3.11/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/home/rvalyi/DEV/odoo16/odoo/src/addons/account/models/account_move.py", line 1772, in _check_balanced
    raise UserError(error_msg)
odoo.exceptions.UserError: An error has occurred.

The move (Draft Invoice INV/2019/00001) is not balanced.
The total of debits equals R$ 1,000.00 and the total of credits equals R$ 0.00.
You might want to specify a default account on journal "Customer Invoices" to automatically balance each move.

Por enquanto é bom não atualizar o codigo do Odoo CE se vc estiver usando a localização na 16.0.

Estamos buscando uma solução...

cc @renatonlima @mbcosta @marcelsavegnago @antoniospneto

@rvalyi
Copy link
Member Author

rvalyi commented Feb 10, 2025

Eu diria que depois de 1 dia, eu resolvi de uma forma aceitável aqui #3618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant