This question has been flagged
1 Reply
2885 Views

I'm working in multi company enviroment, also I've add "product_category_multicompany" in order to add a company_id field on products category.

Now, I'm trying to modify the 'website_sale' module to only show products from one company that the user will select. 

The point is:

How I could achieve that? I'm getting into, and I'm asking for some hint that sure would help me to do it. :)

 

Many many thanks, the beginings are always hard.

Avatar
Discard
Author Best Answer

I add to a new column in product.public.category, with the company_id, in order to be able to show this companies categories. For that I add in

website_sale/models/product.py

where is defined class product_public_category I add new column:
    'company_id': fields.many2one('res.company', 'Company'),

And also:

    _defaults = {
        'company_id': lambda self, cr, uid, c:
        self.pool.get('res.company')._company_default_get(cr, uid,
                                            'product.public.category', context=c),
    }

 

Wich is working properly, Now I'm trying to make a menu like the categories one that exist in the main shop. I belive I have to modify views.xml in /views. Is that correct? What else should I do?
 

Many many thanks

Avatar
Discard

Hello, Did you manage to sort out this question? If yes, could you please share h

Hello, Did you manage to sort out this question? If yes, could you please share how you did it? Thank you.