I have added a page to sales orders and added an custom field for bill (many2many)
I need a way to make the field read-only for specific users only admin can add the bill
This my code
can any one help please
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I have added a page to sales orders and added an custom field for bill (many2many)
I need a way to make the field read-only for specific users only admin can add the bill
This my code
can any one help please
Hello Esraa Abu Amer,
Hope you are doing well.
write you code like this.
//Code in comment//
Hope this helps!
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Code :
<xpath expr="//field[@name='cover_page']" position="before">
<field name="is_manager" invisible="1"/>
<field name="bill_ids"
attrs="{'readonly':[('is_manager', '=', False)]}"/>
</xpath>
is_manager = fields.Boolean(
compute="_compute_is_manager",
)
def _compute_is_manager(self):
self.is_manager = self.env.user.has_group("sales_team.group_sale_manager")
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
9
يوليو 21
|
62407 | ||
|
8
نوفمبر 19
|
7377 | ||
|
3
أغسطس 24
|
15526 | ||
|
0
مايو 23
|
1501 | ||
|
1
مارس 23
|
2021 |