Am Freitag, den 27.05.2011, 13:16 +0200 schrieb Cédric Krier:
> On 27/05/11 13:06 +0200, Udo Spallek wrote:
> > Hi,
> > with the timesheet module I like to create timesheet lines for other
> > users than the current user of the transaction. In the module is an
> > ir.rule.group[1] defined and connected to an ir.rule[2]. The ir.rule
> > restricts the transaction users CRUD permissions to timesheet lines,
> > where he/she is the employee. In short words, a user can only work on
> > his/her own timesheet lines.
> > The ir.rule.group sets the default_p to True, which means, that this
> > rule is a default rule for all users, correct?
> > So my question is, how can I define a user, which is able to create a
> > timesheet line for other users?
> Create a rule which allow this, put it in a group and put your user in it.

Yes, this works, thanks a lot! JFTR:

    <record model="ir.rule.group" 
            id="rule_group_line_all_employees">
        <field name="model" 
                search="[('model', '=', 'timesheet.line')]"/>
        <field name="global_p" eval="False"/>
        <field name="default_p" eval="False"/>
    </record>
    <record model="ir.rule" id="rule_line_all_employees">
        <field name="field" search="[('name', '=', 'employee'),
('model.model', '=', 'timesheet.line')]"/>
        <field name="operator">in</field>
        <field name="operand">User/Current Company/Employees</field>
        <field name="rule_group" ref="rule_group_line_all_employees"/>
    </record>


-- 
Udo Spallek

------------------------------------
virtual things
Preisler & Spallek GbR
Munich - Aix-la-Chapelle

Windeckstr. 77
81375 Munich - Germany
Tel: +49 (89) 710 481 55
Fax: +49 (89) 710 481 56

[email protected]
http://www.virtual-things.biz


-- 
[email protected] mailing list

Reply via email to