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] account_move_line_purchase_info: do not consider stock entry lines on revaluations #2018

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

AlexPForgeFlow
Copy link
Contributor

@AlexPForgeFlow AlexPForgeFlow commented Jan 27, 2025

Issue: #2017

Up to now, stock entries were considered in the revaluation process as they were stored on field invoice_lines. To avoid that we introduced a dedicated field to manage stock entries and avoid taking them into account in the revaluation odoo core process.

@AlexPForgeFlow AlexPForgeFlow force-pushed the 16.0-imp-account_move_line_purchase_info branch 9 times, most recently from 2d9cdfe to c98562c Compare January 28, 2025 13:47
Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow 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 LG. I am not sure if we can have a Many2one field with a suffix that is not "_id". It's true purchase_line_id_oca_id sounds weird :S

@JordiMForgeFlow
Copy link
Contributor

@AaronHForgeFlow I agree, maybe it could be oca_purchase_line_id?

@AaronHForgeFlow
Copy link
Contributor

@AaronHForgeFlow I agree, maybe it could be oca_purchase_line_id?

Yes, I prefer this one.

…try lines on revaluations

Up to now, stock entries were considered in the revaluation process as they were stored on field invoice_lines. To avoid that we introduced a dedicated field to manage stock entries and avoid taking them into account in the revaluation odoo core process.
@AlexPForgeFlow AlexPForgeFlow force-pushed the 16.0-imp-account_move_line_purchase_info branch from c98562c to 6e431b4 Compare February 4, 2025 09:04
@AlexPForgeFlow
Copy link
Contributor Author

@AaronHForgeFlow @JordiMForgeFlow Thanks for your suggestions, I applied changes.

Copy link
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

Functional review, including the revaluation case, it works good.

Copy link
Contributor

@JordiMForgeFlow JordiMForgeFlow left a comment

Choose a reason for hiding this comment

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

I would like to get more people involved in this review, but LGTM

CC @OCA/accounting-maintainers

@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). 🤖

@AaronHForgeFlow
Copy link
Contributor

@astirpe @RodrigoBM I see you reviewed the migration to v16. I'd appreciate your opinion in here. Thanks.

@rafwenger
Copy link

Hi,
Thanks for the fix. Much appreciated.
Do you have an ETA when this PR will be merged?

@rafwenger
Copy link

I checked out this PR to try it and got many errors when post-migration.py runs.
One error was cause by a translation issue (my db is on en_us).

ERROR: operator does not exist: character varying ->> unknown
LINE 1: ...racking", "product_template"."description_picking"->>'en_US'...
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.

I got around it by using with_context(lang=None) in post-migration.py

But the more errors kept popping up:
KeyError: ('decimal.precision', <function DecimalPrecision.precision_get at 0x7fe12aeeeef0>, 'Percentage Analytic')

The 'Percentage Analytic' decimal precision is from standard Odoo and is present in my db.

After these error I went ahead and renamed the migrations folder so the scripts don't run.
The module upgrade completed successfully but my database (a test one) is probably in a incomplete state.
Yet the module's functionality is working as expected (ie automatic valuation works).

And, yes I do have openupgrade installed properly (in my addons path and in server_wide_modules).

@AaronHForgeFlow
Copy link
Contributor

Do you know the exact line in the post-migration.py that causes those logs? I am not sure it is related to the script itself.

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