Skip to content

Conversation

ilyasProgrammer
Copy link
Member

@ilyasProgrammer ilyasProgrammer commented Oct 4, 2023

related to #997
wip

New tests was copied from @felixhummel fork. @felixhummel do you mind? I will add you as a contributor.

@OCA-git-bot
Copy link
Contributor

Hi @ivantodorovich,
some modules you are maintaining are being modified, check this out!

@ilyasProgrammer ilyasProgrammer changed the title [14.0] mrp bom attribute match fix boms struct report nested [14.0][FIX] mrp_bom_attribute_match Oct 4, 2023
@ilyasProgrammer
Copy link
Member Author

@felixhummel Feel free to test ;)

@francesco-ooops
Copy link
Contributor

@felixhummel Feel free to test ;)

@lk-eska too :)

@ilyasProgrammer ilyasProgrammer force-pushed the 14.0-mrp_bom_attribute_match-fix-boms-struct-report-nested branch from b2c30a2 to b4130ee Compare October 10, 2023 12:25
@giarve
Copy link
Contributor

giarve commented Oct 10, 2023

For some reason I still do not see lines in the report (they are skipped) when I set a product component (product template), but that might be from my side. If someone else is willing to review if changes are working for them, I would appreciate.

@francesco-ooops
Copy link
Contributor

@giarve did you test on runboat? can you post a video or a screenshot?

@giarve
Copy link
Contributor

giarve commented Oct 10, 2023

@giarve did you test on runboat? can you post a video or a screenshot?

On the still running instance:

image

I believe it is because when adding variants the line where it appears is not removed (which is supposed to happen), but it still looks for a product_id and it is not found.

Also might have to do with dynamically created attributes? Although in this case they were instantly created. But I do not know if they are properly handled when product components are there but their dynamically created variants are not.

Something extra: in the structure & cost report, children with product components cannot be unfolded.

Summary: I am not sure this PR is the solution or it is just part of it.

@ilyasProgrammer I think the def _get_bom_lines(self, bom, bom_quantity, product, line_id, level): function is duplicated in the same file.

@lk-eska
Copy link

lk-eska commented Oct 16, 2023

I sent the fix here #997

@giarve
Copy link
Contributor

giarve commented Oct 16, 2023

I sent the fix here #997

I am not sure whether it works for all use cases. It was the first fix that was proposed in this PR if I recall correctly.

product = bom.get_component_template_product(
line, product, line.product_id
)
product = bom.get_component_template_product(line, product, line.product_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the function name, shouldn't it start with the underscore?

Maybe there is something I am missing here

@ilyasProgrammer
Copy link
Member Author

@giarve Please try again

@lk-eska
Copy link

lk-eska commented Oct 23, 2023

I sent the fix here #997

I am not sure whether it works for all use cases. It was the first fix that was proposed in this PR if I recall correctly.

no it was something else... anyway this is coming to an end. if it works we would be happy to use it.

Copy link
Contributor

@giarve giarve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works beautifully from my side. I think we could already merge this and if in the future something else pops up we would rather create another PR (hopefully not needed!).

@ilyasProgrammer ilyasProgrammer force-pushed the 14.0-mrp_bom_attribute_match-fix-boms-struct-report-nested branch 4 times, most recently from d6bf0e0 to 9749e45 Compare October 23, 2023 14:20
@ilyasProgrammer ilyasProgrammer force-pushed the 14.0-mrp_bom_attribute_match-fix-boms-struct-report-nested branch from b7f9671 to e203c7a Compare October 23, 2023 14:52
@francesco-ooops
Copy link
Contributor

@ivantodorovich good for merge?

Copy link
Contributor

@ivantodorovich ivantodorovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG !
Thanks @ilyasProgrammer :)

@@ -43,3 +46,67 @@ def _get_bom_lines(self, bom, bom_quantity, product, line_id, level):
if isinstance(value, models.NewId):
component[key] = value.origin
return components, total

def _get_price(self, bom, factor, product):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to add a few inline comments to indicate the patched lines?
As this is another complete override, it's always useful to know exactly what changed, specially for migrations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

@ilyasProgrammer ilyasProgrammer force-pushed the 14.0-mrp_bom_attribute_match-fix-boms-struct-report-nested branch from e203c7a to 8efface Compare October 24, 2023 11:15
@ilyasProgrammer
Copy link
Member Author

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 14.0-ocabot-merge-pr-1100-by-ilyasProgrammer-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Oct 24, 2023
Signed-off-by ilyasProgrammer
@OCA-git-bot
Copy link
Contributor

@ilyasProgrammer your merge command was aborted due to failed check(s), which you can inspect on this commit of 14.0-ocabot-merge-pr-1100-by-ilyasProgrammer-bump-patch.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@francesco-ooops
Copy link
Contributor

@ilyasProgrammer can you try again?

@ilyasProgrammer
Copy link
Member Author

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 14.0-ocabot-merge-pr-1100-by-ilyasProgrammer-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 0e7305a into OCA:14.0 Oct 24, 2023
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at dac3d8f. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants