Open a record from button click

56 views
Skip to first unread message

Khurram Shahzad

unread,
Dec 4, 2017, 4:35:08 AM12/4/17
to try...@googlegroups.com
Hi,

How can I open a record from button's click event in order to view/edit this record?

--
 
Regards,
Khurram.

Cédric Krier

unread,
Dec 5, 2017, 1:15:06 PM12/5/17
to try...@googlegroups.com
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?

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.

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

Khurram Shahzad

unread,
Dec 6, 2017, 3:35:08 AM12/6/17
to try...@googlegroups.com
On Tue, Dec 5, 2017 at 11:12 PM, Cédric Krier <cedric...@b2ck.com> 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.


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.

Any further thoughts? Thanks for the response!

Cédric Krier

unread,
Dec 6, 2017, 4:00:05 AM12/6/17
to try...@googlegroups.com
On 2017-12-06 09:56, Khurram Shahzad wrote:
> On Tue, Dec 5, 2017 at 11:12 PM, Cédric Krier <cedric...@b2ck.com> 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.

Khurram Shahzad

unread,
Dec 6, 2017, 5:15:06 AM12/6/17
to try...@googlegroups.com
On Wed, Dec 6, 2017 at 1:56 PM, Cédric Krier <cedric...@b2ck.com> wrote:
On 2017-12-06 09:56, Khurram Shahzad wrote:
> On Tue, Dec 5, 2017 at 11:12 PM, Cédric Krier <cedric...@b2ck.com> 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.

Thanks; that's cool too!


> > 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.

--
 
Regards,
Khurram.

Dr. Habib Hussain

unread,
Dec 6, 2017, 3:43:45 PM12/6/17
to tryton
Dear Khurram Shahzad,
AOA,
I am a family physician and now a days struggling with tryton erp with health modules activated. What I want to accomplish is a POS for my clinic's pharmacy and its inventory management.

A POS solution based on Tryton seems satisfactory to me.

The ones I came across are;

presik-pos from presik technologies

one from ZikZakMedia

GCOS not actively developed.

I tried installing presik_pos......during pip install module, already installed prerequisite modules and trytond downgraded from 4.6 (current) to 4.2.. and some required modules dont have version 4.2 available, so I am stuck..

I need your help in this regard. Please .

I want to know the working configuration of your installed system.
And have you gone with presik_pos or generic one provided by tryton community ??

Can we talk on the phone? or email labeeb8 at g mai l co m.
I hope to get very useful insight from you.
Thanking in anticipation..
Dr. Habib Hussain.

Khurram Shahzad

unread,
Dec 7, 2017, 7:50:08 AM12/7/17
to try...@googlegroups.com
On Thu, Dec 7, 2017 at 1:23 AM, Dr. Habib Hussain <lab...@gmail.com> wrote:
Dear Khurram Shahzad,
AOA,
I am a family physician and now a days struggling with tryton erp with health modules activated. What I want to accomplish is a POS for my clinic's pharmacy and its inventory management.

A POS solution based on Tryton seems satisfactory to me.

The ones I came across are;

presik-pos from presik technologies

one from ZikZakMedia

GCOS not actively developed.

I tried installing presik_pos......during pip install module, already installed prerequisite modules and trytond downgraded from 4.6 (current) to 4.2.. and some required modules dont have version 4.2 available, so I am stuck..

I need your help in this regard. Please .

I want to know the working configuration of your installed system.
And have you gone with presik_pos or generic one provided by tryton community ??

We are using ZikZakMedia PoS with tryton 3.8.

Can we talk on the phone? or email labeeb8 at  g mai l  co m.
Yes, we can!
 
I hope to get very useful insight from you.
Thanking in anticipation..
Dr. Habib Hussain.

--
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/71d972f1-d97b-45b3-84d6-db10ef1682b3%40googlegroups.com.



--
 
Regards,
Khurram.
Reply all
Reply to author
Forward
0 new messages