Skip to Content
Menu
This question has been flagged

I made a action button in my module (check ip using ipwhois). Now i need to integrate this module in website. It is easy to show fields, but i don't know how make this button. It is shown on webpage, but function is not callable.

As i understand: clicking on button must call python function, reload page and write a new value in field "result_check".

in views.xml

<record id="sale_form_view" model="ir.ui.view">
  <field name="name">sale.form</field>
  <field name="model">product.template</field>
  <field name="inherit_id" ref="website_sale.product_template_form_view"/>
  <field name="arch" type="xml">
  <field name="categ_id" position="after">
  <button name="make_request" type="object" string="Make check" />
  <field name="result_check" />
  </field>
  </field>
</record>


in template.xml

<templateid="add_fields_product"inherit_id="website_sale.product">
<xpathexpr="//div[@id='product_details']"position="before"> 
<div>
     <a role="button" href="#">  <span>Make check</span>  </a> 
   <p itemprop="name" t-field="product.result_check">Result</p> 
</div> 
</xpath>
</template>
Avatar
Discard
Related Posts Replies Views Activity
0
Jun 20
1644
1
Nov 24
181
0
Mar 22
942
2
May 24
6582
3
Apr 24
1004