Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<!-- Inherit to add fixed discount in template-->
<t t-extend="Orderline">
<t t-jquery="ul.info-list" t-operation="replace">
<ul class="info-list">
<t t-if="line.get_quantity_str() !== '1' || line.selected ">
module.Order = Backbone.Model.extend({
addProduct: function(product, options){
options = options || {};
var attr = JSON.parse(JSON.stringify(product));
attr.pos = this.pos;
attr.order = this;
var line = new module.Orderline({}, {pos: this.pos, order: this, product: product});
console.log("add products................",product)
if(options.quantity !== undefined){
module.PosWidget = module.PosWidget.extend({
build_widgets: function() {
var self = this;
this._super();
this.discount_card_widget = new module.PaymentScreenDiscountWidget(this, {});
this.discount_card_widget.replace($('.placeholder-PaymentScreenDiscountWidget'));
},
});