Skip to content

[6424][IMP] account_move_obc_csv#142

Open
kanda999 wants to merge 1 commit into16.0from
16.0-2-imp-account_move_obc_csv
Open

[6424][IMP] account_move_obc_csv#142
kanda999 wants to merge 1 commit into16.0from
16.0-2-imp-account_move_obc_csv

Conversation

@kanda999
Copy link
Copy Markdown
Contributor

@kanda999 kanda999 changed the title [][IMP] account_move_obc_csv [6424][IMP] account_move_obc_csv Mar 10, 2026
Copy link
Copy Markdown
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

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

I'm not in favor of increasing the method args, though. I think there is probably a cleaner way.

Copy link
Copy Markdown
Contributor

@AungKoKoLin1997 AungKoKoLin1997 left a comment

Choose a reason for hiding this comment

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

In my opinion, the fix can be done by adjusting two or three lines.
Inside _get_line_analytic_account use if line.account_id.code != account_code instead of if is_substituted. Then, just pass account_code parameter from _update_vals when you call _get_line_analytic_account. Or, you can get rid of adding extra _get_line_analytic_account and add above condition inside _update_vals like below.

if line.account_id.code != account_code:
    project = self.env["account.analytic.account"]
    department = self.env["account.analytic.account"]
else:
    project = line.analytic_line_ids.filtered(
            lambda x: x.plan_type == "project"
        ).account_id[:1]
    department = line.analytic_line_ids.filtered(
        lambda x: x.plan_type == "department"
    ).account_id[:1]

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants