-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
[FIX]stock_picking_report_valued: Fix #305. Avoid error when no sale line is linked to move line. #329
Conversation
7c99c75
to
61881b5
Compare
line.currency_id = ( | ||
line.sale_line.currency_id.id | ||
if line.sale_line | ||
else line.company_id.currency_id.id | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line.currency_id = ( | |
line.sale_line.currency_id.id | |
if line.sale_line | |
else line.company_id.currency_id.id | |
) | |
line.currency_id = ( | |
line.sale_line.currency_id.id | |
or line.company_id.currency_id.id | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this?
61881b5
to
6b22909
Compare
related="sale_line.currency_id", readonly=True, string="Sale Currency" | ||
comodel_name='res.currency', | ||
compute="_compute_sale_currency_id", | ||
readonly=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
computed fields are readonly by default.
63adde2
to
527c261
Compare
…om company if not sale line related
527c261
to
e692596
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
The issue #305 is due to the Subtotal and Total fields being of type Monetary. These fields require the currency_id field to be correctly calculated. Currently, the currency_id field is a related field from the sales line, which may not exist. This PR changes the field from related to computed, and if there is no associated sales line, it takes the currency from the company.