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

[14.0][OU-ADD] sale_margin: Migration scripts #3096

Merged
merged 1 commit into from
Mar 27, 2022

Conversation

hieu1211
Copy link

This PR

migration done

@hieu1211 hieu1211 changed the title [MIG]sale_margin: migration script [MIG][14.0]sale_margin: migration script Jan 14, 2022
@hieu1211 hieu1211 force-pushed the v14_mig_sale_margin branch 2 times, most recently from 8968885 to 5f1ffba Compare January 14, 2022 09:20
@hieu1211
Copy link
Author

@MiquelRForgeFlow i changed following u but the type column in DB is double_precision, it that correct?

@MiquelRForgeFlow
Copy link
Contributor

@hieu1211
Copy link
Author

@hieu1211 you can find the corresponding type in https://github.com/OCA/openupgradelib/blob/master/openupgradelib/openupgrade.py#L2309.

Selection_150

thanks for responding, i will check it

@royle-vietnam
Copy link
Contributor

@MiquelRForgeFlow maybe you are wrong
Field margin_percent that is not digits, i think double precision is more correct than numeric

margin_percent = fields.Float(
        "Margin (%)", compute='_compute_margin', store=True, groups="base.group_user")

https://github.com/OCA/openupgradelib/blob/a8e94ce510e408c55596827d38a9dc80a926433a/openupgradelib/openupgrade.py#L2315

'float': 'numeric',  # Force manually to double precision if no digits

@MiquelRForgeFlow
Copy link
Contributor

Oh, right, sorry for the noise.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

FYI, the openupgradelib method was develop from reading this line of Odoo code:

https://github.com/odoo/odoo/blob/098f00724917f36c60b4850da5105556239edd1e/odoo/fields.py#L1314

@pedrobaeza pedrobaeza merged commit 1958e8d into OCA:14.0 Mar 27, 2022
@pedrobaeza pedrobaeza changed the title [MIG][14.0]sale_margin: migration script [14.0][OU-DD] sale_margin: Migration scripts Mar 27, 2022
@pedrobaeza pedrobaeza changed the title [14.0][OU-DD] sale_margin: Migration scripts [14.0][OU-ADD] sale_margin: Migration scripts Mar 27, 2022
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.

6 participants