what I am trying to do is I have three product type (free, restricted and other) that can be sold for certain customers only. So, what I have done is I created product_tag objects which contains product type
class product_tag(osv.osv):
_name="product.tag"
_columns = {
'name': fields.char('Name', size=64, required=True),
'code':fields.integer('Code'),
product_tag()
and i created many2one relation with product
'prod_tag':fields.many2one('product.tag', 'Item Tags'),
and many2many relation with res.partner with inheritance
class res_partner(osv.osv):
_name='res.partner'
_inherit ='res.partner'
_columns = {
'cutomer_tag':fields.many2many('product.tag', 'rel_itemallowed_tag','item_category','tag_id','Allowed Item Tags'),
}
res_partner()
this many2many relation helps to update customer's level either to buy one type or multiple product type, so what i want is how can i filter products in sales order by analyzing product tag and customer tag (by filtering product type by customer tag)?
Like if a customer tag is 'free' and 'other' all products those are free and othe type only to be visible in many2one product filed of sale order form