Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
20019 มุมมอง

Hiiiii

Please Do me a favour..

Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Jack, there are two ways to use uid in xml:

(1) You can use uid in xml by domain

Here is the example,

<search>
    <filter string="My Entries" domain="[('user_id','=',uid)]" icon="terp-personal"/>
</search>

Or you can refer addons modules,

Here is the link for version 6.0 example and version 7.0 example

(2) You can pass uid as context in action

<record id="my_action" model="ir.actions.act_window">
    <field name="name">My Action</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">my.model</field>
    <field name="view_type">form</field>
    <field name="context">{"search_default_user_id":uid}</field>
    <field name="view_id" ref="my_tree_view"/>
</record>

You can hide Confirm Sale button by assigning group to them. And assign only those users to that group to whom you want to show confirm sale button.

<button name="order_confirm" states="draft" string="Confirm Order" groups="your_module.your_group"/>

So it will show to only those users which are assigned to your_group.

First make user in your xml file

Like this:

    <record id="your_module.captain_jack" model="res.users">
        <field name="login">jakes</field>
        <field name="password">captainjake007</field>
        <field name="name">Jakes Sparrow</field>
        <field name="signature">Captain Jakes Sparrow</field>
    </record>

So now user is created. Now make a group and assign this user to your new group

Like this:

    <record model="res.groups" id="your_group">
        <field name="name">Group of Pirates</field>
        <field name="users" eval="[(4,ref('your_module.captain_jack'))]"/>
    </record>

Thanks.

อวตาร
ละทิ้ง
ผู้เขียน

hiiiiiiii.................how we can make groups?

Check my updated answer.

คำตอบที่ดีที่สุด

Some more informations would be great.

You may need to add a function to your model to get the uid. What are you trying to do?

อวตาร
ละทิ้ง
ผู้เขียน

I want to remove the "Confirm Sale" button from the sales order for some user.....For this i want the uid to acces in xml by which i can put "attrs" for "Confirm Sale" button.....

ผู้เขียน คำตอบที่ดีที่สุด

I want to remove the "Confirm Sale" button from the sales order for some user.....For this i want the uid to acces in xml by which i can put "attrs" for "Confirm Sale" button.....

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 25
2384
0
พ.ย. 24
2189
0
มิ.ย. 24
2049
1
มิ.ย. 24
2626
0
ต.ค. 23
2666