Skip to content

[14.0][ADD] extendable: New addon to alllow usage of the Extendable python …#246

Merged
OCA-git-bot merged 1 commit intoOCA:14.0from
acsone:14.0-add-extendable-lmi
Feb 5, 2022
Merged

[14.0][ADD] extendable: New addon to alllow usage of the Extendable python …#246
OCA-git-bot merged 1 commit intoOCA:14.0from
acsone:14.0-add-extendable-lmi

Conversation

@lmignon
Copy link
Contributor

@lmignon lmignon commented Feb 4, 2022

…package into odoo

ping @sbidoul @qgroulard

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

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

Fantastic approach to create pythonic classes that are extendable in Odoo addons.

First use here: OCA/event#247

@lmignon lmignon force-pushed the 14.0-add-extendable-lmi branch from 4a28002 to 4342b90 Compare February 4, 2022 17:30
@lmignon
Copy link
Contributor Author

lmignon commented Feb 5, 2022

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 14.0-ocabot-merge-pr-246-by-lmignon-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 793e7fe into OCA:14.0 Feb 5, 2022
@OCA-git-bot
Copy link
Contributor

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

@lmignon lmignon deleted the 14.0-add-extendable-lmi branch February 5, 2022 11:09
@rvalyi
Copy link
Member

rvalyi commented Feb 5, 2022

is extendable "Odoo done right" ;-) ?

@lmignon
Copy link
Contributor Author

lmignon commented Feb 7, 2022

What do you mean by Odoo done right ? The extendable python package lack of documentation to expose the principles, concepts and implementation of this package (will be done in the future). In short, it allows you to write normal/modern python code with the same extension mechanism as the odoo models. With extendable, you always use your class definition in your code (never an object from a registry). This class act as a proxy to the concrete class. This concrete class is the result of the aggregation of all the specializations defined into the code and known at runtime. It's thus possible to write your python code quite conveniently and even more because this approach supports python static typing. This makes the code easier to write (auto completion) and maintain. It also becomes possible to use mypy to check your code. We are in the early stages of this approach and we are starting to use it in one project in order to confront it with concrete cases. It has taken a long time to get to this point, but I am confident that the foundations are solid enough now to make this work public (even if we don't advertise it.). I also tried to make sure that this library offers sufficient facilities to be able to mix other existing types in order to make them extendable. extendable-pydantic is the first illustration. (I can even say that it is the will to be able to make pydantic extedable "like" odoo models that was the starting point of all this)

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.

5 participants