odoo-addon-openupgrade-scripts 17.0.1.0.1.230__py3-none-any.whl → 17.0.1.0.1.232__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.
- odoo/addons/openupgrade_scripts/scripts/hr_expense/17.0.2.0/post-migration.py +33 -0
- odoo/addons/openupgrade_scripts/scripts/hr_expense/17.0.2.0/pre-migration.py +165 -0
- odoo/addons/openupgrade_scripts/scripts/hr_expense/17.0.2.0/upgrade_analysis_work.txt +95 -0
- {odoo_addon_openupgrade_scripts-17.0.1.0.1.230.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.232.dist-info}/METADATA +1 -1
- {odoo_addon_openupgrade_scripts-17.0.1.0.1.230.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.232.dist-info}/RECORD +7 -4
- {odoo_addon_openupgrade_scripts-17.0.1.0.1.230.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.232.dist-info}/WHEEL +0 -0
- {odoo_addon_openupgrade_scripts-17.0.1.0.1.230.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.232.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
from openupgradelib import openupgrade
|
4
|
+
|
5
|
+
|
6
|
+
def _company_update_company_expense_allowed_payment_method_line(env):
|
7
|
+
env.cr.execute(
|
8
|
+
"""
|
9
|
+
SELECT id, company_expense_journal_id FROM res_company company
|
10
|
+
"""
|
11
|
+
)
|
12
|
+
for company_id, company_expense_journal_id in env.cr.fetchall():
|
13
|
+
company = env["res.company"].browse(company_id)
|
14
|
+
if company_expense_journal_id:
|
15
|
+
journal = env["account.journal"].browse(company_expense_journal_id)
|
16
|
+
company.company_expense_allowed_payment_method_line_ids = (
|
17
|
+
journal.outbound_payment_method_line_ids
|
18
|
+
)
|
19
|
+
|
20
|
+
|
21
|
+
@openupgrade.migrate()
|
22
|
+
def migrate(env, version):
|
23
|
+
_company_update_company_expense_allowed_payment_method_line(env)
|
24
|
+
openupgrade.load_data(env, "hr_expense", "17.0.2.0/noupdate_changes.xml")
|
25
|
+
openupgrade.delete_record_translations(
|
26
|
+
env.cr,
|
27
|
+
"hr_expense",
|
28
|
+
(
|
29
|
+
"hr_expense_template_refuse_reason",
|
30
|
+
"hr_expense_template_register",
|
31
|
+
"hr_expense_template_register_no_user",
|
32
|
+
),
|
33
|
+
)
|
@@ -0,0 +1,165 @@
|
|
1
|
+
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
|
+
from openupgradelib import openupgrade
|
4
|
+
|
5
|
+
_fields_renames = [
|
6
|
+
(
|
7
|
+
"hr.expense",
|
8
|
+
"hr_expense",
|
9
|
+
"amount_tax",
|
10
|
+
"tax_amount_currency",
|
11
|
+
),
|
12
|
+
(
|
13
|
+
"hr.expense",
|
14
|
+
"hr_expense",
|
15
|
+
"amount_tax_company",
|
16
|
+
"tax_amount",
|
17
|
+
),
|
18
|
+
(
|
19
|
+
"hr.expense",
|
20
|
+
"hr_expense",
|
21
|
+
"unit_amount",
|
22
|
+
"price_unit",
|
23
|
+
),
|
24
|
+
(
|
25
|
+
"hr.expense",
|
26
|
+
"hr_expense",
|
27
|
+
"untaxed_amount",
|
28
|
+
"untaxed_amount_currency",
|
29
|
+
),
|
30
|
+
(
|
31
|
+
"hr.expense",
|
32
|
+
"hr_expense",
|
33
|
+
"total_amount",
|
34
|
+
"total_amount_currency",
|
35
|
+
),
|
36
|
+
(
|
37
|
+
"hr.expense",
|
38
|
+
"hr_expense",
|
39
|
+
"total_amount_company",
|
40
|
+
"total_amount",
|
41
|
+
),
|
42
|
+
(
|
43
|
+
"hr.expense.sheet",
|
44
|
+
"hr_expense_sheet",
|
45
|
+
"total_amount_taxes",
|
46
|
+
"total_tax_amount",
|
47
|
+
),
|
48
|
+
]
|
49
|
+
|
50
|
+
|
51
|
+
def _am_update_expense_sheet_id(env):
|
52
|
+
openupgrade.logged_query(
|
53
|
+
env.cr,
|
54
|
+
"""
|
55
|
+
ALTER TABLE account_move
|
56
|
+
ADD COLUMN IF NOT EXISTS expense_sheet_id INTEGER
|
57
|
+
""",
|
58
|
+
)
|
59
|
+
openupgrade.logged_query(
|
60
|
+
env.cr,
|
61
|
+
"""
|
62
|
+
UPDATE account_move am
|
63
|
+
SET expense_sheet_id = sheet.id
|
64
|
+
FROM hr_expense_sheet sheet
|
65
|
+
WHERE am.id = sheet.account_move_id
|
66
|
+
""",
|
67
|
+
)
|
68
|
+
|
69
|
+
|
70
|
+
def _hr_expense_update_state(env):
|
71
|
+
openupgrade.logged_query(
|
72
|
+
env.cr,
|
73
|
+
"""
|
74
|
+
UPDATE hr_expense expense
|
75
|
+
SET state = 'submitted'
|
76
|
+
FROM hr_expense_sheet sheet
|
77
|
+
WHERE expense.sheet_id = sheet.id AND
|
78
|
+
expense.state in ('reported', 'done') AND
|
79
|
+
sheet.account_move_id IS NULL
|
80
|
+
""",
|
81
|
+
)
|
82
|
+
openupgrade.logged_query(
|
83
|
+
env.cr,
|
84
|
+
"""
|
85
|
+
UPDATE hr_expense expense
|
86
|
+
SET state = 'reported'
|
87
|
+
FROM hr_expense_sheet sheet
|
88
|
+
WHERE expense.sheet_id = sheet.id AND
|
89
|
+
sheet.state = 'draft'
|
90
|
+
""",
|
91
|
+
)
|
92
|
+
|
93
|
+
|
94
|
+
def _hr_expense_sheet_fill_approval_state(env):
|
95
|
+
openupgrade.logged_query(
|
96
|
+
env.cr,
|
97
|
+
"""
|
98
|
+
ALTER TABLE hr_expense_sheet
|
99
|
+
ADD COLUMN IF NOT EXISTS approval_state VARCHAR
|
100
|
+
""",
|
101
|
+
)
|
102
|
+
openupgrade.logged_query(
|
103
|
+
env.cr,
|
104
|
+
"""
|
105
|
+
UPDATE hr_expense_sheet
|
106
|
+
SET approval_state = CASE
|
107
|
+
WHEN state = 'submit' then 'submit'
|
108
|
+
WHEN state in ('approve', 'post', 'done') then 'approve'
|
109
|
+
WHEN state = 'cancel' then 'cancel'
|
110
|
+
END
|
111
|
+
""",
|
112
|
+
)
|
113
|
+
|
114
|
+
|
115
|
+
def _hr_expense_sheet_journal(env):
|
116
|
+
openupgrade.logged_query(
|
117
|
+
env.cr,
|
118
|
+
"""
|
119
|
+
ALTER TABLE hr_expense_sheet
|
120
|
+
ADD COLUMN IF NOT EXISTS employee_journal_id INTEGER,
|
121
|
+
ADD COLUMN IF NOT EXISTS payment_method_line_id INTEGER;
|
122
|
+
""",
|
123
|
+
)
|
124
|
+
openupgrade.logged_query(
|
125
|
+
env.cr,
|
126
|
+
"""
|
127
|
+
UPDATE hr_expense_sheet sheet
|
128
|
+
SET payment_method_line_id = method_line.id
|
129
|
+
FROM account_journal journal
|
130
|
+
JOIN account_payment_method_line method_line
|
131
|
+
ON method_line.journal_id = journal.id
|
132
|
+
JOIN account_payment_method method
|
133
|
+
ON method.id = method_line.payment_method_id
|
134
|
+
WHERE sheet.bank_journal_id = journal.id
|
135
|
+
AND method.payment_type = 'outbound'
|
136
|
+
""",
|
137
|
+
)
|
138
|
+
openupgrade.logged_query(
|
139
|
+
env.cr,
|
140
|
+
"""
|
141
|
+
UPDATE hr_expense_sheet
|
142
|
+
SET employee_journal_id = journal_id
|
143
|
+
WHERE journal_id IS NOT NULL
|
144
|
+
""",
|
145
|
+
)
|
146
|
+
openupgrade.logged_query(
|
147
|
+
env.cr,
|
148
|
+
"""
|
149
|
+
UPDATE hr_expense_sheet sheet
|
150
|
+
SET journal_id = sheet.bank_journal_id
|
151
|
+
FROM hr_expense expense
|
152
|
+
WHERE expense.sheet_id = sheet.id AND
|
153
|
+
expense.payment_mode = 'company_account' AND
|
154
|
+
sheet.bank_journal_id IS NOT NULL
|
155
|
+
""",
|
156
|
+
)
|
157
|
+
|
158
|
+
|
159
|
+
@openupgrade.migrate()
|
160
|
+
def migrate(env, version):
|
161
|
+
_am_update_expense_sheet_id(env)
|
162
|
+
openupgrade.rename_fields(env, _fields_renames)
|
163
|
+
_hr_expense_update_state(env)
|
164
|
+
_hr_expense_sheet_fill_approval_state(env)
|
165
|
+
_hr_expense_sheet_journal(env)
|
@@ -0,0 +1,95 @@
|
|
1
|
+
---Models in module 'hr_expense'---
|
2
|
+
---Fields in module 'hr_expense'---
|
3
|
+
hr_expense / account.bank.statement.line / expense_sheet_id (one2many) : type is now 'many2one' ('one2many')
|
4
|
+
hr_expense / account.move / expense_sheet_id (one2many) : type is now 'many2one' ('one2many')
|
5
|
+
hr_expense / account.payment / expense_sheet_id (one2many) : type is now 'many2one' ('one2many')
|
6
|
+
hr_expense / hr.expense.sheet / account_move_id (many2one) : DEL relation: account.move
|
7
|
+
hr_expense / hr.expense.sheet / account_move_ids (one2many) : NEW relation: account.move
|
8
|
+
# DONE pre-migration: set expense_sheet_id for each account_move_id present at hr.expense.sheet
|
9
|
+
|
10
|
+
hr_expense / hr.employee / filter_for_expense (boolean) : NEW
|
11
|
+
# NOTHING TO DO: no store field
|
12
|
+
|
13
|
+
hr_expense / hr.expense / activity_user_id (many2one) : not related anymore
|
14
|
+
hr_expense / hr.expense / activity_user_id (many2one) : now a function
|
15
|
+
hr_expense / hr.expense / rating_ids (one2many) : NEW relation: rating.rating
|
16
|
+
# NOTHING TO DO
|
17
|
+
|
18
|
+
hr_expense / hr.expense / amount_tax (float) : DEL
|
19
|
+
hr_expense / hr.expense / amount_tax_company (float) : DEL
|
20
|
+
# DONE pre-migration: rename amount_tax to tax_amount_currency, amount_tax_company to tax_amount
|
21
|
+
|
22
|
+
|
23
|
+
hr_expense / hr.expense / is_refused (boolean) : DEL
|
24
|
+
# NOTHING TO DO: dead code https://github.com/odoo/odoo/pull/110518
|
25
|
+
|
26
|
+
hr_expense / hr.expense / unit_amount (float) : DEL required
|
27
|
+
hr_expense / hr.expense / price_unit (float) : NEW required, isfunction: function, stored
|
28
|
+
# DONE pre-migration: rename to price_unit
|
29
|
+
|
30
|
+
hr_expense / hr.expense / reference (char) : DEL
|
31
|
+
hr_expense / hr.expense / sample (boolean) : DEL
|
32
|
+
# NOTHING TO DO: deprecated field https://github.com/odoo/odoo/pull/130244/commits/266b482264576903cf736ffe2bddfc71f7a7a4ec
|
33
|
+
|
34
|
+
hr_expense / hr.expense / state (selection) : selection_keys is now '['approved', 'done', 'draft', 'refused', 'reported', 'submitted']' ('['approved', 'done', 'draft', 'refused', 'reported']')
|
35
|
+
# DONE pre-migration: if any expense has expense sheet and the sheet doesn't have account move and the expense is on reported or done state, then update state of expense to 'submitted' https://github.com/odoo/odoo/commit/8f9ca3e29e21596cd317d976edaf454cd0f33bf1
|
36
|
+
# DONE pre-migration: if any expense has expense sheet and the sheet is on draft state, then update state of expense to 'reported'
|
37
|
+
|
38
|
+
hr_expense / hr.expense / tax_amount (float) : NEW isfunction: function, stored
|
39
|
+
hr_expense / hr.expense / tax_amount_currency (float) : NEW isfunction: function, stored
|
40
|
+
# DONE pre-migration: rename from amount_tax_company, amount_tax
|
41
|
+
|
42
|
+
hr_expense / hr.expense / total_amount_company (float) : DEL
|
43
|
+
hr_expense / hr.expense / total_amount_currency (float) : NEW hasdefault: compute
|
44
|
+
hr_expense / hr.expense / untaxed_amount (float) : DEL
|
45
|
+
hr_expense / hr.expense / untaxed_amount_currency (float): NEW isfunction: function, stored
|
46
|
+
# DONE pre-migration: total_amount_company -> total_amount, total_amount -> total_amount_currency, untaxed_amount -> untaxed_amount_currency
|
47
|
+
|
48
|
+
hr_expense / hr.expense.sheet / activity_user_id (many2one) : not related anymore
|
49
|
+
hr_expense / hr.expense.sheet / activity_user_id (many2one) : now a function
|
50
|
+
# NOTHING TO DO
|
51
|
+
|
52
|
+
hr_expense / hr.expense.sheet / address_id (many2one) : DEL relation: res.partner
|
53
|
+
# NOTHING TO DO: deprecated field
|
54
|
+
|
55
|
+
hr_expense / hr.expense.sheet / amount_residual (float) : not related anymore
|
56
|
+
hr_expense / hr.expense.sheet / amount_residual (float) : now a function
|
57
|
+
# NOTHING TO DO
|
58
|
+
|
59
|
+
hr_expense / hr.expense.sheet / approval_state (selection) : NEW selection_keys: ['approve', 'cancel', 'submit']
|
60
|
+
# DONE pre-migration: create column and fill value according to state of expense sheet
|
61
|
+
|
62
|
+
hr_expense / hr.expense.sheet / bank_journal_id (many2one) : DEL relation: account.journal
|
63
|
+
hr_expense / hr.expense.sheet / payment_method_line_id (many2one): NEW relation: account.payment.method.line, hasdefault: compute
|
64
|
+
# DONE: pre-migration: update outbound payment method line of bank_journal_id into 'payment_method_line_id', https://github.com/odoo/odoo/pull/110518/
|
65
|
+
|
66
|
+
hr_expense / hr.expense.sheet / department_id (many2one) : now related
|
67
|
+
# NOTHING TO DO
|
68
|
+
|
69
|
+
hr_expense / hr.expense.sheet / employee_journal_id (many2one): NEW relation: account.journal, hasdefault: default
|
70
|
+
hr_expense / hr.expense.sheet / journal_id (many2one) : now a function
|
71
|
+
# DONE pre-migration: fill value by 'employee_journal_id' then update 'journal_id' by 'payment_method_line_id.journal_id' if 'paid by company (bank_journal_id)', https://github.com/odoo/odoo/pull/110518/
|
72
|
+
|
73
|
+
hr_expense / hr.expense.sheet / rating_ids (one2many) : NEW relation: rating.rating
|
74
|
+
hr_expense / hr.expense.sheet / state (selection) : now a function
|
75
|
+
# NOTHING TO DO
|
76
|
+
|
77
|
+
hr_expense / hr.expense.sheet / total_amount_taxes (float) : DEL
|
78
|
+
hr_expense / hr.expense.sheet / total_tax_amount (float) : NEW isfunction: function, stored
|
79
|
+
# DONE pre-migration total_amount_taxes - > total_tax_amount
|
80
|
+
|
81
|
+
hr_expense / res.company / company_expense_allowed_payment_method_line_ids (many2many): NEW relation: account.payment.method.line
|
82
|
+
hr_expense / res.company / company_expense_journal_id (many2one): DEL relation: account.journal
|
83
|
+
# DONE post-migration: update 'company_expense_allowed_payment_method_line_ids' using 'company_expense_journal_id.outbound_payment_method_line_ids', https://github.com/odoo/odoo/pull/110518/
|
84
|
+
|
85
|
+
hr_expense / res.company / expense_product_id (many2one) : NEW relation: product.product
|
86
|
+
# NOTHING TO DO
|
87
|
+
|
88
|
+
---XML records in module 'hr_expense'---
|
89
|
+
ir.actions.act_window: hr_expense.action_hr_expense_sheet_my_all (deleted domain)
|
90
|
+
NEW ir.actions.report: hr_expense.action_report_expense_sheet_img
|
91
|
+
NEW ir.ui.view: hr_expense.product_product_expense_kanban_view
|
92
|
+
NEW ir.ui.view: hr_expense.report_expense_sheet_img
|
93
|
+
NEW mail.message.subtype: hr_expense.mt_expense_entry_delete (noupdate)
|
94
|
+
NEW mail.message.subtype: hr_expense.mt_expense_reset (noupdate)
|
95
|
+
# NOTHING TO DO
|
@@ -150,7 +150,10 @@ odoo/addons/openupgrade_scripts/scripts/hr_contract/17.0.1.0/post-migration.py,s
|
|
150
150
|
odoo/addons/openupgrade_scripts/scripts/hr_contract/17.0.1.0/upgrade_analysis.txt,sha256=UGFMWkoi2FdlkIYF85f5v3lhF52ahVhnU3WKiW7Figg,1400
|
151
151
|
odoo/addons/openupgrade_scripts/scripts/hr_contract/17.0.1.0/upgrade_analysis_work.txt,sha256=r0MFZKDA20uLRdvD2VNyBA0xW0Gahb_wmdAd3xnVg64,1463
|
152
152
|
odoo/addons/openupgrade_scripts/scripts/hr_expense/17.0.2.0/noupdate_changes.xml,sha256=gs_8j4Yj6l2rzPVrmc70BrWJTYzUH459vd-r9p9DZIY,2858
|
153
|
+
odoo/addons/openupgrade_scripts/scripts/hr_expense/17.0.2.0/post-migration.py,sha256=Ix7a9WNyhSjVLaJieGpwvd_g9rxZLpdZ3067N2CoWAc,1207
|
154
|
+
odoo/addons/openupgrade_scripts/scripts/hr_expense/17.0.2.0/pre-migration.py,sha256=k2x5BbihFexw3tNUuvxsgjjaPaAPmts2uFd4If6jq9o,4182
|
153
155
|
odoo/addons/openupgrade_scripts/scripts/hr_expense/17.0.2.0/upgrade_analysis.txt,sha256=Yx8U6AjBBz4fleqgeEsdmhbeitPvc9YCvQl5vIxHN84,4674
|
156
|
+
odoo/addons/openupgrade_scripts/scripts/hr_expense/17.0.2.0/upgrade_analysis_work.txt,sha256=zGZVPfO2xFpH6-1YyXV1NhPEXCWlCh9kYiHUG8PxqjA,6595
|
154
157
|
odoo/addons/openupgrade_scripts/scripts/hr_fleet/17.0.1.0/upgrade_analysis.txt,sha256=AH2qC-3jaxRo-eCAnuK_WTlhVhQFCRS73OKLyyggR9U,361
|
155
158
|
odoo/addons/openupgrade_scripts/scripts/hr_gamification/17.0.1.0/upgrade_analysis.txt,sha256=cMaEUAXfvHRW3vwIZMIrGROH5eDQjRAbqLkraqvEj-4,168
|
156
159
|
odoo/addons/openupgrade_scripts/scripts/hr_holidays/17.0.1.6/noupdate_changes.xml,sha256=9dOGU4iK5Gl2MEq-x3wshERglih14wZYrbMH-LUYlf0,1916
|
@@ -681,7 +684,7 @@ odoo/addons/openupgrade_scripts/scripts/website_twitter/17.0.1.0/upgrade_analysi
|
|
681
684
|
odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
|
682
685
|
odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
683
686
|
odoo/addons/openupgrade_scripts/static/description/index.html,sha256=iV41-zYBM4uvZPuunpcr7bQeRgBaojVsKo_gkeyJyA4,12639
|
684
|
-
odoo_addon_openupgrade_scripts-17.0.1.0.1.
|
685
|
-
odoo_addon_openupgrade_scripts-17.0.1.0.1.
|
686
|
-
odoo_addon_openupgrade_scripts-17.0.1.0.1.
|
687
|
-
odoo_addon_openupgrade_scripts-17.0.1.0.1.
|
687
|
+
odoo_addon_openupgrade_scripts-17.0.1.0.1.232.dist-info/METADATA,sha256=P6UZoz7ujZGfBgteCGuxiwiVt2-8RyAGdAw63qXTio8,3786
|
688
|
+
odoo_addon_openupgrade_scripts-17.0.1.0.1.232.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
|
689
|
+
odoo_addon_openupgrade_scripts-17.0.1.0.1.232.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
690
|
+
odoo_addon_openupgrade_scripts-17.0.1.0.1.232.dist-info/RECORD,,
|
File without changes
|