Odoo Help


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


How to add active_id in the url???

Pascal Tremblay
on 1/20/15, 1:52 PM 1,779 views

Helloooo guys!

I want my new link « Receipts - PT » leads to : (how to add active_id=1????)

For the moment, my new link « Receipts - PT » leads to :


I ger error :

Odoo Client Error

Error: NameError: name 'active_id' is not defined

My import :

        <record id="report_lapagept.action_receipts" model="ir.actions.act_window">
            <field name="name">Receipts - PT action</field>
            <field name="res_model">stock.picking</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form,calendar</field>
            <field name="domain"></field>
            <field name="context">{
                    'search_default_picking_type_id': [active_id],
                    'default_picking_type_id': active_id,
                    'contact_display': 'partner_address',
            <field name="search_view_id" ref="stock.view_picking_internal_search"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to create a stock operation.
                ZZZZZZZZZZZZZZZZMost operations are prepared automatically by Odoo according
                to your preconfigured logistics rules, but you can also record
                manual stock movements.

        <menuitem id="report_lapagept.menu_receipts" name="Receipts - PT" parent="stock.menu_stock_warehouse_mgmt" action="report_lapagept.action_receipts" sequence="1" />


Pascal Tremblay

--Pascal Tremblay--
| 5 2 7
Alma, Canada
--Pascal Tremblay--

Pascal Tremblay
On 1/20/15, 2:18 PM

HO YEAH!!!!!! I have found it!

Just replace the first import record by this one :

        <record id="report_lapagept.action_receipts" model="ir.actions.act_window">

            <field name="domain"></field>
            <field name="context"> {'active_id': 1, 'search_default_picking_type_id': 1, 'default_picking_type_id': 1, 'contact_display': 'partner_address'}</field>



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 1/20/15, 1:52 PM
Seen: 1779 times
Last updated: 3/16/15, 8:10 AM