Odoo Help


open popup from button click

abdelwahed chiheb
on 3/8/14, 12:10 PM 3,185 views

hi everyone,

i want to open popup window to show a history sale for a spécific product,

def product_history_client(self, cr, uid, ids, context=None):
    ir_model_data = self.pool.get('ir.model.data')
        compose_form_id = ir_model_data.get_object_reference(cr, uid, 'sms_product_client_hist', 'hist_product_cust')[1]
    except ValueError:
        compose_form_id = False

return { 'name': _('Customer sale history'), 'type': 'ir.actions.act_window', 'view_type': 'tree', 'view_mode': 'tree', 'res_model': 'sale.order.line', 'view_id': compose_form_id, 'target': 'new', 'context': context, }

<openerp> <data> <record id="hist_product_test" model="ir.ui.view"> <field name="name">hist.product.test</field> <field name="model">sale.order.line</field> <field name="type">tree</field> <field name="priority">16</field> <field name="arch" type="xml"> <tree string="product hist"> <field name="product_id"/> <field name="name"/> <field name="price_unit"/> </tree> </field> </record> <record id="view_order_form_histo" model="ir.ui.view"> <field name="name">sale.order.form.histo</field> <field name="model">sale.order</field> <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml"> <data> <xpath expr="/form/sheet/notebook/page/field[@name='order_line']/form/group/group/div/field[@name='product_uom_qty']" position="after"> <button name="product_history_client" string="historique client" type="object" class="oe_highlight oe_link"/> </xpath>
</data> </field> </record> </data> </openerp>

the popup appear normally but when i close it i have this error :( > DataError: invalid input syntax for integer: "one2many_v_id_864" LINE 1: ...OM "sale_order_line" WHERE sale_order_line.id IN ('one2many_... please help ! thanks

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/8/14, 12:10 PM
Seen: 3185 times
Last updated: 3/16/15, 8:10 AM