Browse Source

Aug 29: [FIX] Bug Fixed 'pos_kitchen_screen_odoo'

pull/331/head
Cybrosys Technologies 8 months ago
parent
commit
c2a5d9f98b
  1. 2
      pos_kitchen_screen_odoo/__manifest__.py
  2. 7
      pos_kitchen_screen_odoo/doc/RELEASE_NOTES.md
  3. 2
      pos_kitchen_screen_odoo/models/pos_session.py
  4. 27
      pos_kitchen_screen_odoo/static/src/js/order_button.js
  5. 2
      pos_kitchen_screen_odoo/static/src/js/order_payment.js

2
pos_kitchen_screen_odoo/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': 'POS Kitchen Screen', 'name': 'POS Kitchen Screen',
'version': '17.0.1.0.1', 'version': '17.0.1.0.2',
'category': 'Point Of Sale', 'category': 'Point Of Sale',
'summary': 'POS Kitchen Screen facilitates sending certain orders ' 'summary': 'POS Kitchen Screen facilitates sending certain orders '
'automatically to the kitchen.The POS Kitchen Screen allows for' 'automatically to the kitchen.The POS Kitchen Screen allows for'

7
pos_kitchen_screen_odoo/doc/RELEASE_NOTES.md

@ -4,3 +4,10 @@
#### Version 17.0.1.0.0 #### Version 17.0.1.0.0
#### ADD #### ADD
- Initial commit for Pos Kitchen Screen - Initial commit for Pos Kitchen Screen
#### 27.08.2024
#### Version 17.0.1.0.2
#### BUG FIX
- Fix the issue where the total amount changes to the amount without tax after
refreshing the page.
- Fix the issue of creating two records in the backend for a single order.

2
pos_kitchen_screen_odoo/models/pos_session.py

@ -57,5 +57,7 @@ class PosSession(models.Model):
def _get_pos_ui_pos_order_line(self, params): def _get_pos_ui_pos_order_line(self, params):
"""Get pos ui pos order line""" """Get pos ui pos order line"""
data = self.env['pos.order.line'].search_read(
**params['search_params'])
return self.env['pos.order.line'].search_read( return self.env['pos.order.line'].search_read(
**params['search_params']) **params['search_params'])

27
pos_kitchen_screen_odoo/static/src/js/order_button.js

@ -15,7 +15,6 @@ setup() {
super.setup(); super.setup();
this.orm = useService("orm"); this.orm = useService("orm");
this.popup = useService("popup"); this.popup = useService("popup");
}, },
get swapButton() { get swapButton() {
return this.props.actionType === "payment" && this.pos.config.module_pos_restaurant; return this.props.actionType === "payment" && this.pos.config.module_pos_restaurant;
@ -30,13 +29,14 @@ setup() {
!this.currentOrder?.hasChangesToPrint() && this.currentOrder?.hasSkippedChanges(), !this.currentOrder?.hasChangesToPrint() && this.currentOrder?.hasSkippedChanges(),
}; };
}, },
async submitOrder() { async submitOrder() {
var line = [] var line = []
var self = this; var self = this;
if (!this.clicked) { if (!this.clicked) {
this.clicked = true; this.clicked = true;
try { try {
var order_name=this.pos.selectedOrder.uid var order_name=this.pos.selectedOrder.name
await this.orm.call("pos.order", "check_order_status", ["", order_name]).then(function(result){ await this.orm.call("pos.order", "check_order_status", ["", order_name]).then(function(result){
if (result==false){ if (result==false){
self.kitchen_order_status=false self.kitchen_order_status=false
@ -48,20 +48,21 @@ setup() {
else{ else{
self.kitchen_order_status=true self.kitchen_order_status=true
} }
}); });
if ( self.kitchen_order_status){ if ( self.kitchen_order_status){
await this.pos.sendOrderInPreparationUpdateLastChange(this.currentOrder); await this.pos.sendOrderInPreparationUpdateLastChange(this.currentOrder);
for (const orders of this.pos.get_order().orderlines) { for (const orders of this.pos.get_order().orderlines) {
line.push([0, 0, { line.push([0, 0, {
'qty': orders.quantity, 'qty': orders.quantity,
'price_unit': orders.price, 'price_unit': orders.price,
'price_subtotal': orders.quantity * orders.price, 'price_subtotal': orders.quantity * orders.price,
'price_subtotal_incl': orders.quantity * orders.price, 'price_subtotal_incl': orders.get_display_price(),
'discount': orders.discount, 'discount': orders.discount,
'product_id': orders.product.id, 'product_id': orders.product.id,
'tax_ids': [ 'tax_ids': [
[6, false, []] [6, 0, orders.get_taxes().map((tax) => tax.id)]
], ],
'id': 29, 'id': 29,
'pack_lot_ids': [], 'pack_lot_ids': [],
'full_product_name': orders.product.display_name, 'full_product_name': orders.product.display_name,
@ -72,7 +73,7 @@ setup() {
}]) }])
} }
var orders = [{ var orders = [{
'pos_reference': this.pos.get_order().uid, 'pos_reference': this.pos.get_order().name,
'session_id':1, 'session_id':1,
'amount_total': 0, 'amount_total': 0,
'amount_paid': 0, 'amount_paid': 0,
@ -89,8 +90,8 @@ setup() {
'floor':this.pos.get_order().pos.currentFloor.name, 'floor':this.pos.get_order().pos.currentFloor.name,
'config_id':this.pos.get_order().pos.config.id 'config_id':this.pos.get_order().pos.config.id
}] }]
await self.orm.call("pos.order", "get_details", ["", self.pos.config.id, orders]) await self.orm.call("pos.order", "get_details", ["", self.pos.config.id, orders])
} }
} finally { } finally {
this.clicked = false; this.clicked = false;
} }

2
pos_kitchen_screen_odoo/static/src/js/order_payment.js

@ -22,7 +22,7 @@ patch(Order.prototype, {
* Override of the pay method to handle payment logic. * Override of the pay method to handle payment logic.
*/ */
async pay() { async pay() {
var order_name = this.pos.selectedOrder.uid; var order_name = this.pos.selectedOrder.name;
var self = this; var self = this;
await this.orm.call("pos.order", "check_order", ["", order_name]).then(function (result) { await this.orm.call("pos.order", "check_order", ["", order_name]).then(function (result) {
if (result.category) { if (result.category) {

Loading…
Cancel
Save