Can I hide the button? What about users who import products? I also need to prevent them from importing archived products or changing the active status via import.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
You can create an Automated Action for this. Full details: https://odootricks.tips/use-automated-actions-to-stop-users-archiving-products/
Model: Product Template
Trigger Condition: On Creation & Update
Before Update Domain: Active records
Apply On: Active is not set
Action to Do: Execute Python Code
Python Code:
if not env.user.has_group('sales_team.group_sale_manager'):
raise Warning('You cannot archive products')
You can choose any user access group: sales_team.group_sale_manager is the Sales Manager group, but you can use whatever makes sense for your organization.
This should prevent users from archiving products from anywhere, including the export / import tool. You could use this alongside Dishon's solution.
This method doesn't allow to create and update records. Is there any trick to just revoke the archive action?
Hello Aashim,
I used https://apps.odoo.com/apps/modules/13.0/htsk_dynamic_access_rights/ to hide the archive button for my users.
You can hide the button by using attributes or groups.for example
<button name = "reset" string = "Reset to Issued"
type = "object"
attrs = "{'invisible': [('state', '! =', 'paid')]}
class =" oe_highlight "/>
or
<button name = "action_assign" states = "confirmed, waiting"
string = "Reserve" type = "object" class = "oe_highlight"
groups = "stock.group_stock_manager" />
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 4 22
|
9292 | ||
|
1
thg 7 21
|
22419 | ||
V11 Connect with Shopware
Đã xử lý
|
|
6
thg 8 20
|
5323 | |
|
1
thg 5 20
|
5511 | ||
|
1
thg 9 19
|
2831 |