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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
1016
Lượt xem
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
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 3 24
|
2624 | ||
How to open POS from another module?
Đã xử lý
|
|
1
thg 11 18
|
4763 | |
|
2
thg 3 15
|
4566 | ||
|
1
thg 6 25
|
981 | ||
|
2
thg 2 25
|
1697 |
Thanks a lot it works