← Back to team overview

openerp-expert-framework team mailing list archive

Re: Improve user / integrator experience

 

>
>
> The generic issue IMHO is the open erp browse object/class which has two
> problems:
>
>    1. raises an error when the expression is wrong eg.
>    user.partner_id.name (if partner id doesnt exist or is false it returns
>    err so we are forced to write user.partner_id and user.partner_id.name)
>    2. if a field is empty it return False, it should be possible to
>    selectively change what should be the return value if database/computed
>    value is null. So if we can selectively opt to choose like
>    self.pool.get('model').browse(cr,uid,ids,context={'null_value' = ''}) and if
>    browse object respects this, there should be no problem.
>
> Sharoon, nice suggestion, and I agree for 1). However, for 2), returning ""
instead of False would break a lot commonly used boolean expressions.
For instance [[ product.price_extra or "No extra cost!" ]] would return ""
rather than "No extra cost!" if we do what you propose. So I don't think
this would be more user friendly than the current awkwardness.
What I propose for 2) is a bit different. I propose that the expression
evaluator, change False to "" but only at the expression level (once the
whole [[ ]] block has been evaluated), not at the object attribute level
which would screw up boolean expressions.

Do you agree on this? Do you see any way of doing it?

Raphaël Valyi
http://www.akretion.com

Follow ups

References