Skip to content

Commit

Permalink
[IMP] account: Remove opening/ending moves for Spain too
Browse files Browse the repository at this point in the history
We have finally followed the general trend of not preserving opening/ending journal entries, so this is not needed anymore
  • Loading branch information
pedrobaeza committed Sep 20, 2018
1 parent 91cb741 commit 9593420
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions addons/account/migrations/9.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,28 +157,12 @@ def migrate_properties(cr):
""".format(name_v8=name_v8, name_v9=name_v9))


def no_remove_moves_exception_modules():
""" In some countries the odoo standard closing procedure is not used,
and the special periods should not be deleted."""
return ['l10n_es_fiscal_year_closing']


def remove_account_moves_from_special_periods(cr):
"""We first search for journal entries in a special period, in the
first reported fiscal year of the company, and we take them out of the
special period, into a normal period, because we assume that this is
the starting balance of the company, and should be maintained.
Then we delete all the moves associated to special periods."""

module_names = no_remove_moves_exception_modules()
cr.execute("""
SELECT * FROM ir_module_module
WHERE name in %s
AND state='installed'
""", (tuple(module_names),))
if cr.fetchall():
return True

cr.execute("""
SELECT id FROM account_move
WHERE period_id in (SELECT id FROM account_period WHERE special = True
Expand Down

0 comments on commit 9593420

Please sign in to comment.