Good day everyone, could you help me with the code to hide the client selection button in the Odoo 18 post, I have been trying but I have not been able to achieve it, I have seen tutorials but unfortunately only for Odoo 16 and it does not serve as an example, I understand that I must create two files, a js and an xml, but I still do not get results, in the same way know how I can modify this in the Odoo views from the graphical interface, thanks for your support.
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- Бухгалтерия
- Склад
- PoS
- Project
- MRP
Этот вопрос был отмечен
            
                1
                
                    Ответить
                
            
        
        
            
                1661
                
                    Представления
                
            
        
    Step-by-Step Implementation:
1.Create a custom module
Directory structure:
pos_hide_customer_button/ ├── __init__.py ├── __manifest__.py ├── static/ │ └── src/ │ └── js/ │ └── pos_hide_customer_button.js ├── views/ │ └── assets.xml
2. __manifest__.py
{
    'name': 'POS Hide Customer Button',
    'version': '1.0',
    'category': 'Point of Sale',
    'summary': 'Hide customer button in POS screen',
    'depends': ['point_of_sale'],
    'data': [
        'views/assets.xml',
    ],
    'assets': {
        'point_of_sale._assets_pos': [
            'pos_hide_customer_button/static/src/js/pos_hide_customer_button.js',
        ],
    },
    'installable': True,
    'auto_install': False,
    'license': 'LGPL-3',
}
3. views/assets.xml
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <template id="assets_pos" inherit_id="point_of_sale.assets">
        <xpath expr="." position="inside">
            <script type="module" src="/pos_hide_customer_button/static/src/js/pos_hide_customer_button.js"/>
        </xpath>
    </template>
</odoo>
4. static/src/js/pos_hide_customer_button.js
/** @odoo-module **/
import { PosComponent } from "@point_of_sale/app/components/pos_component";
import ProductScreen from "@point_of_sale/app/screens/product_screen/product_screen";
import { patch } from "@web/core/utils/patch";
patch(ProductScreen.prototype, {
    setup() {
        super.setup();
        // Hide the customer button by not rendering it at all
        this.showCustomerButton = false;
    },
});
5. Restart and Update
Or update from the Apps menu:
- Activate Developer Mode.
- Go to Apps > Update Apps List.
- Search POS Hide Customer Button and install it.
Optional: Hide via Odoo Studio (GUI)
If you have Odoo Studio (Enterprise) :
- Open POS > Settings > UI Configuration.
- Use Studio to edit the POS screen.
- Try hiding the customer button by editing screen widgets. (This is limited; not always available for POS.)
Thanks & Regards,
Email: contact@datainteger.com
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Регистрация| Related Posts | Ответы | Просмотры | Активность | |
|---|---|---|---|---|
|  | 1 мар. 24  | 3159 | ||
|  | 1 нояб. 18  | 5390 | ||
|  | 2 мар. 15  | 5046 | ||
|  | 1 июн. 25  | 1448 | ||
|  | 2 февр. 25  | 2095 | 
 
                        
Thanks a lot it works