Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5049 Weergaven

i create button to show RFQ code is below

```

<div class="oe_button_box" name="button_box"> 

 <button class="oe_stat_button" name="%(purchase.purchase_rfq)d" type="action" icon="fa-arrows-v"

 context="{'default_ssr_id': [active_id],'search_default_ssr_id': [active_id]}"> 

 <field name="po_count" widget="statinfo" string="PO"/> 

 </button>                           

 </div>

```

its not show record it's show complete list of RFQ ....

Avatar
Annuleer
Beste antwoord

Hi Usman,

Why don't you call a method from your button and return an action from the method.

In the method, pass a domain in the action which will show you the RFQs related to your record.

    @api.multi
def open_rfq(self):
self.ensure_one()
action = self.env.ref('purchase.purchase_rfq').read()[0]
action.update({
'domain': [('ssr_id', '=', self.id)]
})
return action

Hope this will work for you.

Avatar
Annuleer
Auteur

<div class="oe_button_box" name="button_box">

<button class="oe_stat_button" name="open_rfq" type="action" icon="fa-arrows-v">

<field name="po_count" widget="statinfo" string="PO"/>

</button>

</div>

and add your function in python file but button click nathing pls any help

Button type must be of object and not action because button is calling python func.

type="object"

On Mon, Jun 10, 2019, 8:33 PM Usman Farzand <usman_farzand@outlook.com> wrote:

<div class="oe_button_box" name="button_box">

<button class="oe_stat_button" name="open_rfq" type="action" icon="fa-arrows-v">

<field name="po_count" widget="statinfo" string="PO"/>

</button>

</div>

and add your function in python file but button click nathing pls any help

Sent by Odoo S.A. using Odoo.

Auteur

you are just awsome

Gerelateerde posts Antwoorden Weergaven Activiteit
0
dec. 21
2159
2
okt. 20
4993
0
mei 20
3083
1
jul. 20
5501
3
sep. 25
488