File tree Expand file tree Collapse file tree
account_fiscal_year_closing/migrations/18.0.1.0.0 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ def migrate(cr, version):
3131 )
3232
3333 for config in env ["account.fiscalyear.closing.config.template" ].search ([]):
34+ if config .template_id :
35+ continue
3436 company = config .journal_id .company_id
3537 template = env ["account.fiscalyear.closing.template" ].search (
3638 [
@@ -39,9 +41,12 @@ def migrate(cr, version):
3941 ],
4042 limit = 1 ,
4143 )
42- config .write ({"template_id" : template .id })
44+ if template :
45+ config .write ({"template_id" : template .id })
4346
4447 for closing in env ["account.fiscalyear.closing" ].search ([]):
48+ if closing .closing_template_id :
49+ continue
4550 company = closing .company_id
4651 template = env ["account.fiscalyear.closing.template" ].search (
4752 [
@@ -50,4 +55,5 @@ def migrate(cr, version):
5055 ],
5156 limit = 1 ,
5257 )
53- closing .write ({"closing_template_id" : template .id })
58+ if template :
59+ closing .write ({"closing_template_id" : template .id })
You can’t perform that action at this time.
0 commit comments