-
-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] Migrate module pos_reset_search to v14.
- Loading branch information
1 parent
66fd02e
commit f497aa4
Showing
3 changed files
with
33 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
- Le Nid | ||
- CoopITEasy | ||
* Le Nid | ||
* CoopITEasy | ||
* Dhara Solanki <dhara.solanki@initos.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,32 @@ | ||
odoo.define("product_click_search_reset", function (require) { | ||
"use strict"; | ||
var screens = require("point_of_sale.screens"); | ||
|
||
screens.ProductScreenWidget.include({ | ||
click_product: function (product) { | ||
var self = this; | ||
self._super(product); | ||
self.product_categories_widget.clear_search(); | ||
}, | ||
}); | ||
|
||
const ProductScreen = require("point_of_sale.ProductScreen"); | ||
const Registries = require("point_of_sale.Registries"); | ||
|
||
const PosProductScreen = (ProductScreen) => | ||
class extends ProductScreen { | ||
async _clickProduct(event) { | ||
const ProductScreenChildren = this.__owl__.children; | ||
|
||
const ProductWidget = ProductScreenChildren.find( | ||
(child) => child.el.className === "products-widget" | ||
); | ||
if (ProductWidget) { | ||
const ProductWidgetChildren = ProductWidget.__owl__.children; | ||
|
||
const ProductsWidgetControlPanel = ProductWidgetChildren.find( | ||
(child) => child.el.className === "products-widget-control" | ||
); | ||
if (ProductsWidgetControlPanel) { | ||
ProductsWidgetControlPanel.clearSearch(); | ||
} | ||
} | ||
return super._clickProduct(event); | ||
} | ||
}; | ||
|
||
Registries.Component.extend(ProductScreen, PosProductScreen); | ||
|
||
return ProductScreen; | ||
}); |