Skip to content

Commit

Permalink
[FIX] Exclude stock moves for projects, those should not create layer…
Browse files Browse the repository at this point in the history
…s, unless it is from projects to general stock or from general stock to projects
  • Loading branch information
AaronHForgeFlow committed Oct 18, 2024
1 parent f807aff commit 46f29eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addons/stock_account/migrations/13.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ def get_stock_moves(env, company_id, product_id, real_time):
{account_move_join}
WHERE sm.company_id = %s AND sm.product_id = %s
AND state = 'done'
AND (
(sl.analytic_account_id IS NULL AND sld.analytic_account_id IS NULL)
OR
(sl.analytic_account_id IS NOT NULL AND sld.analytic_account_id IS NULL AND sl.usage = 'internal' AND sld.usage = 'internal')
OR
(sl.analytic_account_id IS NULL AND sld.analytic_account_id IS NOT NULL AND sl.usage = 'internal' AND sld.usage = 'internal')
)
ORDER BY sm.date, sm.id
"""
account_move_table = ""
Expand Down

0 comments on commit 46f29eb

Please sign in to comment.