Browse Source

Jul 24 : [UPDT] Bug Fixed 'pos_discount_manager'

pull/267/head
AjmalCybro 2 years ago
parent
commit
935a345cda
  1. 2
      pos_discount_manager/README.rst
  2. 2
      pos_discount_manager/__manifest__.py
  3. 8
      pos_discount_manager/doc/RELEASE_NOTES.md
  4. 2
      pos_discount_manager/static/description/index.html
  5. 49
      pos_discount_manager/static/src/js/ValidateManager.js

2
pos_discount_manager/README.rst

@ -3,7 +3,7 @@
:alt: License: AGPL-3 :alt: License: AGPL-3
POS Discount Manager Approval POS Discount Manager Approval
============================= =====================
This module helps to provide Discount limit for each employee in every pos This module helps to provide Discount limit for each employee in every pos
Configuration Configuration

2
pos_discount_manager/__manifest__.py

@ -26,7 +26,7 @@
'description': """"This module helps you to set a discount limit for each 'description': """"This module helps you to set a discount limit for each
employee in every point of sale.It facilitate the manager employee in every point of sale.It facilitate the manager
approval when discount over the limit of employee""", approval when discount over the limit of employee""",
'category': 'Point of Sale', 'category': 'Point Of Sale',
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'maintainer': "Cybrosys Techno Solutions", 'maintainer': "Cybrosys Techno Solutions",

8
pos_discount_manager/doc/RELEASE_NOTES.md

@ -3,4 +3,10 @@
#### 12.05.2023 #### 12.05.2023
#### Version 16.0.1.0.0 #### Version 16.0.1.0.0
#### ADD #### ADD
Initial Commit for POS Discount Manager Approval - Initial Commit POS Discount Manager Approval
#### 21.07.2023
#### Version 16.0.2.0.1
#### FIX
- Removed the already existing function from payment screen js function.
- Super the existing button action.

2
pos_discount_manager/static/description/index.html

@ -628,7 +628,7 @@
</div> </div>
</section> </section>
<!-- END OF END OF OUR INDUSTRIES --> <!-- END OF OUR INDUSTRIES -->
<!-- FOOTER --> <!-- FOOTER -->
<!-- Footer Section --> <!-- Footer Section -->

49
pos_discount_manager/static/src/js/ValidateManager.js

@ -10,40 +10,6 @@ odoo.define('pos_discount_manager.ValidateManager', function(require) {
*Override the validate button to approve discount limit *Override the validate button to approve discount limit
*/ */
async _finalizeValidation() { async _finalizeValidation() {
if ((this.currentOrder.is_paid_with_cash() || this.currentOrder.get_change()) && this.env.pos.config.iface_cashdrawer) {
this.env.pos.proxy.printer.open_cashbox();
}
this.currentOrder.initialize_validation_date();
let syncedOrderBackendIds = [];
try {
if (this.currentOrder.is_to_invoice()) {
syncedOrderBackendIds = await this.env.pos.push_and_invoice_order(
this.currentOrder
);
} else {
syncedOrderBackendIds = await this.env.pos.push_single_order(this.currentOrder);
}
} catch (error) {
if (error instanceof Error) {
throw error;
} else {
await this._handlePushOrderError(error);
}
}
if (syncedOrderBackendIds.length && this.currentOrder.wait_for_push_order()) {
const result = await this._postPushOrderResolve(
this.currentOrder,
syncedOrderBackendIds
);
if (!result) {
await this.showPopup('ErrorPopup', {
title: 'Error: no internet connection.',
body: error,
});
}
}
var order = this.env.pos.get_order(); var order = this.env.pos.get_order();
var orderlines = this.currentOrder.get_orderlines() var orderlines = this.currentOrder.get_orderlines()
var employee_dis = this.env.pos.get_cashier()['limited_discount']; var employee_dis = this.env.pos.get_cashier()['limited_discount'];
@ -78,23 +44,10 @@ odoo.define('pos_discount_manager.ValidateManager', function(require) {
} }
this.currentOrder.finalized = true; this.currentOrder.finalized = true;
this.showScreen(this.nextScreen); this.showScreen(this.nextScreen);
super._finalizeValidation();
// If we succeeded in syncing the current order, and // If we succeeded in syncing the current order, and
// there are still other orders that are left unsynced, // there are still other orders that are left unsynced,
// we ask the user if he is willing to wait and sync them. // we ask the user if he is willing to wait and sync them.
if (syncedOrderBackendIds.length && this.env.pos.db.get_orders().length) {
const {
confirmed
} = await this.showPopup('ConfirmPopup', {
title: this.env._t('Remaining unsynced orders'),
body: this.env._t(
'There are unsynced orders. Do you want to sync these orders?'
),
});
if (confirmed) {
// Not yet sure if this should be awaited or not.
this.env.pos.push_orders();
}
}
} }
} }
Registries.Component.extend(PaymentScreen, ValidateManagers); Registries.Component.extend(PaymentScreen, ValidateManagers);

Loading…
Cancel
Save