On 2017-12-06 09:56, Khurram Shahzad wrote:
> On Tue, Dec 5, 2017 at 11:12 PM, Cédric Krier <[email protected]> wrote:
> 
> > On 2017-12-04 13:15, Khurram Shahzad wrote:
> > > How can I open a record from button's click event in order to view/edit
> > > this record?
> >
> > Have you considered to use a Many2One?
> >
> 
> The idea is good; but I want to run some code which will show the record
> only if a certain condition is met.

If the code is simple enough you can use the invisible state with a
PYSON expression.

> > Otherwise you must use a wizard that return an action window with the
> > record id in res_id. You can find an example in CreateMove.do_open_ of
> > account module.
> >
> I have used this method, but, it requires a lot of coding effort! I was
> looking for returning the action with res_id from the button's
> click-handler.

Action are generic so we made balanced choices between simple usage and
complex. So yes it requires some code.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20171206085608.GB30979%40kei.

Reply via email to