Browse Source

Dec 26: [FIX] Bug Fixed 'click_and_collect_pos'

pull/309/head
Cybrosys Technologies 4 months ago
parent
commit
4857c4c7d1
  1. 2
      click_and_collect_pos/__manifest__.py
  2. 5
      click_and_collect_pos/doc/RELEASE_NOTES.md
  3. 2
      click_and_collect_pos/static/description/index.html
  4. 52
      click_and_collect_pos/static/src/js/navbar.js
  5. 4
      click_and_collect_pos/static/src/xml/navbar.xml

2
click_and_collect_pos/__manifest__.py

@ -20,7 +20,7 @@
#############################################################################
{
'name': 'Click And Collect PoS',
'version': '17.0.1.0.0',
'version': '17.0.1.0.1',
'category': 'Point of Sale',
'summary': """With this module, customers may place product orders online
and pick them up from the closest shop.""",

5
click_and_collect_pos/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 17.0.1.0.0
#### ADD
- Initial commit for Click and Collect POS
#### 01.02.2024
#### Version 17.0.1.0.1
#### FIX
- Fixed the issue in pos session closing and optimised the Navbar component

2
click_and_collect_pos/static/description/index.html

@ -319,7 +319,7 @@
style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="d-flex mb-3"
style="font-size: 0.8rem; font-weight: 500;"><span>Version
17.0.1.0.0</span><span
17.0.1.0.1</span><span
class="px-2">|</span><span
style="color: #714B67;font-weight: 600;">Released on:01st February 2024</span>
</div>

52
click_and_collect_pos/static/src/js/navbar.js

@ -1,37 +1,37 @@
/** @odoo-module **/
import { Navbar } from "@point_of_sale/app/navbar/navbar";
import { jsonrpc } from "@web/core/network/rpc_service";
import { patch } from "@web/core/utils/patch";
import {Navbar} from "@point_of_sale/app/navbar/navbar";
import {jsonrpc} from "@web/core/network/rpc_service";
import {patch} from "@web/core/utils/patch";
import {SetSaleOrderButton} from "@pos_sale/app/set_sale_order_button/set_sale_order_button"
Navbar.components = {...Navbar.components, SetSaleOrderButton}
patch(Navbar.prototype, {
setup() {
super.setup();
},
async onClick() {
var self = this;
var sale_order = [];
var stock_picking = self.pos.stock_picking;
var session_id = self.pos.pos_session.config_id
var sale_order_line = await jsonrpc("/web/dataset/call_kw", {
const sale_orderSetSaleOrderButton = [];
const stock_picking = this.pos.stock_picking;
const session_id = this.pos.pos_session.config_id
const sale_order_line = await jsonrpc("/web/dataset/call_kw", {
model: "sale.order.line",
method: "search_read",
args: [],
kwargs: {},
kwargs: {
domain: [['state', '=', 'sale'], ['pos_config_id', '=', session_id[0]]],
},
});
const line_ids = []
stock_picking.forEach(function (lines) {
lines.move_ids_without_package.forEach(function (line) {
if (line.sale_line_id[0] && line.state !== "done") {
line_ids.push(line.sale_line_id[0]);
}
});
});
sale_order_line.forEach(function (object) {
if (object.state == "sale" && session_id[0] == object.pos_config_id[0]) {
stock_picking.forEach(function (lines) {
let plan_arr = null;
plan_arr = lines.move_ids_without_package.flat(1);
plan_arr.forEach(function (line) {
if (object.id == line.sale_line_id[0] && line.state != "done" ) {
sale_order.push(object);
}
});
});
}
});
self.pos.showScreen("SaleOrderScreen", {
const sale_order = sale_order_line.filter((line) => line_ids.includes(line.id));
this.pos.showScreen("SaleOrderScreen", {
click_and_collect: sale_order,
});
},

4
click_and_collect_pos/static/src/xml/navbar.xml

@ -2,7 +2,7 @@
<!-- Added new button in pos session -->
<templates id="template" xml:space="preserve">
<t t-name="Navbar" t-inherit="point_of_sale.Navbar"
t-inherit-mode="extension" owl="1">
t-inherit-mode="extension">
<xpath expr="//div[hasclass('status-buttons')]//CashierName" position="before">
<div class="sale-order-button" t-on-click="onClick" style="margin-right:490px; ">
<i class="fa fa-hand-pointer-o" aria-hidden="true"/>
@ -10,7 +10,7 @@
</div>
</xpath>
<xpath expr="//li[@t-if='showCashMoveButton']" position="after">
<SaleOrderButton/>
<SetSaleOrderButton/>
</xpath>
</t>
</templates>

Loading…
Cancel
Save