Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
20005 Lượt xem

Hiiiii

Please Do me a favour..

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Check my updated answer.

Câu trả lời hay nhất

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?

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 25
2377
0
thg 11 24
2186
0
thg 6 24
2048
1
thg 6 24
2623
0
thg 10 23
2660