odoo-addon-openupgrade-scripts 16.0.1.0.5.5__py3-none-any.whl → 16.0.1.0.5.6__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/purchase_requisition/16.0.0.1/post-migration.py +21 -49
- odoo/addons/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/upgrade_analysis_work.txt +1 -1
- {odoo_addon_openupgrade_scripts-16.0.1.0.5.5.dist-info → odoo_addon_openupgrade_scripts-16.0.1.0.5.6.dist-info}/METADATA +1 -1
- {odoo_addon_openupgrade_scripts-16.0.1.0.5.5.dist-info → odoo_addon_openupgrade_scripts-16.0.1.0.5.6.dist-info}/RECORD +6 -6
- {odoo_addon_openupgrade_scripts-16.0.1.0.5.5.dist-info → odoo_addon_openupgrade_scripts-16.0.1.0.5.6.dist-info}/WHEEL +0 -0
- {odoo_addon_openupgrade_scripts-16.0.1.0.5.5.dist-info → odoo_addon_openupgrade_scripts-16.0.1.0.5.6.dist-info}/top_level.txt +0 -0
@@ -1,10 +1,9 @@
|
|
1
|
-
# Copyright 2024 Tecnativa - Pedro M. Baeza
|
1
|
+
# Copyright 2024,2025 Tecnativa - Pedro M. Baeza
|
2
2
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
3
3
|
from openupgradelib import openupgrade
|
4
4
|
|
5
5
|
|
6
6
|
def fill_purchase_order_group_from_tenders(env):
|
7
|
-
tender_type = env.ref("purchase_requisition.type_multi")
|
8
7
|
openupgrade.logged_query(
|
9
8
|
env.cr,
|
10
9
|
"""
|
@@ -12,60 +11,33 @@ def fill_purchase_order_group_from_tenders(env):
|
|
12
11
|
ADD COLUMN IF NOT EXISTS old_purchase_requisition_id INTEGER
|
13
12
|
""",
|
14
13
|
)
|
14
|
+
# Create a group if there is more than one PO per requisition
|
15
15
|
openupgrade.logged_query(
|
16
16
|
env.cr,
|
17
|
-
|
18
|
-
INSERT INTO purchase_order_group
|
19
|
-
|
20
|
-
SELECT
|
21
|
-
pr.create_date, pr.create_uid, pr.write_date, pr.write_uid
|
22
|
-
FROM
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
"""
|
18
|
+
INSERT INTO purchase_order_group
|
19
|
+
(old_purchase_requisition_id, create_date, create_uid, write_date, write_uid)
|
20
|
+
SELECT
|
21
|
+
t.requisition_id, pr.create_date, pr.create_uid, pr.write_date, pr.write_uid
|
22
|
+
FROM (
|
23
|
+
SELECT *, row_number()
|
24
|
+
over (partition BY requisition_id ORDER BY id) AS rnum
|
25
|
+
FROM purchase_order
|
26
|
+
) t
|
27
|
+
JOIN purchase_requisition pr ON pr.id = t.requisition_id
|
28
|
+
WHERE t.rnum = 2;
|
28
29
|
""",
|
29
30
|
)
|
30
|
-
|
31
|
-
if tender_requisition_ids:
|
32
|
-
openupgrade.logged_query(
|
33
|
-
env.cr,
|
34
|
-
"""
|
35
|
-
UPDATE purchase_order po
|
36
|
-
SET purchase_group_id = pog.id
|
37
|
-
FROM purchase_order_group pog
|
38
|
-
WHERE po.requisition_id = pog.old_purchase_requisition_id
|
39
|
-
""",
|
40
|
-
)
|
31
|
+
# Assign it to the purchase orders
|
41
32
|
openupgrade.logged_query(
|
42
33
|
env.cr,
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
34
|
+
"""
|
35
|
+
UPDATE purchase_order po
|
36
|
+
SET purchase_group_id = pog.id
|
37
|
+
FROM purchase_order_group pog
|
38
|
+
WHERE po.requisition_id = pog.old_purchase_requisition_id
|
39
|
+
""",
|
48
40
|
)
|
49
|
-
obsolete_requisition_ids = [x[0] for x in env.cr.fetchall()]
|
50
|
-
if obsolete_requisition_ids:
|
51
|
-
openupgrade.logged_query(
|
52
|
-
env.cr,
|
53
|
-
f"""
|
54
|
-
UPDATE purchase_order po
|
55
|
-
SET requisition_id = NULL
|
56
|
-
FROM purchase_requisition pr
|
57
|
-
WHERE po.requisition_id = pr.id AND pr.type_id = {tender_type.id}
|
58
|
-
""",
|
59
|
-
)
|
60
|
-
openupgrade.logged_query(
|
61
|
-
env.cr,
|
62
|
-
"""
|
63
|
-
UPDATE purchase_requisition pr
|
64
|
-
SET state = 'draft'
|
65
|
-
WHERE pr.state not in ('draft', 'cancel')
|
66
|
-
""",
|
67
|
-
)
|
68
|
-
env["purchase.requisition"].browse(obsolete_requisition_ids).unlink()
|
69
41
|
|
70
42
|
|
71
43
|
@openupgrade.migrate()
|
odoo/addons/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/upgrade_analysis_work.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
new model purchase.order.group
|
2
2
|
purchase_requisition / purchase.order / purchase_group_id (many2one) : NEW relation: purchase.order.group
|
3
3
|
purchase_requisition / purchase.order.group / order_ids (one2many) : NEW relation: purchase.order
|
4
|
-
# DONE: post-migration: group purchases by their requisition if
|
4
|
+
# DONE: post-migration: group purchases by their requisition if there's more than one PO per requisition
|
5
5
|
|
6
6
|
new model purchase.requisition.alternative.warning [transient]
|
7
7
|
new model purchase.requisition.create.alternative [transient]
|
@@ -567,10 +567,10 @@ odoo/addons/openupgrade_scripts/scripts/purchase_mrp/16.0.1.0/upgrade_analysis_w
|
|
567
567
|
odoo/addons/openupgrade_scripts/scripts/purchase_price_diff/16.0.1.1/upgrade_analysis.txt,sha256=2l0XlbqnoZrzqOSlmOs454g9chxTfBePihRGTtRDVFM,675
|
568
568
|
odoo/addons/openupgrade_scripts/scripts/purchase_product_matrix/16.0.1.0/upgrade_analysis.txt,sha256=ziZfZQGATL_2VPdgw-7hgS7661nkDbbYuT_SgMrpFmw,192
|
569
569
|
odoo/addons/openupgrade_scripts/scripts/purchase_product_matrix/16.0.1.0/upgrade_analysis_work.txt,sha256=sIszLO8a-iwZxbi3KvMV4JOfs1YB1u-lVC8XGB_Ef9k,208
|
570
|
-
odoo/addons/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/post-migration.py,sha256=
|
570
|
+
odoo/addons/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/post-migration.py,sha256=9soc9mwgKC8Vu3uOsam0VUPvU8fWtSPYUVdTbXRQ9IY,1570
|
571
571
|
odoo/addons/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/pre-migration.py,sha256=Hk9x4_Ac4Fq3VCSbg7TJv0k_8w3I-sCV_pfZBYg3OFA,508
|
572
572
|
odoo/addons/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/upgrade_analysis.txt,sha256=hu4bNoVAuOmaDuK0IQDQV5y3J0lg4r58gCoH6fYrLEM,2295
|
573
|
-
odoo/addons/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/upgrade_analysis_work.txt,sha256=
|
573
|
+
odoo/addons/openupgrade_scripts/scripts/purchase_requisition/16.0.0.1/upgrade_analysis_work.txt,sha256=2fMt9PAN7qeUdJ8CeUerCIVOvYKxlHuAd6l8pHyPOXk,2601
|
574
574
|
odoo/addons/openupgrade_scripts/scripts/purchase_requisition_stock/16.0.1.2/upgrade_analysis.txt,sha256=dmjMOLEfLnKWEfqynh-dOtbg8CmU1sLEE4gsZcsZ-ks,491
|
575
575
|
odoo/addons/openupgrade_scripts/scripts/purchase_requisition_stock/16.0.1.2/upgrade_analysis_work.txt,sha256=9YAXG1LLqe3RkqfoNkCTYlMDsdfaT0i7RJArIR-0u6E,624
|
576
576
|
odoo/addons/openupgrade_scripts/scripts/purchase_stock/16.0.1.2/pre-migration.py,sha256=gDGPEvpqn2TY0U1qKin7w5JY2p6CokhTIq3tk-ddWfM,1539
|
@@ -790,7 +790,7 @@ odoo/addons/openupgrade_scripts/scripts/website_twitter/16.0.1.0/upgrade_analysi
|
|
790
790
|
odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
|
791
791
|
odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
792
792
|
odoo/addons/openupgrade_scripts/static/description/index.html,sha256=T3CGCNUVysVD8ysCfwpbPWR5z8x_9vbYNoS4TLHDYOQ,12940
|
793
|
-
odoo_addon_openupgrade_scripts-16.0.1.0.5.
|
794
|
-
odoo_addon_openupgrade_scripts-16.0.1.0.5.
|
795
|
-
odoo_addon_openupgrade_scripts-16.0.1.0.5.
|
796
|
-
odoo_addon_openupgrade_scripts-16.0.1.0.5.
|
793
|
+
odoo_addon_openupgrade_scripts-16.0.1.0.5.6.dist-info/METADATA,sha256=Bctnar-XTxQlgiYseXqYZ8iBVE9gKdvysZkWn4TJ3i8,3985
|
794
|
+
odoo_addon_openupgrade_scripts-16.0.1.0.5.6.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
|
795
|
+
odoo_addon_openupgrade_scripts-16.0.1.0.5.6.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
|
796
|
+
odoo_addon_openupgrade_scripts-16.0.1.0.5.6.dist-info/RECORD,,
|
File without changes
|