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

[13.0][IMP] sale_by_packaging can be sold #1375

Merged
merged 1 commit into from Jan 20, 2021

Conversation

TDu
Copy link
Member

@TDu TDu commented Dec 15, 2020

This change allows to be more specific on which product.packaging can be
sold or not.
By default the value from the product.packaging.type is used. But it is
editable afterwards, with this change.

@TDu TDu force-pushed the imp-can-be-sold-product-packaging branch from b6dc7dc to cc999ea Compare December 15, 2020 10:34
@TDu TDu force-pushed the imp-can-be-sold-product-packaging branch from cc999ea to edb553f Compare December 16, 2020 14:50
@TDu
Copy link
Member Author

TDu commented Dec 16, 2020

I have added a unit test.

@TDu TDu force-pushed the imp-can-be-sold-product-packaging branch from 90d5e4e to b2263c8 Compare January 7, 2021 15:19
Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

LG but small improvement required on tests.

sale_by_packaging/tests/test_packaging_type_can_be_sold.py Outdated Show resolved Hide resolved
Copy link
Sponsor 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.

Code review

@@ -18,3 +19,8 @@ class ProductPackaging(models.Model):
"When the user will put 3 as quantity, the system can force the "
"quantity to the superior unit (5 for this example).",
)

@api.depends("packaging_type_id")
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Suggested change
@api.depends("packaging_type_id")
@api.depends("packaging_type_id.can_be_sold")

Copy link
Contributor

Choose a reason for hiding this comment

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

@rousseldenis I think this is done on purpose: you don't want this value to change if the type changes its value.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes that is how it was requested.
You get the default "can_be_sold" value when selecting a packaging_type. But afterwards you can change it on the product.packaging.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rousseldenis ping :)

@simahawk
Copy link
Contributor

@TDu pls squash :)

This change allows to be more specific on which product.packaging can be
sold or not.
By default the value from the product.packaging.type is used. But it is
editable afterwards, with this change.
@TDu TDu force-pushed the imp-can-be-sold-product-packaging branch from 21b4036 to 7025c74 Compare January 14, 2021 08:00
@TDu
Copy link
Member Author

TDu commented Jan 14, 2021

@simahawk Squash done

@simahawk
Copy link
Contributor

@rousseldenis piiiing :)

@simahawk
Copy link
Contributor

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 13.0-ocabot-merge-pr-1375-by-simahawk-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 0b0eb64 into OCA:13.0 Jan 20, 2021
@OCA-git-bot
Copy link
Contributor

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

None yet

5 participants