HI Ced,
On Monday, December 16, 2013 9:45:52 AM UTC-6, Cédric Krier wrote:
>
> On 15/12/13 19:33 -0800, Josias Pérez wrote:
> > Hi,
> >
> > I only want to know how record rule work. For example, I have added to
> > party.party and company.employee "type" field ('a', 'b' and 'global).
> >
> > With the follow rule ['OR', [( 'type' , 'in', ['global','a','b'] if
> > user.employee.type == 'global' else [] )], [ ('type', '=',
> > user.employee.type )] ] hide parties that doesnt belong to employee of
> the
> > same type, and only show parties for employee types (global show all).
>
> On which Model does the rule apply?
>
It's on party.party model.
>
> > The question is: when a employee type 'a' for example, want to create a
> > sale, tryton client say "You can read records that doesn't exists".
>
> Probably the employe can not read the party of the company.
>
The employee can read only parties with his 'type' (a, b, global).
>
> > How
> > control inherits in records to another models to prevent that message?
>
> I don't understand the question.
>
> Any way, record rules are very complex to manage, you should really have
> a good point to use them. And I really don't see why you should add such
> rule to party because party reflect the external world which is readable
> by everyone.
>
We have differents types of clients, but, when the user can see only this
own records types, specially in parties, invoices and sales. Let me know if
the question its more clear. Its a very important thing to have control on
what information can read every type of user.
>
> --
> Cédric Krier - B2CK SPRL
> Email/Jabber: [email protected] <javascript:>
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/
>