OCA / account-financial-tools

Odoo Accountant Financial Tools and Utils
GNU Affero General Public License v3.0
305 stars 748 forks source link

[FIX] account_move_name_sequence: redefine _onchange_journal_id #1755

Closed mde-spring closed 9 months ago

mde-spring commented 10 months ago

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:

OCA-git-bot commented 10 months ago

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

mde-spring commented 10 months ago

1753

moylop260 commented 10 months ago

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

@luisg123v Could you check it, please?

mde-spring commented 10 months ago

@moylop260 Here, the odoo code: https://github.com/odoo/odoo/blob/16.0/addons/account/models/account_move.py#L1672

moylop260 commented 10 months ago

I got it

Thank you!

For record the permalink:

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

mde-spring commented 10 months ago

@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 ? https://github.com/OCA/account-financial-tools/commit/4aeaa9ca51ba15e824edcbf307c0384ae0e46ca4#diff-0cce1efec70b54da80f909139ddbeca882923c9ade8437a54d87d510d0c7aa6bR11

If we restore __computename 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 commented 10 months ago

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

matteoopenf commented 10 months ago

In case poter module call same Method is a problem Matteo @. Il giorno 7 nov 2023, alle ore 09:09, mde-spring @.> ha scritto: @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 ?!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Openforce Srls Unipersonale | www.openforce.it | 02 21119472 | Via Tiziano,32 20145 Milano

moylop260 commented 9 months ago

/ocabot merge patch

OCA-git-bot commented 9 months ago

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 commented 9 months ago

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