odoo-addon-openupgrade-scripts 15.0.1.0.0.487__py3-none-any.whl → 15.0.1.0.0.490__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.
@@ -79,6 +79,8 @@ merged_modules = {
79
79
  "pos_order_return": "point_of_sale",
80
80
  # OCA/product-attribute
81
81
  "stock_account_product_cost_security": "product_cost_security",
82
+ # OCA/server-tools
83
+ "base_jsonify": "jsonifier",
82
84
  # OCA/stock-logistics-reporting
83
85
  "stock_inventory_valuation_pivot": "stock_account",
84
86
  # OCA/stock-logistics-warehouse
@@ -23,28 +23,27 @@ def _fill_payment_state(env):
23
23
  # v14 these ones were not computed being of type `entry`, which changes now
24
24
  # on v15 if the method `_payment_state_matters` returns True, which is the
25
25
  # case for the expense moves
26
- # Disable the reconciliation check to be able to update reconciled moves
27
- _check_reconciliation = env["account.move.line"].__class__._check_reconciliation
28
- _check_fiscalyear_lock_date = env[
29
- "account.move"
30
- ].__class__._check_fiscalyear_lock_date
31
- env["account.move.line"].__class__._check_reconciliation = lambda self: None
32
- env["account.move"].__class__._check_fiscalyear_lock_date = lambda self: None
33
- env["hr.expense.sheet"].search([]).account_move_id._compute_amount()
34
- env["account.move.line"].__class__._check_reconciliation = _check_reconciliation
35
- env[
36
- "account.move"
37
- ].__class__._check_fiscalyear_lock_date = _check_fiscalyear_lock_date
38
- # Now perform the SQL to transfer the payment_state
39
- openupgrade.logged_query(
40
- env.cr,
41
- """
42
- UPDATE hr_expense_sheet hes
43
- SET payment_state = am.payment_state
44
- FROM account_move am
45
- WHERE am.id = hes.account_move_id
46
- """,
47
- )
26
+ for move in env["hr.expense.sheet"].search([]).account_move_id:
27
+ # Extracted and adapted from _compute_amount() in account.move
28
+ new_pmt_state = "not_paid" if move.move_type != "entry" else False
29
+ total_to_pay = total_residual = 0.0
30
+ for line in move.line_ids:
31
+ if line.account_id.user_type_id.type in ("receivable", "payable"):
32
+ total_to_pay += line.balance
33
+ total_residual += line.amount_residual
34
+ currencies = move._get_lines_onchange_currency().currency_id
35
+ currency = currencies if len(currencies) == 1 else move.company_id.currency_id
36
+ if currency.is_zero(move.amount_residual):
37
+ reconciled_payments = move._get_reconciled_payments()
38
+ if not reconciled_payments or all(
39
+ payment.is_matched for payment in reconciled_payments
40
+ ):
41
+ new_pmt_state = "paid"
42
+ else:
43
+ new_pmt_state = move._get_invoice_in_payment_state()
44
+ elif currency.compare_amounts(total_to_pay, total_residual) != 0:
45
+ new_pmt_state = "partial"
46
+ move.payment_state = new_pmt_state
48
47
 
49
48
 
50
49
  @openupgrade.migrate()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-openupgrade-scripts
3
- Version: 15.0.1.0.0.487
3
+ Version: 15.0.1.0.0.490
4
4
  Summary: Module that contains all the migrations analysis and scripts for migrate Odoo SA modules.
5
5
  Home-page: https://github.com/OCA/OpenUpgrade
6
6
  Author: Odoo Community Association (OCA)
@@ -1,7 +1,7 @@
1
1
  odoo/addons/openupgrade_scripts/README.rst,sha256=TFoeSTQ1dga9OiOaWPPw6VjE4FXLq6kAMfvg3HDTW3I,3185
2
2
  odoo/addons/openupgrade_scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  odoo/addons/openupgrade_scripts/__manifest__.py,sha256=Bg1odtEI40Tp3WWqRv_MMkuERgls81FORzrUAzezsxg,553
4
- odoo/addons/openupgrade_scripts/apriori.py,sha256=OQ5r7JNEigh7C5etuEA0GV6wMWFstWE7lmmVVvtPbG0,4430
4
+ odoo/addons/openupgrade_scripts/apriori.py,sha256=7G4VLpfouZ1T3yNG3-VyHOpEC69DzD7G-Es5tMlHff4,4486
5
5
  odoo/addons/openupgrade_scripts/readme/CONFIGURE.rst,sha256=cy1swpDkuqi9-6q8L1M1QD058QyfBvAE2PN_mmdxvwI,255
6
6
  odoo/addons/openupgrade_scripts/readme/DESCRIPTION.rst,sha256=elLk0eys-xy60z5KMgqlCKySJWT_k2gTUoOiArMJkWc,86
7
7
  odoo/addons/openupgrade_scripts/readme/INSTALL.rst,sha256=tXbOmw3QIhO1KLIziMpXzuuY0tOhI8IGT2ktCArwfGM,115
@@ -172,7 +172,7 @@ odoo/addons/openupgrade_scripts/scripts/hr_contract/15.0.1.0/pre-migration.py,sh
172
172
  odoo/addons/openupgrade_scripts/scripts/hr_contract/15.0.1.0/upgrade_analysis.txt,sha256=9kL-dXhj7ZJUf3ZUiZY2RxSLYLBQVpVDaEhkmN-Kl1o,1677
173
173
  odoo/addons/openupgrade_scripts/scripts/hr_contract/15.0.1.0/upgrade_analysis_work.txt,sha256=sUl4hhfNWmbvyskqR26Meg_g1CxZwoSsn7PVoewjQ7A,1967
174
174
  odoo/addons/openupgrade_scripts/scripts/hr_expense/15.0.2.0/noupdate_changes.xml,sha256=dMUUfRJ75PVxQYe7pGpE-6hllgKO5DtrEr6_1ki9oW8,1307
175
- odoo/addons/openupgrade_scripts/scripts/hr_expense/15.0.2.0/post-migration.py,sha256=I5qp5e7iMyhuMa3pVCq7fMPTWUytTLbR4AA_osYRczg,2049
175
+ odoo/addons/openupgrade_scripts/scripts/hr_expense/15.0.2.0/post-migration.py,sha256=sQsuTApuVjzMn1998Ej4CIFoDqe_e93_658ExfhWY9U,2227
176
176
  odoo/addons/openupgrade_scripts/scripts/hr_expense/15.0.2.0/pre-migration.py,sha256=0jJvJ2FNOm2CLFZQJSi6OEI3Tv-5AXV1Sb1bXO5bd7U,553
177
177
  odoo/addons/openupgrade_scripts/scripts/hr_expense/15.0.2.0/upgrade_analysis.txt,sha256=Kg3-cC-kvp3E3YTvK4IX5_NCMr32Tq2CNRLebCgUxyk,1664
178
178
  odoo/addons/openupgrade_scripts/scripts/hr_expense/15.0.2.0/upgrade_analysis_work.txt,sha256=6LDJ5RaB8fPhUsebYCJuVHj61Vq4L-cHhI4QjyY_BnI,2042
@@ -798,7 +798,7 @@ odoo/addons/openupgrade_scripts/scripts/website_twitter/15.0.1.0/upgrade_analysi
798
798
  odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
799
799
  odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
800
800
  odoo/addons/openupgrade_scripts/static/description/index.html,sha256=Q6Orf6ynZuFFVbDWUruBEsSY4uaFaTiVYvLYU1tcCnc,12678
801
- odoo_addon_openupgrade_scripts-15.0.1.0.0.487.dist-info/METADATA,sha256=uUW0IYhGyg_dyqCfkoDU4ZTqIjeWxKE1S2Q_WWXCtfQ,3779
802
- odoo_addon_openupgrade_scripts-15.0.1.0.0.487.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
803
- odoo_addon_openupgrade_scripts-15.0.1.0.0.487.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
804
- odoo_addon_openupgrade_scripts-15.0.1.0.0.487.dist-info/RECORD,,
801
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.490.dist-info/METADATA,sha256=rfos1n4lpVVtEFuoYpVyJ1jv74ruasOwb9Xy2VsFsLs,3779
802
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.490.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
803
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.490.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
804
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.490.dist-info/RECORD,,