-
-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][ADD] product_category_usage_group #1590
base: 16.0
Are you sure you want to change the base?
[16.0][ADD] product_category_usage_group #1590
Conversation
# Overload Section | ||
@api.model_create_multi | ||
def create(self, vals_list): | ||
templates = super(ProductTemplate, self).create(vals_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
templates = super(ProductTemplate, self).create(vals_list) | |
templates = super().create(vals_list) |
return res | ||
|
||
# Custom Section | ||
def _check_usage_product_category(self, categ_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quentinDupont Why not using a constraint instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great point 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change the code and it makes it simpler
This module extends the functionality of the product module, to restrict usage
of product categories to users that belong to a given group.
Migration from 12.0 of our custom module that we try to share with the OCA now :)
Use case for us : restrict a category where account code is not set by default