You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
1.0 KiB

# -*- coding: utf-8 -*-
from openerp import api, fields, models, _
class ProductTemplate(models.Model):
_inherit = 'product.template'
is_share = fields.Boolean(string='Is share?')
short_name = fields.Char(string='Short name')
display_on_website = fields.Boolean(string='Display on website')
default_share_product = fields.Boolean(string='Default share product')
minimum_quantity = fields.Integer(string='Minimum quantity', default=1)
by_company = fields.Boolean(string="Can be subscribed by companies?")
by_individual = fields.Boolean(string="Can be subscribed by individuals?")
@api.multi
def get_web_share_products(self, is_company):
if is_company == True:
ids = self.env['product.template'].search([('is_share','=',True), ('display_on_website','=',True),('by_company','=',True)])
else:
ids = self.env['product.template'].search([('is_share','=',True), ('display_on_website','=',True),('by_individual','=',True)])
return ids