Giter Site home page Giter Site logo

Comments (5)

rvalyi avatar rvalyi commented on July 1, 2024

will do the trick. At first I thought changing these onchange name for standardizing was really invasive. But then I thought at least we don't need to have them in the XML of the views anymore so that wouldn't require lot's of database update right? Only restart, correct? If so seems acceptable.

But still this looks like a basic limitation of the ORM is making us deal with hundreds of side effects in all the modules... I tend to think the ORM would better be fixed at all cost then, for me even if it was only in OCB as I don't really care anymore what SA does or not on its own suicide branch...

from maintainer-tools.

moylop260 avatar moylop260 commented on July 1, 2024

@pedrobaeza
Thanks for information.

Do you have a issue in odoo/odoo for this case?

We can justify this guideline with the answer of issue.

from maintainer-tools.

pedrobaeza avatar pedrobaeza commented on July 1, 2024

I don't put any issue to Odoo because it cannot be considered like that, but a feature. I ping Raphael Collet for having his opinion in this issue instead of splitting the debate across multiple issues.

from maintainer-tools.

rco-odoo avatar rco-odoo commented on July 1, 2024

The convention you propose looks perfectly fine to me.

The other proposal (normalize on onchange_<field_name> and make the ORM collect them all) looks bug prone and breaks Python conventions. It makes the ORM reinterpret method overriding. What if you actually want to override an existing onchange method?

@pedrobaeza 's convention could be summarized as:

  • to add an onchange method on field, define a method onchange_field_module decorated with @onchange; the naming convention avoids accidental name clashes
  • to modify an existing onchange method, override it like any Python method

from maintainer-tools.

pedrobaeza avatar pedrobaeza commented on July 1, 2024

Thanks for the answer, Raphael. Yeah, it makes totally sense to respect Python overriding convention. I'll make the PR with the convention.

from maintainer-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.