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

xero.exceptions.XeroBadRequest: PostDataInvalidException: The string 'False' is not a valid Boolean value. #142

Open
timrichardson opened this issue May 9, 2016 · 4 comments

Comments

@timrichardson
Copy link
Contributor

timrichardson commented May 9, 2016

def recode_account(xero,existing_code,new_code=None,**kwargs):
    accounts = xero.accounts.filter(Code=existing_code)
    account_id = accounts[0]['AccountID']
    for (kwarg,value) in kwargs.items():
        accounts[0][kwarg] = value
    xero.accounts.save(accounts)
    return accounts
accounts = recode_account(xero,existing_code='101000',new_code = '101000',Description='Test')

results in
xero.exceptions.XeroBadRequest: PostDataInvalidException: The string 'False' is not a valid Boolean value.

pyxero 0.8.0 in python 3.5.1

@timrichardson
Copy link
Contributor Author

Possibly these two fields need to be included in BOOLEAN_FIELDS
ShowInExpenseClaims
EnablePaymentsToAccount

@randyshaw
Copy link

randyshaw commented Aug 18, 2016

If I understand, I agree and think that there are several other fields that should be added to the Boolean Field list. If I do a simple "item = xero.items.get(productcode), then "item['Name']='New product name'", then xero.items.save(item), I get this same error message. Since Xero gave me "True" as a boolean, I shouldn't have to alter any other values in posting this back.

item = {u'ItemID': u'b5442fbe-e515-4913-aee4-e496a2e3bx33', u'Code': u'Prod2', u'Description': u'Demo Product Two', u'SalesDetails': {}, u'UpdatedDateUTC': datetime.datetime(2016, 8, 18, 18, 31, 6, 110000), u'IsPurchased': True, u'IsTrackedAsInventory': False, u'IsSold': True, u'PurchaseDetails': {}, u'ValidationErrors': []}

pyxero 0.8.0 in python 2.7.5

Aeory pushed a commit to Aeory/pyxero that referenced this issue Apr 25, 2017
Add IsReconciled, EnablePaymentsToAccount and ShowInExpenseClaims to
BOOLEAN_FIELDS. This fixes issue freakboy3742#142
@sdolemelipone
Copy link
Contributor

There are still some boolean Item fields which are missing from BOOLEAN_FIELDS tuple which cause this issue to occur. IsTrackedAsInventory, IsSold, IsPurchased.

pyxero 0.9 in python 3.6.3

@sdolemelipone
Copy link
Contributor

Pull request #205 created.

jneves pushed a commit to wegotpop/pyxero that referenced this issue Mar 28, 2018
Add IsReconciled, EnablePaymentsToAccount and ShowInExpenseClaims to
BOOLEAN_FIELDS. This fixes issue freakboy3742#142
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

No branches or pull requests

3 participants