Only update syncable fields on open deals#389
Merged
DanJezeph15 merged 14 commits intomainfrom Feb 6, 2026
Merged
Conversation
tejas7777
commented
Jan 28, 2026
app/pipedrive/tasks.py
Outdated
| deal_data = _deal_to_pd_data(deal, db) | ||
| pd_deal_id = deal.pd_deal_id | ||
|
|
||
| if only_sync_deal_fields and company: |
Contributor
Author
There was a problem hiding this comment.
The whole point of doing it here is to avoid the GET requests to PD since we already know the value of the field we are going to set.
Contributor
Author
There was a problem hiding this comment.
Also as explained in the inline comment below, let me know if cleaner way about it!
tejas7777
commented
Jan 28, 2026
| # Get from company | ||
| value = company.tc2_cligency_url if company else None | ||
| elif field_name == 'paid_invoice_count': | ||
| value = company.paid_invoice_count if company else None |
Contributor
Author
There was a problem hiding this comment.
Existing deals will have value set to 0, so we from here onwards, need to pick this specific field from the company instead.
DanJezeph15
requested changes
Jan 30, 2026
DanJezeph15
requested changes
Feb 4, 2026
Contributor
DanJezeph15
left a comment
There was a problem hiding this comment.
Last comments from me.
Else lgtm!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Close: #387
We now allow
paid_invoice_countto be synced on existing open deals.Added a partial sync function to only sync the specified syncable deal field (For this PR only
paid_invoice_countand later saved card date in next PR). For the partial sync, we avoid re GETing the deal as we already know what we want to set and directly send PATCH instead.