Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
16024 Widoki

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>
    </record>
Awatar
Odrzuć
Najlepsza odpowiedź

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".

Awatar
Odrzuć
Autor

it worked ! Thanks a lot

Powiązane posty Odpowiedzi Widoki Czynność
2
maj 24
7796
2
maj 24
9216
1
sty 22
11978
6
sty 24
16250
0
mar 15
3675