Skip to content
Draft
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/modules190-200.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ Module coverage 19.0 -> 20.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| spreadsheet_dashboard_website_sale_slides | |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| stock | | |
| stock |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| stock_account | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
33 changes: 33 additions & 0 deletions openupgrade_scripts/scripts/stock/20.0.1.1/noupdate_changes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<record id="digest.digest_digest_default" model="digest.digest">
<field name="kpi_stock_delivery_count">True</field>
<field name="kpi_stock_receipt_count">True</field>
</record>
<record id="mail_template_data_delivery_confirmation" model="mail.template">
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
Hello <t t-out="object.partner_id.name or ''">Brandon Freeman</t>,<br/><br/>
<t t-if="hasattr(object, 'delivery_type') and object.delivery_type == 'in_store'">
Your order has been collected.
</t>
<t t-else="">
We are glad to inform you that your order has been shipped.
</t>
<t t-if="hasattr(object, 'carrier_tracking_ref') and object.carrier_tracking_ref">
Your tracking reference is
<strong><t t-if="object.carrier_tracking_url"><t t-set="multiple_carrier_tracking" t-value="object.get_multiple_carrier_tracking()"/><t t-if="multiple_carrier_tracking"><t t-foreach="multiple_carrier_tracking" t-as="line"><br/><a t-att-href="line[1]" target="_blank" t-out="line[0] or ''"/></t></t><t t-else=""><a t-attf-href="{{ object.carrier_tracking_url }}" target="_blank" t-out="object.carrier_tracking_ref or ''"/>.
</t></t><t t-else=""><t t-out="object.carrier_tracking_ref or ''"/>.
</t></strong>
</t>
<br/><br/>
Please find your delivery order attached for more details.<br/><br/>
Thank you,
<t t-if="user.signature"><br/><div>--<br/><t t-out="user.signature or ''">Mitchell Admin</t></div></t>
</p>
</div>
</field>
<field name="email_layout_xmlid">mail.mail_notification_light</field>
</record>
</odoo>
35 changes: 35 additions & 0 deletions openupgrade_scripts/scripts/stock/20.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2026 Don Kendall
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


def _clear_tracking_none(env):
"""19.0 spelled "track by quantity" as a selection key; 20.0 spells it False.

19.0 declared product.template.tracking as serial / lot / none, required,
defaulting to 'none'. 20.0 declares only lot and serial and says what the
empty value means: "False on a storable product means it's tracked by
quantity only."

The column keeps whatever it held, so every product that was tracked by
quantity comes out carrying 'none' -- a key the selection no longer
declares. 184 of the seed's 197 products. It reads as an invalid value in
the interface and matches neither branch of a domain over the field.
"""
openupgrade.logged_query(
env.cr,
"UPDATE product_template SET tracking = NULL WHERE tracking = 'none'",
)


@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(env, "stock", "20.0.1.1/noupdate_changes.xml")
openupgrade.delete_record_translations(
env.cr,
"stock",
["mail_template_data_delivery_confirmation"],
["body_html"],
)
_clear_tracking_none(env)
15 changes: 15 additions & 0 deletions openupgrade_scripts/scripts/stock/20.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2026 Don Kendall
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade

# 20.0 drops the product_ prefix from the unit of measure field.
_renamed_fields = [
("stock.move", "stock_move", "product_uom", "uom_id"),
("stock.move.line", "stock_move_line", "product_uom_id", "uom_id"),
]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_fields(env, _renamed_fields)
Loading
Loading