1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/pos_sale_loyalty/static/src/overrides/models/models.js
2024-12-10 09:04:09 +07:00

25 lines
665 B
JavaScript

/** @odoo-module **/
import { Orderline } from "@point_of_sale/app/store/models";
import { patch } from "@web/core/utils/patch";
patch(Orderline.prototype, {
//@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);
}
},
});