diff --git a/README.md b/README.md index f1a34aa..3516355 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Custom Odoo 19 module to dynamically manage the visibility of buttons and financ ## Features - Per-User Restricting Options: Toggle restriction flags directly on individual user accounts. -- Hide RFQ & Confirmation Buttons: Hide "Confirm Order" and "Send RFQ" buttons from the purchase order header for restricted users. +- Hide RFQ Button: Hide "Send RFQ" button from the purchase order header for restricted users. - Hide Financial Fields: Hide unit price, subtotal, and totals on purchase lists, forms, line kanbans, and footer groups for restricted users. - Flexible and Stateless: Instant dynamically computed restrictions without storing redundant data in the database. @@ -17,7 +17,7 @@ Custom Odoo 19 module to dynamically manage the visibility of buttons and financ 1. Go to Settings -> Users & Companies -> Users. 2. Select a User record and click Edit. 3. Open the Purchase Restrictions tab. -4. Check the desired restrictions (Hide Confirm Order & Send RFQ, Hide Price, Subtotal & Total). +4. Check the desired restrictions (Hide Send RFQ, Hide Price, Subtotal & Total). 5. Save the user record. ## Author diff --git a/models/purchase_order.py b/models/purchase_order.py index f0afc0a..3e9d27d 100644 --- a/models/purchase_order.py +++ b/models/purchase_order.py @@ -49,9 +49,9 @@ class PurchaseOrder(models.Model): modified = False - # 1. Dynamically hide Confirm Order and Send RFQ buttons + # 1. Dynamically hide Send RFQ button if hide_buttons: - for btn in doc.xpath("//button[@name='action_rfq_send' or @name='button_confirm']"): + for btn in doc.xpath("//button[@name='action_rfq_send']"): btn.set('invisible', '1') modified = True diff --git a/models/res_users.py b/models/res_users.py index 7add53b..c69376b 100644 --- a/models/res_users.py +++ b/models/res_users.py @@ -5,8 +5,8 @@ class ResUsers(models.Model): _inherit = 'res.users' hide_confirm_order_send_rfq = fields.Boolean( - string="Hide Confirm Order & Send RFQ", - help="Hide Confirm Order and Send RFQ buttons on Purchase Order form for this user." + string="Hide Send RFQ", + help="Hide Send RFQ button on Purchase Order form for this user." ) hide_purchase_prices = fields.Boolean(