[6.0, project] Assign invalid state to analytic account

Bug #1075200 reported by Ignacio Villena
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenUpgrade Addons
Fix Released
Low
Stefan Rijnhart (Opener)

Bug Description

When migrating from 5.0.13 to 6.0 during the module project I get this error:

ERROR:OpenUpgrade:project: error in migration script openupgrade-addons/6.0/project/migrations/6.0.1.1/post-migration.py: ('ValidateError', u'The value "don
e" for the field "state" is not in the selection')
[2012-11-05 13:48:09,224][MIGRACION] ERROR:OpenUpgrade:Traceback (most recent call last):
  File "6.0/bin/openupgrade/openupgrade.py", line 387, in wrapped_function
    func(cr, version)
  File "project/migrations/6.0.1.1/post-migration.py", line 165, in migrate
    migrate_analytic(cr, pool)
  File "project/migrations/6.0.1.1/post-migration.py", line 74, in migrate_analytic
    'state': row[9] or False,
  File "openupgrade-addons/6.0/project/project.py", line 755, in create
    return super(account_analytic_account, self).create(cr, uid, vals, context=context)
  File "6.0/bin/osv/orm.py", line 3705, in create
    self._check_selection_field_value(cr, user, field, vals[field], context=context)
  File "6.0/bin/osv/orm.py", line 2378, in _check_selection_field_value
    _('The value "%s" for the field "%s" is not in the selection') % (value, field))
except_orm: ('ValidateError', u'The value "done" for the field "state" is not in the selection')

Browsing the code for openupgrade-addons/6.0/project/migrations/6.0.1.1/post-migration.py line 74 I see the "State" field for account_analytic_account is directly read from the "State" field of project_project but they don't share the same states so the creation fails

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Ignacio,

thank you for reporting this. Seems like an easy thing to fix so I pushed an untested branch for this. It would be great if you could try this branch to see if it fixes the problem for you: lp:~therp-nl/openupgrade-addons/6.0-lp1075200-map_project_states_to_analytic

Cheers,
Stefan.

Changed in openupgrade-server:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Stefan Rijnhart (Therp) (stefan-therp)
affects: openupgrade-server → openupgrade-addons
summary: - project module: account_analytic_account
+ [6.0, project] Assign invalid state to analytic account
Revision history for this message
Ignacio Villena (ignacio-villena) wrote :

Hello Stefan,

yes this patch is working for me

Thanks

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Ignacio,

thank you for testing! I merged the solution in revision 4787 of lp:openupgrade-addons/6.0

Cheers,
Stefan.

Changed in openupgrade-addons:
status: Triaged → Fix Released
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.