Guys, this related, I think we would also need some kind of constraint that will just display some kind of warning like: "the data you are passing have this problem/consequence Do you still want to save YES / NO ?" And if yes, we would save the data no matter what.
I think this isn't that hard to achieve, like repeating the save call from a wizard popup with some context that will bypass the exception. But I think framework support for this would be awesome as currently dealing with this is just too complex, so most of the time we don't do it and this results in a bad usability.. Thoughts? -- Raphaƫl Valyi Founder and consultant +55 21 3010 9965 www.akretion.com On Thu, Jul 7, 2011 at 7:09 PM, Albert Cervera i Areny <[email protected]>wrote: > ** > > A Dimecres, 6 de juliol de 2011 13:26:10, Thibaut DIRLIK va escriure: > > > Hi everybody, > > > > > > I'm not sure this ML is the good place to do framework features request. > > > Tell me if it's not. > > > > > > I think we could improve _constraints error message. Currently, the > > > message is static. It would be a good idea to let it be dynamic. > > > > > > For example, I'm working a module which allocate ressources to a project > > > task, and a ressource can't be allocated if an other task already use it > > > at the same time. > > > > > > In the message, we can't tell the user which task is using the > > > ressource, because it is static. > > > > > > A workaround could be to catch an exception like ValidationError or > > > ConstraintError (as you want, the name doesn't matter). If such an > > > exception is raised, the str() of the exception object could be used > > > instead of the default message. This feature will stay compatible with > > > the old system and add some flexibility. > > > > > > I'm pretty sure it's not hard to implement and it could improve user > > > experience in some cases for 6.1 modules. What do you think ? > > > Well, we use an osv.except_osv() instead of returning False. That said, I > think the API should simply not include the possibility of adding a static > text and force the developer to always use the exception. The possibility > that comments Olivier seems to complex to me, compared to how easy it is to > raise an insightful exception. > > > > > > > -- > > > Thibaut DIRLIK > > > > > > _______________________________________________ > > > Mailing list: https://launchpad.net/~openerp-expert-framework > > > Post to : [email protected] > > > Unsubscribe : https://launchpad.net/~openerp-expert-framework > > > More help : https://help.launchpad.net/ListHelp > > > -- > > Albert Cervera i Areny > > http://www.NaN-tic.com > > OpenERP Partners <http://www.NaN-tic.com> > > Tel: +34 93 553 18 03 > > > http://twitter.com/albertnan > > http://www.nan-tic.com/blog > > > _______________________________________________ > Mailing list: https://launchpad.net/~openerp-expert-framework > Post to : [email protected] > Unsubscribe : https://launchpad.net/~openerp-expert-framework > More help : https://help.launchpad.net/ListHelp > >
_______________________________________________ Mailing list: https://launchpad.net/~openerp-expert-framework Post to : [email protected] Unsubscribe : https://launchpad.net/~openerp-expert-framework More help : https://help.launchpad.net/ListHelp

