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

[FIX] account_move_name_sequence: redefine _onchange_journal_id #1755

Merged

Conversation

mde-scopea
Copy link
Contributor

@mde-scopea mde-scopea commented Oct 26, 2023

In v16, _onchange_journal_id is defined to update name when journal_id is modified.
During the creation of new account.move, this onchange is triggered and called the standard _compute_name method

How to reproduce issue:

  • Create new invoice => Name is defined instead of to be 'Draft'

@OCA-git-bot
Copy link
Contributor

Hi @moylop260, @alexis-via, @luisg123v, @frahikLV,
some modules you are maintaining are being modified, check this out!

In v16, _onchange_journal_id is defined to update name when journal_id is modified
During the creation of new account.move, this onchange is triggered and called the standard _compute_name method

How to reproduce issue:
* Create new invoice
=> Name is defined instead of to be 'Draft'
@mde-scopea mde-scopea force-pushed the 16.0-fix-account_move_name_sequence-draft branch from c35d237 to 80c5077 Compare October 26, 2023 08:52
@mde-scopea
Copy link
Contributor Author

#1753

@mde-scopea mde-scopea marked this pull request as ready for review October 26, 2023 08:53
@moylop260
Copy link
Contributor

Could you share the odoo original code (link) where it is triggered, please?

@luisg123v Could you check it, please?

@mde-scopea
Copy link
Contributor Author

Copy link

@matteoopenf matteoopenf left a comment

Choose a reason for hiding this comment

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

probably is better do the super

@moylop260
Copy link
Contributor

I got it

Thank you!

For record the permalink:

Is it the unique side using a call directly to _compute_name?

@mde-scopea
Copy link
Contributor Author

@matteoopenf I prefer redefine the onchange method w/o calling super to avoid other odoo calculations
@moylop260 Another call in write

For my information, in v14, any reasons for changing the compute instead of keeping _compute_name from odoo ?
4aeaa9c#diff-0cce1efec70b54da80f909139ddbeca882923c9ade8437a54d87d510d0c7aa6bR11

If we restore _compute_name on the field name and put the code of _compute_name_by_sequence to replace odoo code in _compute_name, we cover all cases ?!

@moylop260
Copy link
Contributor

@alexis-via What do you think about last comment?

@matteoopenf
Copy link

matteoopenf commented Nov 8, 2023 via email

@moylop260
Copy link
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-1755-by-moylop260-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ec95247 into OCA:16.0 Nov 21, 2023
7 of 9 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 0c43ff9. Thanks a lot for contributing to OCA. ❤️

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

Successfully merging this pull request may close these issues.

5 participants