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

Updating invoice notes 32134 #32189

Closed

Conversation

JonBendtsen
Copy link
Contributor

FIX #32134 Updating Invoice Notes
throw RestException(500) if update of invoice fails

@JonBendtsen JonBendtsen changed the base branch from 20.0 to develop December 1, 2024 09:21
@JonBendtsen
Copy link
Contributor Author

replaced with #32190

@JonBendtsen JonBendtsen closed this Dec 1, 2024
@natalieboucher
Copy link

In the new version 20.0.3 it still does not work.

If you extract an invoice with GET /invoices/{id} and the resulting JSON is returned with a PUT /invoices/{id} the system returns a 500 error.

{
"error": {
"code": 500,
"message": "Internal Server Error: Error Cannot add or update a child row: a foreign key constraint fails (XXXXXX.llxpn_facture, CONSTRAINT fk_facture_fk_facture_source FOREIGN KEY (fk_facture_source) REFERENCES llxpn_facture (rowid))"
},
"debug": {
"source": "api_invoices.class.php:699 at call stage",
"stages": {
"success": [
"get",
"route",
"negotiate",
"authenticate",
"validate"
],
"failure": [
"call",
"message"
]
}
}
}
If we remove “”fk_project": null, from the JSON everything works correctly including the private and public notes.
It would be appreciated if you could fix these corrections.

Thank you

@hregis
Copy link
Contributor

hregis commented Feb 19, 2025

@natalieboucher try with "fk_projet" (real name of field in database) instead "fk_project"
@eldy maybe adding a "synonym" parameter in "$fields" array in order to be able to determine the name of the field used if it is different from the name in the database ? (eg id/rowid, fk_soc/socid, etc...)

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

Successfully merging this pull request may close these issues.

Issue Detected in Dolibarr API 20.0.2: Updating Invoice Notes
3 participants