On 2017-01-27 08:32, Khurram Shahzad wrote:
> Dear All,
> 
> I am trying to add a record rule to user for restricting him to see one 
> stock location only. The rule is:
> 
> [["location.id","=",2]]

It is not clear on what is the rule applied.
Could you give more information?

> But, when I click on 'Internal shipments' which use stock locations, it 
> gives following error:
> KeyError: u 'location'
> 
> Probably, the name 'location' used to refer the model 'stock.location' is 
> not correct. Can anybody guide me what is the correct name for referring to 
> 'stock.location'. 

Without the full traceback, it is difficult to understand what is
happening.

But on a general side, record rules are very hard to setup correctly
because in contrary of other access rights, they are deeply enforced in
the all ORM instead of being only on the border (see issue4081). This
has to stay until issue4080 is solved.


https://bugs.tryton.org/issue4081
https://bugs.tryton.org/issue4080

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20170128223024.GC93815%40tetsuo.

Reply via email to