[7.0] set_partner_id_from_partner_address_id triggers all ORM checks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenUpgrade Addons |
New
|
Undecided
|
Unassigned |
Bug Description
Method set_partner_
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_
What do you think?