Skip to content

[16.0][FIX] shopfloor_reception_add_packaging: fix schema for create_new_packaging - #1288

Merged
OCA-git-bot merged 1 commit into
OCA:16.0from
acsone:16.0-fix-shopfloor_reception_add_packaging-invalid-schema
Sep 29, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:16.0from
acsone:16.0-fix-shopfloor_reception_add_packaging-invalid-schema

Conversation

@nicolas-delbovier-acsone

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Sep 29, 2026 •

Copy link
Copy Markdown

The OpenAPI schema generator in base_rest (cerberus_to_json) fails with
AttributeError: 'str' object has no attribute 'get' when generating
Swagger documentation for Reception.

This occurs because packaging_levels was incorrectly defined as a dict
wrapping a list schema produced by self.schemas._schema_list_of(...).

_schema_list_of already returns a properly formatted Cerberus dictionary
specifying "type": "list". Wrapping it under an extra {"type": "dict", "schema": ...}
caused cerberus_to_json to misinterpret "type": "list" as a dictionary field
specification and attempt to call .get() on the string 'list'.

cc @jbaudoux

…ckaging

The OpenAPI schema generator in base_rest (`cerberus_to_json`) fails with
`AttributeError: 'str' object has no attribute 'get'` when generating
Swagger documentation for Reception.

This occurs because `packaging_levels` was incorrectly defined as a `dict`
wrapping a `list` schema produced by `self.schemas._schema_list_of(...)`.

`_schema_list_of` already returns a properly formatted Cerberus dictionary
specifying `"type": "list"`. Wrapping it under an extra `{"type": "dict", "schema": ...}`
caused `cerberus_to_json` to misinterpret `"type": "list"` as a dictionary field
specification and attempt to call `.get()` on the string `'list'`.
@OCA-git-bot OCA-git-bot added series:16.0 mod:shopfloor_reception_add_packaging Module shopfloor_reception_add_packaging labels Sep 29, 2026

@jbaudoux jbaudoux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-1288-by-jbaudoux-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit d6651f6 into OCA:16.0 Sep 29, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at ab5789c. Thanks a lot for contributing to OCA. ❤️

@lmignon
lmignon deleted the 16.0-fix-shopfloor_reception_add_packaging-invalid-schema branch September 30, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants