Browse Source

Nov 26: [FIX] Bug Fixed 'pos_theme_sapphire'

pull/358/merge
Risvana Cybro 3 weeks ago
parent
commit
b647151d7e
  1. 1
      pos_theme_sapphire/__manifest__.py
  2. 5
      pos_theme_sapphire/doc/RELEASE_NOTES.md
  3. 14
      pos_theme_sapphire/static/src/css/custom.css
  4. 11
      pos_theme_sapphire/static/src/js/ProductScreen.js
  5. 9
      pos_theme_sapphire/static/src/js/ProductsWidget.js
  6. 6
      pos_theme_sapphire/static/src/xml/screens/ProductScreen/ProductScreen.xml
  7. 134
      pos_theme_sapphire/static/src/xml/screens/ProductScreen/ProductsWidget.xml

1
pos_theme_sapphire/__manifest__.py

@ -35,6 +35,7 @@
'assets': {
'point_of_sale._assets_pos': [
'pos_theme_sapphire/static/src/js/ProductScreen.js',
'pos_theme_sapphire/static/src/js/ProductsWidget.js',
'pos_theme_sapphire/static/src/xml/**/*.xml',
'pos_theme_sapphire/static/src/css/custom.css',
],

5
pos_theme_sapphire/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### ADD
- Initial commit POS Theme Sapphire
#### 26.11.2025
#### Version 18.0.1.0.1
#### BUG FIX
- Fixed issue of not showing the Order Selection button in Product Screen.

14
pos_theme_sapphire/static/src/css/custom.css

@ -526,3 +526,17 @@
color: white;
border-radius: 4px;
}
.sidebar-order-tabs .order-tab {
background: #fff;
border: 1px solid #ddd;
padding: 6px 10px;
border-radius: 6px;
cursor: pointer;
}
.sidebar-order-tabs .order-tab.active {
background: #5564c2;
color: white;
border-color: #3a2e8d;
}

11
pos_theme_sapphire/static/src/js/ProductScreen.js

@ -11,6 +11,7 @@ import { CashMovePopup } from "@point_of_sale/app/navbar/cash_move_popup/cash_mo
import { TicketScreen } from "@point_of_sale/app/screens/ticket_screen/ticket_screen";
import { BackButton } from "@point_of_sale/app/screens/product_screen/action_pad/back_button/back_button";
import { CashierName } from "@point_of_sale/app/navbar/cashier_name/cashier_name";
import { OrderTabs } from "@point_of_sale/app/components/order_tabs/order_tabs";
ProductScreen.components = {
...ProductScreen.components,
@ -18,6 +19,7 @@ ProductScreen.components = {
SaleDetailsButton,
BackButton,
CashierName,
OrderTabs,
}
patch(ProductScreen.prototype, {
@ -70,3 +72,12 @@ patch(ProductScreen.prototype, {
return this.pos.showBackButton() && this.ui.isSmall;
},
});
patch(ProductScreen.prototype,{
getOrderTabs() {
return this.pos.get_open_orders().filter((order) => !order.table_id);
},
});

9
pos_theme_sapphire/static/src/js/ProductsWidget.js

@ -0,0 +1,9 @@
/** @odoo-module **/
import { ProductsWidget } from "@point_of_sale/app/screens/product_screen/product_list/product_list";
import { CashierName } from "@point_of_sale/app/navbar/cashier_name/cashier_name";
ProductsWidget.components = {
...ProductsWidget.components,
CashierName,
}

6
pos_theme_sapphire/static/src/xml/screens/ProductScreen/ProductScreen.xml

@ -36,9 +36,9 @@
</a>
</li>
<li class="menu-item">
</li>
<li class="menu-item">
<ProxyStatus t-if="pos.config.use_proxy"/>
<OrderTabs orders="getOrderTabs()"
class="'sidebar-order-tabs d-flex flex-column gap-2 p-2'"
/>
</li>
<li class="menu-item" style="position: absolute; bottom: 60px;">
<a href="#" class="menu-a" target="_blank">

134
pos_theme_sapphire/static/src/xml/screens/ProductScreen/ProductsWidget.xml

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates id="template" xml:space="preserve">
<!-- Product listing section -->
<t t-name="ProductsWidget" t-inherit="point_of_sale.ProductsWidget"
t-inherit-mode="extension" owl="1">
<xpath expr="//div[hasclass('products-widget')]" position="replace">
<div class="products-widget d-flex flex-column flex-grow-1 overflow-auto"
t-ref="products-widget">
<t t-set="showCategoryImages"
t-value="getShowCategoryImages()"/>
<div class="products-widget-control products-widget-control-header mt-4 d-flex shadow-sm justify-content-between">
<CashierName/>
<div class="d-flex search-products" id="search-products">
<Input tModel="[pos, 'searchProductWord']"
class="'p-2 lg-screen'"
isSmall="ui.isSmall"
placeholder="'Search products...'"
icon="{type: 'fa', value: 'fa-search'}"
debounceMillis="100"/>
<div class="home-category-button lg-screen-cat">
<span class="breadcrumb-button breadcrumb-home"
t-on-click="() => this.pos.setSelectedCategoryId(0)">
<i class="fa fa-home" role="img"
aria-label="Home" title="Home"
style="font-size: 30px;"/>
</span>
</div>
</div>
</div>
<div class="products-widget-control products-widget-control-header mt-4 d-flex shadow-sm justify-content-between">
<Input tModel="[pos, 'searchProductWord']"
class="'p-2 sm-screen'"
isSmall="ui.isSmall"
placeholder="'Search products...'"
icon="{type: 'fa', value: 'fa-search'}"
debounceMillis="100"/>
<div class="home-category-button sm-screen-cat">
<span class="breadcrumb-button breadcrumb-home"
t-on-click="() => this.pos.setSelectedCategoryId(0)">
<i class="fa fa-home" role="img"
aria-label="Home" title="Home"
style="font-size: 30px;"/>
</span>
</div>
</div>
<t t-set="categories" t-value="getCategories()"/>
<div t-if="categories.length > 2"
class="products-widget-control bg-white products-widget-control-category d-flex shadow-sm">
<div class="rightpane-header">
<div class="categories-header">
<div class="category-list simple"
style="border-radius: 5px; padding: 10px;">
<t t-foreach="getCategories()"
t-as="category" t-key="category.id">
<span t-if="category.id != 0"
class="category-simple-button"
t-on-click="() => this.pos.setSelectedCategoryId(category.id)">
<t t-esc="category.name"/>
</span>
</t>
</div>
</div>
</div>
</div>
<div class="product-list-container flex-grow-1 overflow-y-auto">
<div t-if="productsToDisplay.length != 0 and pos.posHasValidProduct()"
t-attf-class="product-list {{this.pos.productListViewMode}} p-1">
<t t-foreach="productsToDisplay" t-as="product"
t-key="product.id">
<ProductCard
class="pos.productViewMode"
name="product.display_name"
productId="product.id"
price="product.getFormattedUnitPrice()"
imageUrl="product.getImageUrl()"
onClick="() =>this.pos.addProductToCurrentOrder(product)"
productInfo="true"
onProductInfoClick="() => this.onProductInfoClick(product)"
/>
</t>
</div>
<div t-else=""
class="product-list-empty no-results-message text-center mt-5">
<t t-if="searchWord">
<p>No products found for <b>"<t t-esc="searchWord"/>
"</b>
in this category.</p>
</t>
<t t-else="">
<t t-if="pos.posHasValidProduct()">
<p>There are no products in this category.</p>
</t>
<t t-else="">
<div t-if="!state.loadingDemo">
<p class="text-large">No products available. Explore
<a role="button"
class="button-no-demo fw-bolder"
t-on-click="loadDemoDataProducts">demo data</a>
or <a
role="button"
class="button-no-demo fw-bolder"
t-on-click="createNewProducts">create your own</a>.</p>
</div>
<div t-else=""
class="block-top-header position-absolute top-0 start-0 bg-black opacity-50 w-100 h-100 z-1000">
<div class="d-flex h-100 w-100 text-white flex-row align-items-center justify-content-center">
<div class="o_spinner d-flex flex-column mb-4">
<img src="/web/static/img/spin.svg"
alt="Loading..."/>
Loading...
</div>
</div>
</div>
</t>
</t>
</div>
<div t-if="searchWord"
class="search-more-button d-flex justify-content-center">
<button class="btn btn-primary btn-lg"
t-on-click="onPressEnterKey">Search more</button>
</div>
<div class="portal search-database-button no-results-message"
t-att-class="{ 'd-none': !shouldShowButton }"/>
</div>
</div>
</xpath>
</t>
</templates>
Loading…
Cancel
Save