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

[REM] sale_margin_percentage: remove margin_percentage field in favor of native one I#25764 #1644

Merged

Conversation

xmglord
Copy link
Contributor

@xmglord xmglord commented Apr 11, 2024

The field margin_percentage is no longer needed since native module
sale_margin have the field margin_percent that serve the same propose.
Also the field margin_threshold must be updated since it was used as a
percentage but the native field margin_percent is a ration so we must
follow the same pattern.

@xmglord xmglord changed the title [REM] sale_margin_percentage: remove margin_percentage field in favor of native one [REM] sale_margin_percentage: remove margin_percentage field in favor of native one I#25764 Apr 11, 2024
@xmglord xmglord force-pushed the 15.0-remove_percetage_field-xmglord branch 4 times, most recently from c58e8ea to 55cb2f8 Compare April 12, 2024 02:44
@xmglord
Copy link
Contributor Author

xmglord commented Apr 12, 2024

@isaako34 and @rolandojduartem please review.

@xmglord xmglord force-pushed the 15.0-remove_percetage_field-xmglord branch 2 times, most recently from 5734928 to 09fc66a Compare April 15, 2024 15:06
@xmglord xmglord requested a review from rolandojduartem April 15, 2024 15:06
@xmglord xmglord force-pushed the 15.0-remove_percetage_field-xmglord branch from 09fc66a to 043dc7f Compare April 15, 2024 15:23
class SaleOrder(models.Model):
_inherit = "sale.order"

margin_percentage = fields.Float(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need a migration script here, it is a stored field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@rolandojduartem
Copy link
Contributor

There errors in the CI, is that expected?

@xmglord xmglord force-pushed the 15.0-remove_percetage_field-xmglord branch from 043dc7f to 544e25b Compare April 22, 2024 19:08
@xmglord
Copy link
Contributor Author

xmglord commented Apr 22, 2024

@luisg123v please review.

@luisg123v luisg123v self-requested a review April 22, 2024 19:42
from odoo import api, fields, models


class SaleOrderLine(models.Model):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you split by model on a separate commit, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

Commit message: it's -> its

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@xmglord xmglord force-pushed the 15.0-remove_percetage_field-xmglord branch from 544e25b to d52aa02 Compare April 25, 2024 04:46
@xmglord xmglord requested a review from luisg123v April 25, 2024 04:48
@luisg123v luisg123v removed their request for review April 25, 2024 18:39
xmglord added 2 commits May 2, 2024 22:37
To follow our good practices each model should be in its own file with
the same name as the model.
… of native one

The field margin_percentage is no longer needed since native module
sale_margin have the field margin_percent that serve the same propose.
Also the field margin_threshold must be updated since it was used as a
percentage but the native field margin_percent is a ration so we must
follow the same pattern.
@xmglord xmglord force-pushed the 15.0-remove_percetage_field-xmglord branch from d52aa02 to 550a57c Compare May 2, 2024 23:01
@xmglord xmglord requested a review from luisg123v May 2, 2024 23:01
Copy link
Contributor

@luisg123v luisg123v left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@luisg123v luisg123v merged commit 3ed0c76 into Vauxoo:15.0 May 2, 2024
3 checks passed
@luisg123v luisg123v deleted the 15.0-remove_percetage_field-xmglord branch May 2, 2024 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants