diff --git a/addons/point_of_sale/models/pos_category.py b/addons/point_of_sale/models/pos_category.py index c3f40d94478..2f2ea7bb94e 100644 --- a/addons/point_of_sale/models/pos_category.py +++ b/addons/point_of_sale/models/pos_category.py @@ -13,7 +13,7 @@ class PosCategory(models.Model): if not self._check_recursion(): raise ValueError(_('Error ! You cannot create recursive categories.')) - name = fields.Char(required=True, translate=True) + name = fields.Char(string='Category Name', required=True, translate=True) parent_id = fields.Many2one('pos.category', string='Parent Category', index=True) child_id = fields.One2many('pos.category', 'parent_id', string='Children Categories') sequence = fields.Integer(help="Gives the sequence order when displaying a list of product categories.") diff --git a/addons/point_of_sale/models/pos_config.py b/addons/point_of_sale/models/pos_config.py index 3f4041c9cbf..247c4e1d008 100644 --- a/addons/point_of_sale/models/pos_config.py +++ b/addons/point_of_sale/models/pos_config.py @@ -202,6 +202,7 @@ class PosConfig(models.Model): "the closing of his session saying that he needs to contact his manager.") payment_method_ids = fields.Many2many('pos.payment.method', string='Payment Methods', default=lambda self: self._default_payment_methods()) company_has_template = fields.Boolean(string="Company has chart of accounts", compute="_compute_company_has_template") + current_user_id = fields.Many2one('res.users', string='Current Session Responsible', compute='_compute_current_session_user') @api.depends('company_id') def _compute_company_has_template(self): @@ -262,10 +263,12 @@ class PosConfig(models.Model): pos_config.pos_session_duration = ( datetime.now() - session[0].start_at ).days if session[0].start_at else 0 + pos_config.current_user_id = session[0].user_id else: pos_config.pos_session_username = False pos_config.pos_session_state = False pos_config.pos_session_duration = 0 + pos_config.current_user_id = False @api.constrains('cash_control') def _check_session_state(self): diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index d34192ee4ca..49ffd4ecb68 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -186,7 +186,7 @@ class PosOrder(models.Model): ) note = fields.Text(string='Internal Notes') nb_print = fields.Integer(string='Number of Print', readonly=True, copy=False, default=0) - pos_reference = fields.Char(string='PoS Order Reference', readonly=True, copy=False) + pos_reference = fields.Char(string='Receipt Number', readonly=True, copy=False) sale_journal = fields.Many2one('account.journal', related='session_id.config_id.journal_id', string='Sales Journal', store=True, readonly=True) fiscal_position_id = fields.Many2one( comodel_name='account.fiscal.position', string='Fiscal Position', diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index ee107136876..9addf1edde5 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -882,8 +882,8 @@ td { border: 1px solid #cecbcb; padding: 10px 20px; padding-left: 38px; + padding-right: 33px; margin: 6px; - background: url("../img/search.png") no-repeat 15px; background-color: white; border-radius: 20px; font-family: "Lato","Lucida Grande", Helvetica, Verdana, Arial; @@ -894,12 +894,25 @@ td { box-shadow: 0px 0px 0px 2px rgb(153, 153, 255) inset; color: rgb(153, 153, 255); } + .pos .search-clear { position: absolute; + top: 9px; width: 30px; height: 30px; - top: 11px; + display: flex; + align-items: center; + justify-content: center; +} + +.search-clear.left { left: 11px; + color: #808080; +} + +.search-clear.right { + left: 145px; + color: #808080; cursor: pointer; } diff --git a/addons/point_of_sale/static/src/img/search.png b/addons/point_of_sale/static/src/img/search.png deleted file mode 100644 index d1705e9a24a..00000000000 Binary files a/addons/point_of_sale/static/src/img/search.png and /dev/null differ diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 48dbfd28b90..d5d149a02e4 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -811,7 +811,7 @@ var ProductCategoriesWidget = PosBaseWidget.extend({ this.el.querySelector('.searchbox input').addEventListener('keydown',this.search_handler); - this.el.querySelector('.search-clear').addEventListener('click',this.clear_search_handler); + this.el.querySelector('.search-clear.right').addEventListener('click',this.clear_search_handler); if(this.pos.config.iface_vkeyboard && this.chrome.widget.keyboard){ this.chrome.widget.keyboard.connect($(this.el.querySelector('.searchbox input'))); @@ -840,11 +840,11 @@ var ProductCategoriesWidget = PosBaseWidget.extend({ this.pos.get_order().add_product(products[0]); this.clear_search(); }else{ - this.product_list_widget.set_product_list(products); + this.product_list_widget.set_product_list(products, query); } }else{ products = this.pos.db.get_product_by_category(this.category.id); - this.product_list_widget.set_product_list(products); + this.product_list_widget.set_product_list(products, query); } }, @@ -867,6 +867,7 @@ var ProductListWidget = PosBaseWidget.extend({ this.weight = options.weight || 0; this.show_scale = options.show_scale || false; this.next_screen = options.next_screen || false; + this.search_word = false; this.click_product_handler = function(){ var product = self.pos.db.get_product_by_id(this.dataset.productId); @@ -894,8 +895,9 @@ var ProductListWidget = PosBaseWidget.extend({ this.renderElement(); }, this); }, - set_product_list: function(product_list){ + set_product_list: function(product_list, search_word){ this.product_list = product_list; + this.search_word = !!search_word ? search_word : false; this.renderElement(); }, get_product_image_url: function(product){ diff --git a/addons/point_of_sale/static/src/js/tours/point_of_sale.js b/addons/point_of_sale/static/src/js/tours/point_of_sale.js index 225809819ed..5fc69341602 100644 --- a/addons/point_of_sale/static/src/js/tours/point_of_sale.js +++ b/addons/point_of_sale/static/src/js/tours/point_of_sale.js @@ -11,12 +11,14 @@ tour.register('point_of_sale_tour', { rainbowMan: false, }, [tour.STEPS.SHOW_APPS_MENU_ITEM, { trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"]', - content: _t("Ready to launch your point of sale? Click here."), + content: _t("Ready to launch your point of sale?"), + width: 215, position: 'right', edition: 'community' }, { trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"]', - content: _t("Ready to launch your point of sale? Click here."), + content: _t("Ready to launch your point of sale?"), + width: 215, position: 'bottom', edition: 'enterprise' }, { diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 5f381063134..3d4c2462b94 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -229,7 +229,12 @@
No results found for "".
+There are no products in this category.
+