OCA/account-financial-tools

[14.0]account_move_name_sequence impossible to post an account.move

flotho opened this issue · 8 comments

flotho commented

Module

account_move_name_sequence

Describe the bug

Hi @alexis-via We're no more able to post an account.move because of this constraints d8ca0ae

Apparently we're not alone on this issue :

And it seems that @fernandahf proposal here #1514 is not enough

To Reproduce

Affected versions: 14.0

Steps to reproduce the behavior:

  1. setup a journal properly with sequences
  2. create an account move for this journal
  3. try to post the move

Expected behavior
move is posted with proper sequence

additionnal context

I've made some search and what I observe is that when calling the write method here https://github.com/OCA/OCB/blob/14.0/addons/account/models/account_move.py#L2759 it doesn't trigger the compute here https://github.com/OCA/account-financial-tools/blob/16.0/account_move_name_sequence/models/account_move.py#L32 so the move is never considered as state = posted by the ORM by finally it is by the SQL constraints here https://github.com/OCA/account-financial-tools/blob/16.0/account_move_name_sequence/models/account_move.py#L21

flotho commented

Hum...
It seems that processing a base_automation is responsible of this. Looks like it commiting the transaction and breaking your flow.

flotho commented

I've checked the validity of the automated action and it's legal

Apparently we're not alone on this issue...

Yes, I know that issue but It was already fixed by calling a missing flush method instead of removing the sql-constraint:

Steps to reproduce the behavior:

  1. setup a journal properly with sequences
  2. create an account move for this journal
  3. try to post the move

Our unittest have already covered this case:

Please, Could you create a demo instance installing only account_move_name_sequence (without any other extra modules) and try to reproduce

Also record a video and share us

OFFTOPIC

We recommend you to use runboat but for this case it is not deploying the instance correctly

@sbidoul

Do you know what should we do to fix it?

Thanks in advance!

flotho commented

Hi @moylop260
thanks for your feedback.
Actually you're right, it woks perfectly standalone except when there's a base_automation based on account.move.
In this case, the sql constraints is thrown causing the issue.
We'll share more infos for you.
@gaelTorrecillas could you make a runboat scneario for testing

To fix the runboat install issue we need to get rid of the vatnumbers dependency in favor of python-stdnum. vatnumber is obsolete and does not install anymore with a recent toolchain. Odoo does not use it anymore in v14.

To fix the runboat install issue we need to get rid of the vatnumbers dependency in favor of python-stdnum. vatnumber is obsolete and does not install anymore with a recent toolchain. Odoo does not use it anymore in v14.

I got it

Thank you!

I'm not able to migrate the modules to use this library
but we just realized that installing vatnumber<=1.0 is good for runboat and it is a quick-win in order to have instances ready to test for 14.0 (I have already fixed!)

Even I will create a new issue with this important information about python-stdnum, thank you!

OCA Modules not supported odoo14 #412

ValueError is coming when installing the oca modules such as account_sequence_options

ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.

@flotho

I have created a base.automation to auto-update a field of the account.move at create/write

But I didn't reproduce any error

Please, feel free to give us more details with the steps to reproduce it and re-opening the PR/issue