-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
[16.0][BUG] When migrating the rma module from v15 to v16 #395
Comments
If I delete the migrations folder (which was added 2 weeks ago by @mt-software-de and @victoralmau) of the rma module, the migration from 15 to 16 is done correctly |
The commit what was used was cherry-picked from v14. But to help here, the fields rma_in_type_id and/or rma_out_type_id not set on the warehouse, the are used and mandatory to create the new rules for the rma proc run. Within the migration we have to ensure, that those fields are set. rma/rma/models/stock_warehouse.py Line 149 in 6713de3
rma/rma/models/stock_warehouse.py Line 185 in 6713de3
|
We will check it soon. Thanks for the extra info, Michael. |
Thanks @mt-software-de I have configured all the warehouses so that the rma_loc_id, rma_in_type_id and rma_out_type_id fields have a value and after running the migration again this error no longer occurs |
…if not set) Fixes OCA#395
…if not set) Fixes OCA#395
…if not set) Fixes OCA#395
After the update in the migrations folder of the rma module I receive this error when migrating from odoo 15 to 16
`2024-06-19 16:35:16,697 1 INFO mig odoo.modules.migration: module rma: Running migration [16.0.1.4.0>] post-migration
2024-06-19 16:35:16,716 1 INFO mig OpenUpgrade: rma: post-migration script called with version 15.0.1.3.0
2024-06-19 16:35:16,760 1 ERROR mig odoo.sql_db: bad query: INSERT INTO "stock_rule" ("action", "active", "auto", "company_id", "create_date", "create_uid", "delay", "group_propagation_option", "location_dest_id", "location_src_id", "name", "picking_type_id", "procure_method", "propagate_cancel", "propagate_carrier", "route_id", "sequence", "warehouse_id", "write_date", "write_uid") VALUES ('pull', true, 'manual', 1, '2024-06-19 16:35:15.665919', 1, 0, 'propagate', NULL, 9, '{"en_US": "Ofi: Cliente"}', NULL, 'make_to_stock', false, false, 30, 20, 1, '2024-06-19 16:35:15.665919', 1) RETURNING "id"
ERROR: null value in column "picking_type_id" of relation "stock_rule" violates not-null constraint
DETAIL: Failing row contains (90, 1, {"en_US": "Ofi: Cliente"}, 20, 1, 1, t, 2024-06-19 16:35:15.665919, pull, 2024-06-19 16:35:15.665919, null, propagate, null, null, 9, null, 0, 1, f, make_to_stock, null, 30, null, manual, f).
2024-06-19 16:35:16,760 1 ERROR mig OpenUpgrade: rma: error in migration script /odoo_env/src/OCA/rma/rma/migrations/16.0.1.4.0/post-migration.py: null value in column "picking_type_id" of relation "stock_rule" violates not-null constraint
DETAIL: Failing row contains (90, 1, {"en_US": "Ofi: Cliente"}, 20, 1, 1, t, 2024-06-19 16:35:15.665919, pull, 2024-06-19 16:35:15.665919, null, propagate, null, null, 9, null, 0, 1, f, make_to_stock, null, 30, null, manual, f).
2024-06-19 16:35:16,760 1 ERROR mig OpenUpgrade: null value in column "picking_type_id" of relation "stock_rule" violates not-null constraint
DETAIL: Failing row contains (90, 1, {"en_US": "Ofi: Cliente"}, 20, 1, 1, t, 2024-06-19 16:35:15.665919, pull, 2024-06-19 16:35:15.665919, null, propagate, null, null, 9, null, 0, 1, f, make_to_stock, null, 30, null, manual, f).
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/openupgradelib/openupgrade.py", line 2296, in wrapped_function
version,
File "/odoo_env/src/OCA/rma/rma/migrations/16.0.1.4.0/post-migration.py", line 13, in migrate
route_vals = wh._create_or_update_route()
File "/odoo_env/src/odoo/addons/stock/models/stock_warehouse.py", line 480, in _create_or_update_route
self._find_existing_rule_or_create(rules_list)
File "/odoo_env/src/odoo/addons/stock/models/stock_warehouse.py", line 610, in _find_existing_rule_or_create
self.env['stock.rule'].create(rule_vals)
File "", line 2, in create
File "/odoo_env/src/odoo/odoo/api.py", line 414, in _model_create_multi
return create(self, [arg])
File "/odoo_env/src/odoo/odoo/addons/base/models/ir_fields.py", line 670, in create
recs = super().create(vals_list)
File "", line 2, in create
File "/odoo_env/src/odoo/odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "/odoo_env/src/odoo/odoo/models.py", line 3975, in create
records = self._create(data_list)
File "/odoo_env/src/odoo/odoo/models.py", line 4158, in _create
[tuple(row) for row in rows],
File "/odoo_env/src/odoo/odoo/sql_db.py", line 321, in execute
res = self._obj.execute(query, params)
psycopg2.IntegrityError: null value in column "picking_type_id" of relation "stock_rule" violates not-null constraint
DETAIL: Failing row contains (90, 1, {"en_US": "Ofi: Cliente"}, 20, 1, 1, t, 2024-06-19 16:35:15.665919, pull, 2024-06-19 16:35:15.665919, null, propagate, null, null, 9, null, 0, 1, f, make_to_stock, null, 30, null, manual, f).
`
The text was updated successfully, but these errors were encountered: