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.


Dynamic Domain in Windows Action

on 5/6/14, 11:43 PM 2,840 views

I added shop_id field in res.users object, to determine the user is belong to which branch/shop

'shop_id': fields.many2one('sale.shop', 'Branch'),

I have few records on my shop for example

Shop: Main - Warehouse: Main, Shop: Branch Nagoya - Warehouse: Nagoya, Shop: Branch Habour - Warehouse: Habour

Now i need to filter on purchase menu by warehouse. So for example if user belongs to shop Nagoya, user is only be able to see purchase record which the record's warehouse is Nagoya only. How do i filter it on my windows action? Am i be able to have dynamic filter domain on xml? Like put in python function or anything

    <record id="purchase_form_action" model="ir.actions.act_window">
        <field name="name">Purchase Orders</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">purchase.order</field>
        <field name="view_mode">tree,form,graph,calendar</field>
        <field name="context">{'search_default_approved': 1,'search_default_create_uid':uid}</field>
        <field name="search_view_id" ref="view_purchase_order_filter"/>
        <field name="help">Use this menu to search within your purchase orders by references, supplier, products, etc. For each purchase order, you can track the products received, and control the supplier invoices.</field>

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 5/7/14, 4:10 AM

Create a rule for group "Purchases / User" or "Purchases / Manager".

Documentation link for Rules

For more info:
Please refer the rules used in group of "Sales / See Own Leads".

it worked ! Thanks a lot

on 5/7/14, 4:42 AM

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

0 follower(s)


Asked: 5/6/14, 11:43 PM
Seen: 2840 times
Last updated: 3/16/15, 8:10 AM