Skip to Content
Menu
You need to be registered to interact with the community.
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
jun. 20
2653
1
nov. 24
1112
0
mar. 22
1809
2
maj 24
8822
2
avg. 25
2543