Odoo Help

Welcome!

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.

0

How to add active_id in the url???

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

Helloooo guys!

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

http://24.226.196.31:8069/web?debug=#page=0&limit=80&view_type=list&model=stock.picking&action=316&active_id=1

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

http://24.226.196.31:8069/web?debug=#page=0&limit=80&view_type=list&model=stock.picking&action=316

 

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>
            <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.
              </p>
              <p>
                ZZZZZZZZZZZZZZZZMost operations are prepared automatically by Odoo according
                to your preconfigured logistics rules, but you can also record
                manual stock movements.
              </p>
            </field>
        </record>

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

0

Pascal Tremblay

--Pascal Tremblay--
1312
| 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>


        </record>

 

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)

Stats

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