<commit_before># -*- encoding: utf-8 -*-
from openerp import fields, models, _

import openerp.addons.decimal_precision as dp


class product_bundle(models.Model):
    _name = 'product.bundle'
    _description = 'Product bundle'

    name = fields.Char(_('Name'), help=_('Product bundle name'), required=True)
    bundle_line_ids = fields.Many2many(
        'product.bundle.line', 'product_bundle_product_bundle_line',
        'product_bundle_id', 'product_bundle_line_id', string=_('Bundle lines'))


class product_bundle_line(models.Model):
    _name = 'product.bundle.line'
    _description = 'Product bundle line'

    product_id = fields.Many2one('product.template', string=_('Product'), required=True)
    quantity = fields.Float(
        string=_('Quantity'), digits=dp.get_precision('Product Unit of Measure'),
        required=True, default=1)

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:<commit_msg>Use of product.template instead of product.product in bundle line<commit_after># -*- encoding: utf-8 -*-
from openerp import fields, models, _

import openerp.addons.decimal_precision as dp


class product_bundle(models.Model):
    _name = 'product.bundle'
    _description = 'Product bundle'

    name = fields.Char(_('Name'), help=_('Product bundle name'), required=True)
    bundle_line_ids = fields.Many2many(
        'product.bundle.line', 'product_bundle_product_bundle_line',
        'product_bundle_id', 'product_bundle_line_id', string=_('Bundle lines'))


class product_bundle_line(models.Model):
    _name = 'product.bundle.line'
    _description = 'Product bundle line'

    product_id = fields.Many2one(
        'product.product', domain=[('sale_ok', '=', True)], string=_('Product'), required=True)
    quantity = fields.Float(
        string=_('Quantity'), digits=dp.get_precision('Product Unit of Measure'),
        required=True, default=1)

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
{'fraction_non_alphanumeric': 0.13350383631713555, 'fraction_numerical': 0.007161125319693095, 'mean_word_length': 4.769911504424779, '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': '4087000', 'n_tokens_mistral': 606, 'n_tokens_neox': 589, 'n_words': 120}