Skip to content
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][FIX] fieldservice_sale: Fix sale order line create method #1160

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

apatyk
Copy link
Contributor

@apatyk apatyk commented Feb 21, 2024

This PR fixes a bug with the sales order line create method in the fieldservice_sale module to account for cases when the method is triggered without any sales order lines that are created, e.g. on some expense reports. This correction is in line with other create() methods and all sales order lines that are created should be returned, not just the last.

Currently, the method throws an undefined variable error for line if there are no sales order lines created and only returns the last sales order line if there are any created.

@OCA-git-bot
Copy link
Contributor

Hi @brian10048, @max3903, @wolfhall,
some modules you are maintaining are being modified, check this out!

Copy link
Member

@houzefa-abba houzefa-abba left a comment

Choose a reason for hiding this comment

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

Good change, makes perfect sense :D
I'm using other FSM modules but not this specific one so it didn't break anything in my case

I'm surprised such a glaring bug went through, I guess this line creation code is not covered by unit tests? Would be nice to add one around it

Also I think you're not supposed to change the module version in your PR; this is done automatically by a bot when maintainers merge your PR

@apatyk
Copy link
Contributor Author

apatyk commented Mar 6, 2024

Good change, makes perfect sense :D I'm using other FSM modules but not this specific one so it didn't break anything in my case

I'm surprised such a glaring bug went through, I guess this line creation code is not covered by unit tests? Would be nice to add one around it

Also I think you're not supposed to change the module version in your PR; this is done automatically by a bot when maintainers merge your PR

@houzefa-abba Awesome, thanks! Just pushed a fix to remove the module version bump.

@max3903 max3903 added this to the 16.0 milestone Apr 16, 2024
@max3903 max3903 added the bug label Apr 16, 2024
@max3903
Copy link
Member

max3903 commented Apr 16, 2024

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit cf363c7 into OCA:16.0 Apr 16, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@apatyk apatyk deleted the 16.0-fix-fieldservice-sale branch April 24, 2024 02:41
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.

4 participants