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

from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp

class product_template(osv.Model):
    _inherit = ["product.template"]
    _name = 'product.template'

    _columns = {
        'cp_price': fields.property(type = 'float', digits_compute=dp.get_precision('Product Price'), 
                                          help="Price for Collective Purchases. "
                                               "Expressed in the default unit of measure of the product.",
                                          string="Collective Purchase Price"),
        'cp_ok': fields.boolean("The product can be sold in Collective Purchases"),
        'sale_ok': fields.boolean(help="It can be sold individually through the normal shop", string="Allow Single Orders"),
        'purchase_ok': fields.boolean(help="It can sold in batchs through collective purchases", string="Allow Collective Orders"),
    }

    _defaults = {
        'purchase_ok': False,
    } <commit_msg>Adding fied cp_order_id to product.template to restric the orders by products<commit_after># -*- coding: utf-8 -*-

from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp

class product_template(osv.Model):
    _inherit = ["product.template"]
    _name = 'product.template'

    _columns = {
        'cp_price': fields.property(type = 'float', digits_compute=dp.get_precision('Product Price'), 
                                          help="Price for Collective Purchases. "
                                               "Expressed in the default unit of measure of the product.",
                                          string="Collective Purchase Price"),
        'cp_ok': fields.boolean("The product can be sold in Collective Purchases"),
        'sale_ok': fields.boolean(help="It can be sold individually through the normal shop", string="Allow Single Orders"),
        'purchase_ok': fields.boolean(help="It can sold in batchs through collective purchases", string="Allow Collective Orders"),
        #'cp_order_id': fields.one2one('purchase_collective.order', 'Collective Purchase Allowed', help="This fields restricts the Collective Purchase qich can offered this. product. Leave empty to allow in all Collective Purchases opened for the supllier", string="Allowed Collective Purchases"),
    }

    _defaults = {
        'purchase_ok': False,
    } 
{'fraction_non_alphanumeric': 0.094140625, 'fraction_numerical': 0.001171875, 'mean_word_length': 2.7062228654124456, '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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3000113', 'n_tokens_mistral': 668, 'n_tokens_neox': 632, 'n_words': 211}