Comment 12 for bug 580218

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [Bug 580218] Re: [trunk] - ir.actions.act_window - missing required flag on several fields (res_model, context, view_type, ...)

Le 05/07/10 18:23, Ferdinand @ ChriCar a écrit :
> You are right - there are 2 issues
> * xml definitions do not allow to "delete" context (and probably other) fields

Sorry but, why don't you want to use the following in your module, as
explained previously:

    <record id="my_action" model="ir.actions.act_window">
       ...
       <field name="context">{}</field> <!-- was wrong, reset it -->
    </record>

> * this leads to the need to do manual updates

I think you should never ask the administrators to do manual updates,
this is too error-prone and too time-consuming for support afterwards.

> your proposed solution "mandatory" does not give any positive feedback
> what to do if the field is set to None.
> the admin has to "know" that at least '{}' has to be entered. I doubt
> that all admins will know or guess.

This is why:
1) don't ask them to do it
2) do it yourself properly in your module ;-)

> probably the logic could/should be changed to handle empty fields
> gracefully.

You're right, we can do both: handle it gracefully and help prevent it.
I'll check this with the client team as well.

> I also doubt slightly that the help text (currently missing) will be
> consulted in case of mandatory error.

Good point, it doesn't hurt to put a tooltip.

The commit with everything has landed on trunk with revision 2471
(<email address hidden>) so I mark this bug as
fixed.

Thanks a lot for reporting and providing a patch as well!