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

[14.0]account_move_name_sequence impossible to post an account.move #1695

Closed
flotho opened this issue Jul 14, 2023 · 8 comments
Closed

[14.0]account_move_name_sequence impossible to post an account.move #1695

flotho opened this issue Jul 14, 2023 · 8 comments
Labels

Comments

@flotho
Copy link
Member

flotho commented Jul 14, 2023

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 flotho added the bug label Jul 14, 2023
@flotho
Copy link
Member Author

flotho commented Jul 14, 2023

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

@flotho
Copy link
Member Author

flotho commented Jul 14, 2023

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

flotho added a commit to MindAndGo/account-financial-tools that referenced this issue Jul 17, 2023
flotho added a commit to MindAndGo/account-financial-tools that referenced this issue Jul 17, 2023
@moylop260
Copy link
Contributor

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
Copy link
Member Author

flotho commented Jul 17, 2023

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

@sbidoul
Copy link
Member

sbidoul commented Jul 18, 2023

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.

@moylop260
Copy link
Contributor

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!

@codewithanisk

This comment was marked as off-topic.

@moylop260
Copy link
Contributor

@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

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

4 participants