OCA / server-env

Tools to manage environment-dependent configuration
GNU Affero General Public License v3.0
57 stars 162 forks source link

[14.0] server_env: fix inverse method (closes #151) #153

Closed simahawk closed 1 year ago

simahawk commented 1 year ago

odoo.fields.determine requires inverse methods to have __name__ attribute. Unfortunately with partialmethod this attribute is not propagated even by using functools.update_wrapper. In any case, update_wrapper would propagate the wrapped func name which is not the same here.

Introduced by https://github.com/odoo/odoo/commit/36544651f2049bcf18777091dbf02c9631b33243

An alternative solution has been proposed in #152 but I think it does not address all the needs. @rven pls feel free to argue against this ;)

rven commented 1 year ago

Works also on v16!

simahawk commented 1 year ago

/ocabot merge patch

@rven could you please fwd port to 15 and 16? :pray:

OCA-git-bot commented 1 year ago

What a great day to merge this nice PR. Let's do it! Prepared branch 14.0-ocabot-merge-pr-153-by-simahawk-bump-patch, awaiting test results.

OCA-git-bot commented 1 year ago

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