<commit_before>/*
    © 2015  <NAME>, Acsone SA/NV (http://www.acsone.eu)
    License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/

odoo.define('pos_account_wallet_coupon_no_negative.PaymentLineWallet', function (require) {
    "use strict";
    
    //var models = require('pos_account_wallet_coupon.PaymentLineWallet');
    var models = require('pos_account_wallet_coupon.PaymentLineWallet');

    // Add information relative to cagnotte on payment line
    var _payment_line_proto = models.Paymentline.prototype;
    models.Paymentline = models.Paymentline.extend({
        initialize: function(){
            var self = this;
            self.no_negative = false;
            return _payment_line_proto.initialize.apply(this, arguments);
        },
        _get_balance_wallet_domain(){
            return '|', ['no_negative', '=', false], ['balance', '>', 0];
        },
        _get_wallet_fields(){
            // TODO: Add no_negative
            var self = this;
            var res = _payment_line_proto._get_wallet_fields.apply(this);
            res.push('no_negative');
            return res
        },
        //sets the account_cagnotte_id on this payment line
        set_wallet: function(wallet){
            var self = this;
            self.no_negative = wallet.no_negative;
            return _payment_line_proto.set_wallet.call(this, wallet);
        },

        // returns the flag has_cagnotte from cagnotte
        check_cagnotte_amount() {
            return this.no_negative;
        },
    });
    return models;
});
    <commit_msg>[14.0][IMP] pos_account_wallet_coupon_no_negative: Use push domain for wallet coupon<commit_after>/*
    © 2015  <NAME>, Acsone SA/NV (http://www.acsone.eu)
    License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/

odoo.define("pos_account_wallet_coupon_no_negative.PaymentLineWallet", function (
    require
) {
    "use strict";

    // Var models = require('pos_account_wallet_coupon.PaymentLineWallet');
    var models = require("pos_account_wallet_coupon.PaymentLineWallet");

    // Add information relative to cagnotte on payment line
    var _payment_line_proto = models.Paymentline.prototype;
    models.Paymentline = models.Paymentline.extend({
        initialize: function () {
            var self = this;
            self.no_negative = false;
            return _payment_line_proto.initialize.apply(this, arguments);
        },
        _add_balance_wallet_domain(domain) {
            domain.push("|");
            domain.push(["no_negative", "=", false]);
            domain.push(["balance", ">", 0]);
        },
        _get_wallet_fields() {
            // TODO: Add no_negative
            var res = _payment_line_proto._get_wallet_fields.apply(this);
            res.push("no_negative");
            return res;
        },
        // Sets the account_cagnotte_id on this payment line
        set_wallet: function (wallet) {
            var self = this;
            self.no_negative = wallet.no_negative;
            return _payment_line_proto.set_wallet.call(this, wallet);
        },

        // Returns the flag has_cagnotte from cagnotte
        check_cagnotte_amount() {
            return this.no_negative;
        },
    });
    return models;
});
{'fraction_non_alphanumeric': 0.11206368646662584, 'fraction_numerical': 0.0052051439069197795, 'mean_word_length': 2.3819875776397517, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3143790', 'n_tokens_mistral': 964, 'n_tokens_neox': 978, 'n_words': 191}