POS: Replace internal note button with pricelist button

- Remove internal note button from control buttons
- Add pricelist button directly visible in main view (not only in Actions dialog)
- Shows current pricelist name of the order/partner
- Allows direct access to change pricelist without opening Actions menu
This commit is contained in:
Matthias Lotz 2026-01-09 15:24:26 +01:00
parent b26e70dbe9
commit 988421a0c5
3 changed files with 46 additions and 0 deletions

View File

@ -41,6 +41,7 @@ Autor: HobbyHimmel
'open_workshop_pos/static/src/js/ows_product_screen_default_category.js',
'open_workshop_pos/static/src/js/ows_order_patch.js',
'open_workshop_pos/static/src/js/ows_receipt_header_patch.js',
'open_workshop_pos/static/src/js/ows_control_buttons_patch.js',
# XML Templates
'open_workshop_pos/static/src/xml/ows_pos_sidebar.xml',
@ -50,6 +51,7 @@ Autor: HobbyHimmel
'open_workshop_pos/static/src/xml/ows_product_card_patch.xml',
'open_workshop_pos/static/src/xml/ows_receipt_header_patch.xml',
'open_workshop_pos/static/src/xml/ows_voucher_codes_patch.xml',
'open_workshop_pos/static/src/xml/ows_control_buttons_patch.xml',
# CSS
'open_workshop_pos/static/src/css/pos.css',

View File

@ -0,0 +1,20 @@
/** @odoo-module **/
import { ControlButtons } from "@point_of_sale/app/screens/product_screen/control_buttons/control_buttons";
import { patch } from "@web/core/utils/patch";
patch(ControlButtons.prototype, {
/**
* Override to hide internal note button
*/
get showInternalNote() {
return false;
},
/**
* Override to show pricelist button always (not just in modal)
*/
get showPricelistButton() {
return !this.props.showRemainingButtons && !this.ui.isSmall;
},
});

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="point_of_sale.ControlButtons" t-inherit="point_of_sale.ControlButtons" t-inherit-mode="extension">
<!-- Hide the internal note button completely -->
<xpath expr="//t[@t-if='!props.showRemainingButtons || (ui.isSmall and props.showRemainingButtons)']" position="attributes">
<attribute name="t-if">false</attribute>
</xpath>
<!-- Add pricelist button directly visible (not just in Actions dialog) -->
<xpath expr="//SelectPartnerButton[@partner='partner']" position="after">
<button t-if="!props.showRemainingButtons and !ui.isSmall"
class="o_pricelist_button btn btn-light btn-lg lh-lg"
t-on-click="() => this.clickPricelist()">
<i class="fa fa-th-list me-1" role="img" aria-label="Price list" title="Price list" />
<t t-if="currentOrder?.pricelist_id" t-esc="currentOrder.pricelist_id.display_name" />
<t t-else="">Pricelist</t>
</button>
</xpath>
</t>
</templates>