Skip to Content
Menu
This question has been flagged
1 Reply
271 Views

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.

Avatar
Discard
Best Answer
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

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 24
2108
1
Nov 18
4218
2
Mar 15
4124
1
Jun 25
366
2
Feb 25
995