Odoo Help


How to add active_id in the url???

Pascal Tremblay
on 1/20/15, 1:52 PM 2,651 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 3 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>



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

2 follower(s)


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