-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
feat: add Total Ordered cost on Project #41308
base: develop
Are you sure you want to change the base?
Conversation
semgrep failed test not related to this PR |
This comment has been minimized.
This comment has been minimized.
…project_ordered_cost
This comment has been minimized.
This comment has been minimized.
…project_ordered_cost
Linters / semgrep (pull_request) failed test not related to this PR |
@s-aga-r Could have a look ? |
This comment has been minimized.
This comment has been minimized.
…project_ordered_cost
just another dummy comment to remove "Inactive" label. Hope you can find time to review this one and the other "fix semgrep" related PR #41309 |
This comment has been minimized.
This comment has been minimized.
…project_ordered_cost
This comment has been minimized.
This comment has been minimized.
…project_ordered_cost
just another dummy comment again to remove "Inactive" label. Hope you can find time to review this one and the other "fix semgrep" related PR #41309 Also, could you guide us to the best process, as this PR already respect the Contributing Guideline, to avoid this kind of "lost in loophole" for code contribution ? |
This comment has been minimized.
This comment has been minimized.
…project_ordered_cost
…project_ordered_cost
…project_ordered_cost
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
…project_ordered_cost
.where((pitem.project == project) & (pitem.docstatus == 1)) | ||
.run(as_list=True) | ||
) | ||
return total_ordered_cost |
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.
return total_ordered_cost and total_ordered_cost[0][0] or 0
@@ -772,3 +778,29 @@ def recalculate_project_total_purchase_cost(project: str | None = None): | |||
"total_purchase_cost", | |||
(total_purchase_cost and total_purchase_cost[0][0] or 0), | |||
) | |||
|
|||
|
|||
def calculate_total_ordered_cost(project: str | None = None): |
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.
method name should be get_total_ordered_cost which should return numeric value and not list
.run(as_list=True) | ||
) | ||
return total_ordered_cost | ||
return None |
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.
return 0.0
In Project, in section Costing and billing there is Total Sales Amount (from Sales Order) and Total Billed amount (From Sales Invoice), but on buying side there is only Total Purchase Cost (from Purchase Invoice). In order to have same feature on sales side that on buying side this PR add Total Ordered Cost (from Purchase Order)
As is it done for Total Purchase Cost, this PR ass a field with Total Ordered Cost, that is auto-calculated on the same setting as Total Purchase Cost