<commit_before># -*- coding: utf-8 -*-

from odoo import api, fields, models
from odoo.tools.safe_eval import safe_eval

class SaleCouponGenerate(models.TransientModel):
    _name = 'sale.coupon.generate'

    nbr_coupons = fields.Integer(string="Number of Coupons", help="Number of coupons", default=1)
    generation_type = fields.Selection([
        ('nbr_coupon', 'Number of Coupons'),
        ('nbr_customer', 'Number of Selected Customers')
        ], default='nbr_coupon')
    partners_domain = fields.Char(string="Customer", default=[])
    partner_ids = fields.Many2many('res.partner', string="Related Partners", compute='_compute_partner_ids')

    @api.multi
    def generate_coupon(self):
        """Generates the number of coupons entered in wizard field nbr_coupons
        """
        program = self.env['sale.coupon.program'].browse(self.env.context.get('active_id'))
<commit_msg>[FIX] sale_coupon: Set a valid default value<commit_after># -*- coding: utf-8 -*-

from odoo import api, fields, models
from odoo.tools.safe_eval import safe_eval

class SaleCouponGenerate(models.TransientModel):
    _name = 'sale.coupon.generate'

    nbr_coupons = fields.Integer(string="Number of Coupons", help="Number of coupons", default=1)
    generation_type = fields.Selection([
        ('nbr_coupon', 'Number of Coupons'),
        ('nbr_customer', 'Number of Selected Customers')
        ], default='nbr_coupon')
    partners_domain = fields.Char(string="Customer", default='[]')
    partner_ids = fields.Many2many('res.partner', string="Related Partners", compute='_compute_partner_ids')

    @api.multi
    def generate_coupon(self):
        """Generates the number of coupons entered in wizard field nbr_coupons
        """
        program = self.env['sale.coupon.program'].browse(self.env.context.get('active_id'))

{'fraction_non_alphanumeric': 0.13205479452054794, 'fraction_numerical': 0.0032876712328767125, 'mean_word_length': 4.172804532577904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '903123', 'n_tokens_mistral': 572, 'n_tokens_neox': 569, 'n_words': 126}