mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 07:52:03 +02:00
Initial commit: Sale packages
This commit is contained in:
commit
14e3d26998
6469 changed files with 2479670 additions and 0 deletions
|
|
@ -0,0 +1,26 @@
|
|||
/** @odoo-module alias=pos_sale_loyalty.models **/
|
||||
|
||||
|
||||
import { Orderline } from 'point_of_sale.models';
|
||||
import Registries from 'point_of_sale.Registries';
|
||||
|
||||
export const PosSaleLoyaltyOrderline = (Orderline) => class PosSaleLoyaltyOrderline extends Orderline {
|
||||
//@override
|
||||
ignoreLoyaltyPoints(args) {
|
||||
if (this.sale_order_origin_id) {
|
||||
return true;
|
||||
}
|
||||
return super.ignoreLoyaltyPoints(args);
|
||||
}
|
||||
//@override
|
||||
setQuantityFromSOL(saleOrderLine) {
|
||||
// we need to consider reward product such as discount in a quotation
|
||||
if (saleOrderLine.reward_id) {
|
||||
this.set_quantity(saleOrderLine.product_uom_qty);
|
||||
} else {
|
||||
super.setQuantityFromSOL(...arguments);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Registries.Model.extend(Orderline, PosSaleLoyaltyOrderline);
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { PaymentScreen } from 'point_of_sale.tour.PaymentScreenTourMethods';
|
||||
import { ProductScreen } from 'pos_sale.tour.ProductScreenTourMethods';
|
||||
import { ReceiptScreen } from 'point_of_sale.tour.ReceiptScreenTourMethods';
|
||||
import { getSteps, startSteps } from 'point_of_sale.tour.utils';
|
||||
import Tour from 'web_tour.tour';
|
||||
|
||||
// First tour should not get any automatic rewards
|
||||
startSteps();
|
||||
|
||||
ProductScreen.do.confirmOpeningPopup();
|
||||
ProductScreen.do.clickQuotationButton();
|
||||
ProductScreen.do.selectFirstOrder();
|
||||
ProductScreen.do.clickDisplayedProduct('Desk Pad');
|
||||
ProductScreen.do.clickPayButton();
|
||||
PaymentScreen.do.clickPaymentMethod('Bank');
|
||||
PaymentScreen.do.clickValidate();
|
||||
ReceiptScreen.check.isShown();
|
||||
|
||||
Tour.register('PosSaleLoyaltyTour1', { test: true, url: '/pos/web' }, getSteps());
|
||||
Loading…
Add table
Add a link
Reference in a new issue