← Back to team overview

credativ team mailing list archive

[Bug 1359922] [NEW] [7.0] set_partner_id_from_partner_address_id triggers all ORM checks

 

Public bug reported:

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?

** Affects: openupgrade-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of
OpenUpgrade Committers, which is subscribed to OpenUpgrade Addons.
https://bugs.launchpad.net/bugs/1359922

Title:
  [7.0] set_partner_id_from_partner_address_id triggers all ORM checks

Status in OpenUpgrade Addons:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/openupgrade-addons/+bug/1359922/+subscriptions


Follow ups

References