İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
2187 Görünümler

Hello All,

there are 2 users USER A and USER B and a many2one field name PROJECT and its values are PROJECT A and PROJECT B, whenever USER A login and creates a voucher it can select only PROJECT A and PROJECT B must be hidden for USER A, same scenario for USER B. How to do this??

Help will be much appreciated.

Thanks

Avatar
Vazgeç
En İyi Yanıt

Hello Haris Masqati,

There are 2 ways to do this.

1) you can create record rule for project.project model with

Rule Definition (Domain Filter) = [('user_id', '=', user.id)] 


This will be applicable for every where in system for project model.

2) if this requirement is only for purticular model where this many2one of project is available then you can apply domain on form view of that model for project_id(m2o) field. 

  •         < field name ="project_id" domain="[('user_id', '=', uid)]"/>

    Thanks & Regards,



CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat 380015
    

Avatar
Vazgeç
Üretici

but how to assign Value PROJECT A only For USER A?

default odoo has user_id (res.users) field in project model. you have to define user for each project.