Giter Site home page Giter Site logo

File naming for views about odoo-community.org HOT 14 CLOSED

oca avatar oca commented on July 18, 2024 1
File naming for views

from odoo-community.org.

Comments (14)

pedrobaeza avatar pedrobaeza commented on July 18, 2024 2

@Tardo about this topic, it's better to keep only one way of naming things (plural or singular), because if not, it's more difficult to know which to use, and would force also to rename if we change conditions of the files, etc.

About the other thing, better to open a new issue and to not mix things 😉

from odoo-community.org.

pedrobaeza avatar pedrobaeza commented on July 18, 2024 1

If Odoo uses plural then I think we should stick to that. @max3903 what do you think?

from odoo-community.org.

pedrobaeza avatar pedrobaeza commented on July 18, 2024

Thanks for pointing this out. Most of the documentation is in singular, but I prefer plural, as it expresses more what contains: it can be more than one view inside the XML file.

@OCA/board what do you think about this?

from odoo-community.org.

max3903 avatar max3903 commented on July 18, 2024

I don't see the point of repeating views in <inherited_main_model>_views.xml. We already know it is a view as it is in the views directory.

I would make a change to have:

|-- views/
|   |-- <main_model>.xml
|   |-- <inherited_main_model>.xml

from odoo-community.org.

pedrobaeza avatar pedrobaeza commented on July 18, 2024

@max3903 this has been discussed other times, and it's because if you perform a file name search, you want to know which can of data it is: demo, data, views, etc.

from odoo-community.org.

max3903 avatar max3903 commented on July 18, 2024

ok, then

|-- views/
|   |-- <main_model>_view.xml
|   |-- <inherited_main_model>_view.xml

from odoo-community.org.

pedrobaeza avatar pedrobaeza commented on July 18, 2024

So, you prefer in singular? Have you seen my argument about the plural?

from odoo-community.org.

max3903 avatar max3903 commented on July 18, 2024

As you said, the idea is to know the kind of data, not if there is one or more record.

from odoo-community.org.

pedrobaeza avatar pedrobaeza commented on July 18, 2024

OK, let's be inline with module naming in singular. Any other opinion?

from odoo-community.org.

Tardo avatar Tardo commented on July 18, 2024

I prefer use "views" because normally a "view .xml" defines multiple views.. The 'basics' are "form" and "tree" views...
Perhaps can use "view" for new view definition (google maps view, calendar view, etc..)

Filter "_views.xml" to know files that implement or inherit (if have the inhertied_ prefix) a Odoo base view type
Filter "_view.xml" to know files that implement a new view type

I have other questions about Code Guidelines... perhaps best open other issue for this questions?

from odoo-community.org.

Tardo avatar Tardo commented on July 18, 2024

@pedrobaeza ok, it makes sense what you say.
Odoo uses "views" in their guidelines... https://www.odoo.com/documentation/12.0/reference/guidelines.html#file-naming

from odoo-community.org.

max3903 avatar max3903 commented on July 18, 2024

from odoo-community.org.

sbidoul avatar sbidoul commented on July 18, 2024

Yes, alignement with Odoo guidelines is a good thing in general.

from odoo-community.org.

pabloqb avatar pabloqb commented on July 18, 2024

Thank you for the feedbacks and indications.

Best,
Pablo.

from odoo-community.org.

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.