Skip to content

Commit

Permalink
Merge pull request #4303 from lefilament/16.0-add-purchase
Browse files Browse the repository at this point in the history
[16.0][OU-ADD] purchase: Migration scripts
  • Loading branch information
pedrobaeza authored Feb 28, 2024
2 parents 843d412 + 06448d1 commit e0d7c22
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docsource/modules150-160.rst
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ Module coverage 15.0 -> 16.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| project_timesheet_holidays | |No DB layout changes. |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| purchase | | |
| purchase | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| purchase_mrp | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
12 changes: 12 additions & 0 deletions openupgrade_scripts/scripts/purchase/16.0.1.2/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2024 Le Filament
# 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.cr, "purchase", "16.0.1.2/noupdate_changes.xml")
openupgrade.delete_records_safely_by_xml_id(
env,
["purchase.mail_notification_confirm"],
)
14 changes: 14 additions & 0 deletions openupgrade_scripts/scripts/purchase/16.0.1.2/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Le Filament
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade, openupgrade_160


@openupgrade.migrate()
def migrate(env, version):
openupgrade_160.fill_analytic_distribution(
env,
table="purchase_order_line",
m2m_rel="account_analytic_tag_purchase_order_line_rel",
m2m_column1="purchase_order_line_id",
analytic_account_column="account_analytic_id",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---Models in module 'purchase'---
---Fields in module 'purchase'---
purchase / account.analytic.applicability / business_domain (False) : NEW selection_keys: ['bill', 'expense', 'general', 'invoice', 'purchase_order'], mode: modify
# NOTHING TO DO: extra selection will be added by ORM

purchase / product.category / property_account_creditor_price_difference_categ (many2one): module is now 'purchase_price_diff' ('purchase')
purchase / product.product / property_account_creditor_price_difference (many2one): module is now 'purchase_price_diff' ('purchase')
purchase / product.template / property_account_creditor_price_difference (many2one): module is now 'purchase_price_diff' ('purchase')
# NOTHING TO DO: will be handled by ORM

purchase / purchase.order.line / account_analytic_id (many2one): DEL relation: account.analytic.account
purchase / purchase.order.line / analytic_distribution (json) : NEW hasdefault: compute
purchase / purchase.order.line / analytic_distribution_search (json): NEW
purchase / purchase.order.line / analytic_precision (integer) : NEW hasdefault: default
purchase / purchase.order.line / analytic_tag_ids (many2many) : DEL relation: account.analytic.tag
# DONE: fast fill analytic_distribution in pre-migration

---XML records in module 'purchase'---
DEL ir.ui.view: purchase.mail_notification_confirm (noupdate)
# DONE: post-migration: remove noupdate view

DEL ir.actions.act_window: purchase.purchase_action_dashboard_kanban
DEL ir.actions.act_window: purchase.purchase_action_dashboard_list
DEL ir.model.access: purchase.access_account_type
DEL ir.ui.view: purchase.product_template_form_view
DEL ir.ui.view: purchase.view_category_property_form
# NOTHING TO DO : will be deleted by ORM

NEW ir.actions.act_window: purchase.action_purchase_history
NEW ir.model.access: purchase.access_product_tag_purchase_manager
NEW ir.ui.view: purchase.purchase_history_tree
NEW ir.ui.view: purchase.purchase_order_view_kanban_without_dashboard
NEW mail.message.subtype: purchase.mt_rfq_sent (noupdate)
# NOTHING TO DO : will be created by ORM

0 comments on commit e0d7c22

Please sign in to comment.