Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docsource/modules160-170.rst
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ Module coverage 16.0 -> 17.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| |new| project_todo | |Renamed from note. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| purchase | | |
| purchase | Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| purchase_mrp | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
17 changes: 17 additions & 0 deletions openupgrade_scripts/scripts/purchase/17.0.1.2/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(env, "purchase", "17.0.1.2/noupdate_changes.xml")
openupgrade.delete_record_translations(
env.cr,
"purchase",
[
"email_template_edi_purchase_done",
"email_template_edi_purchase_reminder",
],
)
14 changes: 14 additions & 0 deletions openupgrade_scripts/scripts/purchase/17.0.1.2/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version=None):
if not openupgrade.column_exists(env.cr, "purchase_order_line", "discount"):
openupgrade.logged_query(
env.cr,
"ALTER TABLE purchase_order_line ADD COLUMN discount FLOAT DEFAULT 0",
)
openupgrade.logged_query(
env.cr,
"ALTER TABLE purchase_order_line ALTER COLUMN discount DROP DEFAULT",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---Models in module 'purchase'---
---Fields in module 'purchase'---
purchase / purchase.order / activity_user_id (many2one) : not related anymore
purchase / purchase.order / activity_user_id (many2one) : now a function
purchase / purchase.order / message_main_attachment_id (many2one): DEL relation: ir.attachment
purchase / purchase.order / rating_ids (one2many) : NEW relation: rating.rating
# NOTHING TO DO

purchase / purchase.order.line / discount (float) : NEW hasdefault: compute
# DONE: create column in pre-migration to avoid expensive recomputation

purchase / res.partner / buyer_id (many2one) : NEW relation: res.users
# NOTHING TO DO

---XML records in module 'purchase'---
NEW ir.ui.view: purchase.document_tax_totals
NEW ir.ui.view: purchase.product_template_search_view_purchase
NEW ir.ui.view: purchase.product_view_kanban_catalog_purchase_only
NEW ir.ui.view: purchase.product_view_search_catalog
NEW ir.ui.view: purchase.view_product_product_supplier_inherit
# NOTHING TO DO
Loading