Refactor old style wizards using OOP osv_memory instead

Registered by Raphaël Valyi -

old wizards are not OOP and lead to non compatibles modules/ugly code/non maintainable code because of this.
Since rewriting all wizards is too much work for 5.2, I propose to rewrite at least the main ones we often need to extend.

Blueprint information

Needs approval
Series goal:
Milestone target:
milestone icon 6.0
Started by
Raphaël Valyi -
Completed by
Raphaël Valyi -



Hope this will help community.

The main old wizards I would like to see rewritten using osv_memory are:

- packing wizards: partial packing, return packing, etc.
- invoice on picking
- pay invoice
- group purchase orders
- transform lead into partner in CRM
- mass reconciliation


The issue is, as you can see on our branch where we already did it for the "invoice on pciking":

But currently, The OpenObject framework has limitations with osv_memory wizard, especially in the clients that make it impossible to make the a drop in replacement for old non OOP wizards.

1) osv_memory wizards can't be put in the right side panel with the other wizards
2) it looks like osv_memory wizards can't be called with several records like other wizards
3) we need some scoping guidance. Putting all wizard specif code inside the object main file doesn't scale as it doesn't explicit where things are dependents or independents. Having a separated file like the old wizard is much better to this respect. However, in the current codebase, no osv_memory has been put inside such external files, we need some good convention to be established by Tiny so it can be followed.

We first need a guidance from Tiny on how to refactor those wizards with a working example, then the community would be very happy to refactor them.

Raphaël Valyi - 15/02/2010
Using Twitter, Olivier Dony from Tiny just mentioned me that osv_memory may actually be able to do the job.
He suggest we investigate that new example:
Anyone to confirm? I'll look at that myself too later in the week, so feel free to finish our invoice on packing example in the meantime in our branch, it's open to the committer group. If that works, then we can allocate the refactoring work for the other wizards.

Numérigraphe - 2010-03-30
Refactoring the stock packing wizards is on our radar. They're definitly unusable in our business, and I think I can provide a cleaner wizard using a bare-bone old-style wizard and a few osv_memory objects.
If anyone else is working on this, please let me know: I'll gladly help or review.

Sharoon Thomas - 2010-03-30
Quote :"1) osv_memory wizards can't be put in the right side panel with the other wizards"
 - osv_memory wizards can be used with wizard buttons. (Answer: yes we can do this, don't use wizard element, but record element on ir.values "Christophe Chauvet")
Quote : "2) it looks like osv_memory wizards can't be called with several records like other wizards"
 - It can be done with active_ids too (Answer: yes it works in list view, see the first answer)

All right it has all been implemented in v6 by now. Cool!


Work Items