-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
BUG: REST API "/mos/{id}/produceandconsume" not working and have a confuse behavior #28481
Comments
What happens when you send the json to the API, and which of the sub parts of the API are you using? Would you mind posting a picture? |
Hallo JonBendtsen, the result is: I found some logical errors: I think its necessary to refactor the ConsumAndProduce:
@mdeweerd Hi, you make a PR #26805 at 23.11.2023. You know how the API-function work? Best Regards |
Sorry, what you are meaning? |
@Humml87 I made a PR because there was an obvious error. Unit tests seem to be missing for this and I think that is a good way to have a common understanding/demonstration of issues. I refactored the test case code for APIs a bit so that it can be shared and started a TestAPIMosTest.php #28484 . Feel free to propose updates - maybe this code could be integrated in the develop branch as a non integrated test (i.e., not adding the test to AllTests.php) - I do not have the intention to work on the API. |
Some API functions for MRP are necessary
Following change is required
mo.class.php (MoLine-Class):
Refactor |
@mdeweerd its not a new Feature, so i think its right to make a PR for branch 19.0? |
@Humml87 If you are talking about the test case, it has been accepted on the develop branch. I think you can backport it to 19.0 but you'll have to get the CommonClassTest.php, the AbstractRestAPITest.php and RestAPIMosTest.php . I would do a (cd test/phpunit ; git checkout develop THREE-CLASS-FILES) and commit. |
What I meant was that in the API's I use I can use GET, POST, PUT, DELETE, and for some I can do it for all entries of some sort or for a single numbered or single referenced entry. For orders which I use it can be all orders (with a given project id). Or for Thirdparties where I look it up using the email address. But I can also get orders by order ID which I use when they pay. So that is what I meant with sub parts.
|
…-REST-API-MOS_19.0
Bug
Hi,.
either I don't understand the API function or it doesn't work.
I tried now a few hours...
id: 21
request_data:
{ "inventorylabel": "Produce and consume using API", "inventorycode": "PRODUCEAPI-YY-MM-DD", "autoclose": 1, "arraytoconsume": [{ "objectid": "203", "fk_warehouse": "677", "qty": "1" }], "arraytoproduce": [] }
The data origin:
I hope anyone can help me, its very import for my project.
Thank you together!
Best regards
Christian
Environment Version
17...19...
Environment OS
Ubuntu
Environment Web server
No response
Environment PHP
8.2
Environment Database
mariaDB
Environment URL(s)
http://localhost/dolibarr/htdocs/api/index.php/mos/{ID}/produceandconsume
Expected and actual behavior
No response
Steps to reproduce the behavior
No response
Attached files
No response
The text was updated successfully, but these errors were encountered: