OpenUpgrade/OpenUpgrade — pull request #78 by legalsylvain (2014-06-10 15:50:49+00:00)
Title: [Framework] Function to move field (product.product -> product.template)

Hi,

I propose a function 'move_field_many_values_to_one' in the openupgrade framework that manage the move of a field from a table to an other when the old table is linked by a many2one link to the new.
Exemple for 7.0 to 8.0: A lot of fields have moved from product.product to product.template Model.
I changed the code to use this function in the two migrated modules 'product' and 'hr_expense'.
The function will be usefull for a lot of change in 'point_of_sale' too.

The function can be called with different optional parameters:
- 'quick_request': to do a sql request, otherwise a write() call will be done; (see 'product' migration for implementation);
- 'binary_field': to handle a special case if the field is a fields.binary(); (see 'product' migration for implementation);
- 'compute_func': is a function that can be defined to indicate which value will be selected; (see hr_expense migration for implementation);

Thanks for your review.