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

[IMP] product_state (copy=False) #1074

Merged
merged 1 commit into from
May 31, 2022

Conversation

patrickrwilson
Copy link
Contributor

The product state shouldn't be copied when copying the product so this adds copy=False to the state field.

@OCA-git-bot
Copy link
Contributor

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

@patrickrwilson
Copy link
Contributor Author

@dreispt can you please review.

Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

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

Comment (non blocking) : state is a caracteristic of the product so it is attended by the user to preserve the information when duplicate. Why do you think that empty value is better than the value of the duplicated item ?

Note : i personnaly dont use this module.

@patrickrwilson
Copy link
Contributor Author

@legalsylvain I'm not sure I understand what you mean about 'empty value' as it wouldn't be an empty value but instead the newly copied product would default to the stage that has the is_default set.

Copy link
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

@patrickrwilson Could you add a little test for this change ?

@legalsylvain
Copy link
Contributor

patrickrwilson

Ah, sorry. I didn't know the interaction between default and copy.

regards.

@patrickrwilson
Copy link
Contributor Author

FYI: I'll be fixing the new test

The product state shouldn't be copied when copying the product so this adds copy=False to the state field.

[IMP] product_state: Add test for copy

[FIX] Test
@dreispt
Copy link
Member

dreispt commented May 31, 2022

@legalsylvain "state" is computed based on "Stage" - is groups the dynamic and configurable Stages list into specific state codes.
When duplicating a record the Stage should move the the initial default stage. The state should also follow that.

@dreispt
Copy link
Member

dreispt commented May 31, 2022

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 14.0-ocabot-merge-pr-1074-by-dreispt-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot merged commit b8be69e into OCA:14.0 May 31, 2022
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 4c210a4. 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.

5 participants