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] [FIX] account_fiscal_year_closing - create/write #294

Closed
wants to merge 1 commit into from

Conversation

mde-scopea
Copy link

When creating new fiscal year closing with an account mapping (with destination account) in moves configuration, an issue is raised at save (Issue #280).

But when coming from a template (selecting template on screen), Mapping data are used as an Array instead instead of simple id (due to many inside another many).

The current code manage only case from template.

This PR take into account this particularity (and mangage other way), check the type before taking the id of the array.

@mde-scopea
Copy link
Author

Bug also on v16.0 #248

When creating from scratch, Mapping is used as an Array instead of simple id (due to many in another many).
When coming from a template, id is used
To take into account this particularity, check the type before taking the id of the array.
@lk-eska
Copy link

lk-eska commented May 10, 2024

I confirm the bug and fix. Please merge this.

Copy link

@Borruso Borruso left a comment

Choose a reason for hiding this comment

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

Thanks for PR

@@ -553,13 +553,13 @@ class AccountFiscalyearClosingMapping(models.Model):

@api.model
def create(self, vals):
if "dest_account_id" in vals:
if "dest_account_id" in vals and type(vals["dest_account_id"]) == list:
Copy link

Choose a reason for hiding this comment

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

use isinstance(vals["dest_account_id"], list)

Copy link

github-actions bot commented Sep 8, 2024

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 8, 2024
@github-actions github-actions bot closed this Oct 13, 2024
@lk-eska
Copy link

lk-eska commented Oct 13, 2024

Would you please merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants