[7.0] set_partner_id_from_partner_address_id triggers all ORM checks

Bug #1359922 reported by Pedro Manuel Baeza
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenUpgrade Addons
New
Undecided
Unassigned

Bug Description

Method set_partner_id_from_partner_address_id of OpenUpgrade is using:

model.write(cr, SUPERUSER_ID, row[0], {partner_field: row[1]})

for writing values, making that ORM checks all constraints, and provoking that sometimes migration process stops because one of this checks fails.

For example, you create a product without checking tracking lots on outgoing moves. You make then some moves for a customer. Afterwards, you mark the checkbox, and start the migration with this check marked. When stock migration script wants to convert this stock.move, it will stop because the check for lot is failing. This is a real case I have faced.

I don't know if any of the current migration scripts needs to lauch ORM write method for doing something extra, but I propose to change current method to an SQL write of the value, and have another method set_partner_id_from_partner_address_id_via_orm with the current approach.

What do you think?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.