how can we hide the edit button on specific record state for specific user groups.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- Müşteri İlişkileri Yönetimi
- e-Commerce
- Muhasebe
- Envanter
- PoS
- Project
- MRP
Bu soru işaretlendi
Hi
paidy kumar,
Try,
In Py
x_css = fields.Html(
sanitize=False,
compute='_compute_css',
store=False,
)
def _compute_css(self):
for rec in self:
# To Remove Edit Option
if self.env.user.has_group('module_name.group_name') and rec.state != 'draft' :
rec.x_css =''
else:
rec.x_css = False
In XML
Hope it helps,
Kiran K
your idea awesome...thank you so much you made my day.
i just changed this line rec.x_css = '<style> .o_form_button_edit {display:None}</style>'
Yea..That's Correct
Missed while copying I guess,
In Py
x_css = fields.Html(
sanitize=False,
compute='_compute_css',
store=False,
)
def _compute_css(self):
for rec in self:
# To Remove Edit Option
if self.env.user.has_group('module_name.group_name') and rec.state != 'draft' :
rec.x_css ='<style>.o_form_button_edit {display: none !important;}</style>'
else:
rec.x_css = False
In XML
<field name="x_css" force_save="1" nolabel="1"/>
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Olİlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
---|---|---|---|---|
|
2
Eyl 23
|
3529 | ||
|
1
Ara 22
|
1934 | ||
odoo 13: inverse name in comodel
Çözüldü
|
|
3
Kas 22
|
4036 | |
|
1
Kas 22
|
4353 | ||
|
0
Şub 22
|
2198 |