odoo-addon-openupgrade-scripts 18.0.1.0.0.422__py3-none-any.whl → 18.0.1.0.0.424__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -153,11 +153,41 @@ def account_account_code_fields(env):
153
153
  )
154
154
 
155
155
 
156
+ def _handle_outstanding_accounts(env):
157
+ """On version 17, the outstanding accounts were handled with 2 fields on each
158
+ res.company.
159
+
160
+ Now, they are handled putting specific XML-IDs on them, so we should create that
161
+ identifiers on the previous referenced accounts.
162
+ """
163
+ IMD = env["ir.model.data"]
164
+ for column in [
165
+ "account_journal_payment_debit_account_id",
166
+ "account_journal_payment_credit_account_id",
167
+ ]:
168
+ env.cr.execute(
169
+ f"SELECT id, {column} FROM res_company WHERE {column} IS NOT NULL"
170
+ )
171
+ for company_id, account_id in env.cr.fetchall():
172
+ name = f"{company_id}_{column}"
173
+ if not IMD.search([("module", "=", "account"), ("name", "=", name)]):
174
+ IMD.create(
175
+ {
176
+ "module": "account",
177
+ "name": name,
178
+ "model": "account.account",
179
+ "res_id": account_id,
180
+ "noupdate": True,
181
+ }
182
+ )
183
+
184
+
156
185
  @openupgrade.migrate()
157
186
  def migrate(env, version):
158
187
  handle_lock_dates(env)
159
188
  link_payments_to_moves(env)
160
189
  account_account_code_fields(env)
190
+ _handle_outstanding_accounts(env)
161
191
  openupgrade.m2o_to_x2m(
162
192
  env.cr, env["account.account"], "account_account", "company_ids", "company_id"
163
193
  )
@@ -211,7 +211,7 @@ account / product.template / property_account_income_id (many2one):
211
211
 
212
212
  account / res.company / account_journal_payment_credit_account_id (many2one): DEL relation: account.account
213
213
  account / res.company / account_journal_payment_debit_account_id (many2one): DEL relation: account.account
214
- # NOTHING TO DO
214
+ # DONE: post-migration: Put corresponding XML-IDs to the pointed accounts
215
215
 
216
216
  account / res.company / account_price_include (selection): NEW required, selection_keys: ['tax_excluded', 'tax_included'], hasdefault: default
217
217
  account / res.company / autopost_bills (boolean) : NEW hasdefault: default
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-openupgrade_scripts
3
- Version: 18.0.1.0.0.422
3
+ Version: 18.0.1.0.0.424
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: odoo==18.0.*
6
6
  Requires-Dist: openupgradelib
@@ -6,10 +6,10 @@ odoo/addons/openupgrade_scripts/readme/CONFIGURE.md,sha256=rnx8ADTYzVUB93PIG3Lib
6
6
  odoo/addons/openupgrade_scripts/readme/DESCRIPTION.md,sha256=6hwHccovmE9cfaV7PQPvKUvNJa-f_Uc1wgXyL_SrYck,86
7
7
  odoo/addons/openupgrade_scripts/readme/INSTALL.md,sha256=NDKVZRv0J8BTqcSTD7JwUXL_AY-cDJoegn5IUTbEOFk,113
8
8
  odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/noupdate_changes.xml,sha256=givzahE7VAv9gM1TkNDHs3qhNh3AZacox5q-hDuDjIU,4078
9
- odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/post-migration.py,sha256=hZRueZ0yktDoBfB1_o7rQjXkTmAB4DfyK9YkXC5G3hU,6547
9
+ odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/post-migration.py,sha256=ugqB7EoX2fLYchCfXWXCABAVsStuT49_KvLUdiVP840,7644
10
10
  odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/pre-migration.py,sha256=8lgeeCdLEQtK2FfTqhJV8gKvlZEC5YWyTEKtuLPrbhw,8420
11
11
  odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/upgrade_analysis.txt,sha256=xpQwQxWn0ktacfLBgmRuRMjvSY9R4ClAQlfLJRs35Tg,21369
12
- odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/upgrade_analysis_work.txt,sha256=z-IqChSmDrYuRklaEolzi648dTC_J-dNE67q7Taf5hw,25294
12
+ odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/upgrade_analysis_work.txt,sha256=wxQD3CdbMhJ1Ch23FEh49rYmGT4sX9Q6rCAX0G90LT4,25352
13
13
  odoo/addons/openupgrade_scripts/scripts/account/tests/data.py,sha256=beOIEOzb6-hvlpjM9VVZrSj8pqZ6U7AcrS-w3vkTgsU,490
14
14
  odoo/addons/openupgrade_scripts/scripts/account/tests/test_migration.py,sha256=UsHOHhSkUkmcm4inSE8VgFIn79E-6i9FXt3v6jHW5HY,791
15
15
  odoo/addons/openupgrade_scripts/scripts/account_check_printing/18.0.1.0/upgrade_analysis.txt,sha256=IY2z67lgzVtwG7Zzj71ks2why2Hwuz-mRPy9xEqfBcY,675
@@ -797,7 +797,7 @@ odoo/addons/openupgrade_scripts/scripts/website_slides_survey/18.0.1.0/upgrade_a
797
797
  odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
798
798
  odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
799
799
  odoo/addons/openupgrade_scripts/static/description/index.html,sha256=Jc0qAThlH5WnoSq6vPamjC8WyMkdo_9zkhDuU1qW1VI,12722
800
- odoo_addon_openupgrade_scripts-18.0.1.0.0.422.dist-info/METADATA,sha256=QyNclGS0zDYbbMx3bLXc1Y9Y23ILiUpC9TK2p12-J78,3812
801
- odoo_addon_openupgrade_scripts-18.0.1.0.0.422.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
802
- odoo_addon_openupgrade_scripts-18.0.1.0.0.422.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
803
- odoo_addon_openupgrade_scripts-18.0.1.0.0.422.dist-info/RECORD,,
800
+ odoo_addon_openupgrade_scripts-18.0.1.0.0.424.dist-info/METADATA,sha256=oZUsBKyvrM2GDP29qaUPI2RfhjrQpKkA2R66mB-Q_Dw,3812
801
+ odoo_addon_openupgrade_scripts-18.0.1.0.0.424.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
802
+ odoo_addon_openupgrade_scripts-18.0.1.0.0.424.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
803
+ odoo_addon_openupgrade_scripts-18.0.1.0.0.424.dist-info/RECORD,,