Skip to content

Commit

Permalink
0.7.9: adding source with external as default to proposal_add_contact
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Bendtsen committed Jan 4, 2025
1 parent a3780fe commit 3cb598f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Binary file added dist/dolibarrpy-0.7.9.tar.gz
Binary file not shown.
8 changes: 6 additions & 2 deletions dolibarrpy/Dolibarrpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1695,21 +1695,25 @@ def validate_proposal_by_pid(self, objid, notrigger = 0):
result = self.call_action_api('proposals', objid=objid, action='validate', params=proposalsValidateModel)
return result

def proposal_add_contact(self, objid, contactid, type):
def proposal_add_contact(self, objid, contactid, type, source = None):
"""
@endpoint 'post /proposals/{id}/contact/{contactid}/{type}
Add a contact type of given commercial proposal
@id int Id of commercial proposal to update
@contactid int Id of contact to add
@type str Type of the contact (BILLING, SHIPPING, CUSTOMER)
@source str Source of the contact (internal, external)
@return: array JSON with result
"""
if self.debug:
ic()
ic(objid)
ic(contactid)
ic(type)
action = "contact/" + str(contactid) + "/" + str(type)
if source:
action = "contact/" + str(contactid) + "/" + str(type) + "/" + str(source)
else:
action = "contact/" + str(contactid) + "/" + str(type) + "/external"
result = self.call_action_api('proposals', objid=objid, action=action)
return result

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
setup(
name='dolibarrpy',
packages=['dolibarrpy'],
version="0.7.8",
version="0.7.9",
license='MIT',
description='Python wrapper for Dolibarr API',
long_description='This project is a python wrapper for the API for Dolibarr ERP & CRM found at dolibarr.org. It is not yet complete, but most major GET endpoints has been implemented. In the beginning I will mostly focus on implementing the API endpoints that I use.',
Expand Down

0 comments on commit 3cb598f

Please sign in to comment.