Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][MIG] uom #2666

Merged
merged 2 commits into from
Jun 6, 2021
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 doc/source/modules130-140.rst
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
|transifex | |
+--------------------------------------------+-------------------------------------------------+
|uom | |
|uom | Done |
+--------------------------------------------+-------------------------------------------------+
|utm | |
+--------------------------------------------+-------------------------------------------------+
Expand Down
4 changes: 2 additions & 2 deletions openupgrade_scripts/scripts/uom/14.0.1.0/noupdate_changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<field name="name">in</field>
</record>
<record id="product_uom_kgm" model="uom.uom">
<field name="rounding"/>
<field name="rounding" eval="0.01"/>
<field name="uom_type">reference</field>
</record>
<record id="product_uom_lb" model="uom.uom">
Expand All @@ -39,7 +39,7 @@
<field name="name">qt (US)</field>
</record>
<record id="product_uom_unit" model="uom.uom">
<field name="rounding"/>
<field name="rounding" eval="0.01"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

violates _check_category_reference_uniqueness

https://github.com/OCA/OCB/blob/13.0/addons/uom/models/uom_uom.py#L83-L94

File "/home/gcapalbo/k240/migrate_therp/build-14.0/parts/odoo/addons/uom/models/uom_uom.py", line 85, in check_category_reference_uniqueness
raise ValidationError(
("UoM category %s should only have one reference unit of measure.") % (self.env['uom.category'].browse(uom_data['category_id']).name,))
odoo.exceptions.ValidationError: UoM categorie Unitheeft slechts één referentie maateenheid.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this error doesn't have any relation with the rounding. This constrain already existed in v13, and your problem seems more a problem of your db data, which has something wrong and you should solve manually before migrating.

<field name="uom_type">reference</field>
</record>
</odoo>
8 changes: 8 additions & 0 deletions openupgrade_scripts/scripts/uom/14.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2021 ForgeFlow S.L. <https://www.forgeflow.com>
# 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, "uom", "14.0.1.0/noupdate_changes.xml")
13 changes: 13 additions & 0 deletions openupgrade_scripts/scripts/uom/14.0.1.0/upgrade_analysis_work.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---Models in module 'uom'---
---Fields in module 'uom'---
uom / uom.category / measure_type (selection) : DEL selection_keys: ['length', 'unit', 'volume', 'weight', 'working_time']
# NOTHING TO DO: not used anymore, error when filled in v13.

uom / uom.uom / measure_type (selection) : DEL selection_keys: function
# NOTHING TO DO: It stored the measure type from uom.category, but not needed anymore.

---XML records in module 'uom'---
NEW uom.uom: uom.product_uom_cubic_foot (noupdate)
NEW uom.uom: uom.product_uom_cubic_inch (noupdate)
NEW uom.uom: uom.product_uom_cubic_meter (noupdate)
# NOTHING TO DO: (noupdate="1") Adds new imperial system volume units