[16.0][IMP] sale_elaboration: set products profile from its categories#3809
[16.0][IMP] sale_elaboration: set products profile from its categories#3809OCA-git-bot merged 1 commit intoOCA:16.0from
Conversation
|
Hi @yajo, @rafaelbn, @sergio-teruel, @CarlosRoca13, |
chienandalu
left a comment
There was a problem hiding this comment.
Thanks @Andrii9090 ! Some comments below:
- The title of the PR should be: [16.0][IMP] sale_elaboration: add new functionality to propagate the elaboration profile from the category to the product
- You can use a more concise title anyway: [16.0][IMP] sale_elaboration: set products profile from its categories
- Check tests fails.
| <xpath expr="//tree" position="attributes"> | ||
| <attribute name="multi_edit">1</attribute> | ||
| </xpath> |
There was a problem hiding this comment.
Add a comment on why you're doing this
There was a problem hiding this comment.
I have added comment
1050eed to
774a020
Compare
chienandalu
left a comment
There was a problem hiding this comment.
Some more small changes ;)
| comodel_name="product.elaboration.profile", string="Elaboration Profile" | ||
| ) | ||
|
|
||
| def write(self, vals): |
There was a problem hiding this comment.
You should deal with the create as well
| #. Go to *Inventory > Configuration > Product Categories* and select one or you | ||
| can add a column of Elaboration Profiles in the Product Categories list view. | ||
| #. Set the elaboration profile you want to use for all products in this category. | ||
| It is used in the case if the category hasn't child category. When you | ||
| create/update a product, the elaboration profile is set from the product's | ||
| category if the elaboration profile isn't yet setted. |
There was a problem hiding this comment.
Keep some idention so it's easier to read it in code:
| #. Go to *Inventory > Configuration > Product Categories* and select one or you | |
| can add a column of Elaboration Profiles in the Product Categories list view. | |
| #. Set the elaboration profile you want to use for all products in this category. | |
| It is used in the case if the category hasn't child category. When you | |
| create/update a product, the elaboration profile is set from the product's | |
| category if the elaboration profile isn't yet setted. | |
| #. Go to *Inventory > Configuration > Product Categories* and select one or you | |
| can add a column of Elaboration Profiles in the Product Categories list view. | |
| #. Set the elaboration profile you want to use for all products in this category. | |
| It is used in the case if the category hasn't child category. When you | |
| create/update a product, the elaboration profile is set from the product's | |
| category if the elaboration profile isn't yet setted. |
| #. Go to *Inventory > Configuration > Product Categories* and select one or you | ||
| can add a column of Elaboration Profiles in the Product Categories list view. |
There was a problem hiding this comment.
Add that in an extra comment after this block like: You can also use multi-edit in the list view to set the profile in multiple categories at once. Just unhide it from the dots in the right.
| #. Go to *Inventory > Configuration > Product Categories* and select one or you | |
| can add a column of Elaboration Profiles in the Product Categories list view. | |
| #. Go to *Inventory > Configuration > Product Categories* and select one. |
| It is used in the case if the category hasn't child category. When you | ||
| create/update a product, the elaboration profile is set from the product's | ||
| category if the elaboration profile isn't yet setted. |
There was a problem hiding this comment.
Set this aside:
When you create product or update its category , the elaboration profile is set from the product's
category. Anyway, it's possible to change it afterwards.
| It is used in the case if the category hasn't child category. When you | |
| create/update a product, the elaboration profile is set from the product's | |
| category if the elaboration profile isn't yet setted. | |
| The profiles is just set in the category products and it won't be propagated to the child category products. |
774a020 to
e9c3de5
Compare
e9c3de5 to
7cf2130
Compare
|
This short video highlights the newest improvements to the module. Thank you @yajo 😄 16.0.IMP.sale_elaboration_.set.products.profile.from.its.categories.3809.mp4 |
|
Hi @sergio-teruel, @CarlosRoca13, @yajo, @rafaelbn, |
chienandalu
left a comment
There was a problem hiding this comment.
I can't see the logic. Maybe you scrambled your commits? 😅
| </field> | ||
| </field> | ||
| </record> | ||
|
|
There was a problem hiding this comment.
issue: Please disable the automatic formatter that you probably have in your IDE for XML files, and that removes these lines. Then, leave them as they were.
These lines are not wrong. Just let prettier (the one in pre-commit) do the formatting. This way we avoid distractions when reviewing these unneeded stylistic changes.
7cf2130 to
8ca723b
Compare
chienandalu
left a comment
There was a problem hiding this comment.
@Andrii9090 I changed the orientation of your changes for the most simple logic that gets to the original goal.
In a summary
- The module behaves as it was until now.
- When we set a elaboration profile in the category and no profile is set in the product, that will be the default. Otherwise, no profile is applied and all the elaborations are available.
- Sadly, it's hard to test this with the
test.Formtools (I'll do some research) as the domain is evaluated in the view and it seems that it doesn't care about it at that level... O left some of your original test case declarations... although the go with no effect, so maybe I remove them for the sake of commit clarity...
@rafaelbn @sergio-teruel all yours if you want to review 🙂
Elaboration profiles can now be set from the category so if no profile is set in the product it defaults to that one. TODO: - `test.Form` doesn't constrain the view domain for profiles... so the only way to test the flow would be either to use a helper domain field or a tour... Some tooling left in the test case anyway. MT-10786 Co-authored-by: David Vidal <david@moduon.team>
8ca723b to
0dc1f08
Compare
rafaelbn
left a comment
There was a problem hiding this comment.
Tested functionaly 👍🏼
2 minutes video with a full explanation
https://www.loom.com/share/d0570c9362ce47e6abd853135aac6807?sid=8ae7d7f6-80f9-4df0-8cc7-85999139cedf
fcvalgar
left a comment
There was a problem hiding this comment.
Functional review,
LGTM, thank you @Andrii9090
|
/ocabot merge minor |
|
What a great day to merge this nice PR. Let's do it! |
|
Please @chienandalu port to 17 and 18 in the same task 😄 ❤️ Thank you! |
|
Congratulations, your PR was merged at 6e0e4af. Thanks a lot for contributing to OCA. ❤️ |
I added new functionality to propagate the elaboration profile from the category to the products. When you set the elaboration profile in the category, all its products will have this profile.
MT-10786 @moduon @yajo @rafaelbn @Shide @chienandalu @u0f please review if you want 😄