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

[18.0][MIG] l10n_ch_adr_report: Migration to 18.0 #740

Open
wants to merge 10 commits into
base: 18.0
Choose a base branch
from

Conversation

xaviedoanhduy
Copy link

@xaviedoanhduy xaviedoanhduy commented Oct 15, 2024

Depends on:

Note

  • Qty done and Reserved qty are merged into a single column in commit: odoo/odoo@7dda6bb

Result

Swiss Dangerous Goods Report.pdf

Comment on lines 119 to 116
qty = 0
for rec in move_lines:
if rec.state == "done":
qty += rec.quantity_done
else:
qty += rec.product_uom_qty
qty = sum(line.quantity for line in move_lines)
Copy link
Member

@TDu TDu Oct 18, 2024

Choose a reason for hiding this comment

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

I am not sure this is correct, because with the change in Odoo core we still have the product_uom_qty field.
I think this

qty = 0
for rec in move_lines:
    if rec.picked:
        qty += rec.quantity
    else:
        qty += rec.product_uom_qty

would be better

Copy link
Author

@xaviedoanhduy xaviedoanhduy Oct 22, 2024

Choose a reason for hiding this comment

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

thanks @TDu, i see that the use of picked field is not quite like its definition in this case. but maybe i was a bit confused about product_uom_qty so i will restore the original code and just edit quantity to replace the outdated quantity_done

@TDu
Copy link
Member

TDu commented Oct 18, 2024

Also adding some small unit tests would be a good improvement for this migration

@xaviedoanhduy xaviedoanhduy force-pushed the 18.0-mig-l10n_ch_adr_report branch 4 times, most recently from 284f106 to c561375 Compare October 22, 2024 05:21
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.

6 participants