-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
[12.0][MIG] product_profile #546
Conversation
CC : original authors : @EBII, @bealdav, @sebastienbeau |
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.
nitpicking
product_profile/__manifest__.py
Outdated
"summary": "Allow to configure a product in 1 click", | ||
"category": "product", | ||
"depends": ["sale"], | ||
"website": "http://www.akretion.com/", |
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.
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.
Thanks Nikul !
<field name="inherit_id" ref="product.product_template_form_view"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//h1" position="after"> | ||
<group> |
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.
<group> | |
<group name='profile'> |
c31bb57
to
701c805
Compare
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.
anything else seems Ok
product_profile/__manifest__.py
Outdated
"author": "Akretion, Odoo Community Association (OCA)", | ||
"summary": "Allow to configure a product in 1 click", | ||
"category": "product", | ||
"depends": ["sale"], |
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.
in 12.0 i think you need to depends sale_managment instead sale to get product menu in sale app and not just invoice app..
product_profile/models/product.py
Outdated
|
||
|
||
class ProductProfile(models.Model): | ||
_name = "product.profile" |
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.
Please add _descritpion =" xx" to remove warnings
product_profile/models/product.py
Outdated
|
||
|
||
class ProductMixinProfile(models.AbstractModel): | ||
_name = "product.mixin.profile" |
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.
please add _description to remove warnings
product_profile/models/product.py
Outdated
{"profile_id": self.profile_id.id} | ||
) | ||
for field, value in values.items(): | ||
try: |
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 think is necessary to avoid id that generate error message on change profile on product
try: | |
if field != 'id': | |
try: | |
self[field] = value |
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.
Hi EBII, thank you for your feedback!
I think that field should be excluded already because of exclusion of fields , did you manage to trigger an error message ?
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.
Yes @kevinkhao it generate the error message in the except
get_profile_fields_to_exclude() is only call on write method.. You can call it On the on change instead of just filter the id.
but not sure it is necessary or it's work
try: | |
excludable_fields = get_profile_fields_to_exclude() | |
for field, value in values.items(): | |
if field not in excludable_fields: | |
try: |
701c805
to
21ef11a
Compare
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.
thanks for your work.
21ef11a
to
7f63001
Compare
product_profile/models/product.py
Outdated
) | ||
explanation = fields.Text( | ||
required=True, | ||
oldname="description", |
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.
Please remove oldname
@@ -0,0 +1,2 @@ | |||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" | |||
"access_product_brand_product_manager","product.profile","model_product_profile","base.group_user",1,0,0,0 |
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.
product_brand_product_manager ?
missing a security rule to update/create profiles
product_profile/models/product.py
Outdated
def create(self, vals): | ||
if vals.get("profile_id"): | ||
vals.update(self._get_vals_from_profile(vals)) | ||
return super(ProductMixinProfile, self).create(vals) |
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.
in python 3 you may have super().create() each time super has self
arg
The same things in other parts of the script
b08c1bc
to
fe4b989
Compare
7194494
to
a3782a3
Compare
In order to improve the readability and make easier to track teh change it will be great if you can do the migration in two commit. Thanks for your work |
Noted, will do, thanks |
9d6ae37
to
2e67995
Compare
20f8384
to
60ca1d3
Compare
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.
Except typo ok for me
Review and test UI
9819311
to
9e25860
Compare
Currently translated at 100.0% (31 of 31 strings) Translation: product-attribute-10.0/product-attribute-10.0-product_profile Translate-URL: https://translation.odoo-community.org/projects/product-attribute-10-0/product-attribute-10-0-product_profile/es/
9e25860
to
3156bd7
Compare
@EBII @nikul-serpentcs Could you approve ? |
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.
@rousseldenis Now Code LGTM 👍
This PR has the |
1 similar comment
This PR has the |
/ocabot merge major |
Sorry @bealdav you are not allowed to merge. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
Ok not yet maintainer |
/ocabot merge major |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at cb7f48b. Thanks a lot for contributing to OCA. ❤️ |
No description provided.