Closed pabloqb closed 5 years ago
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?
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
@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.
ok, then
|-- views/
| |-- <main_model>_view.xml
| |-- <inherited_main_model>_view.xml
So, you prefer in singular? Have you seen my argument about the plural?
As you said, the idea is to know the kind of data, not if there is one or more record.
OK, let's be inline with module naming in singular. Any other opinion?
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?
@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 :wink:
@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
If Odoo uses plural then I think we should stick to that. @max3903 what do you think?
Ok
El vie., 9 de nov. de 2018 10:06, Pedro M. Baeza notifications@github.com escribió:
If Odoo uses plural then I think we should stick to that. @max3903 https://github.com/max3903 what do you think?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OCA/odoo-community.org/issues/30#issuecomment-437407028, or mute the thread https://github.com/notifications/unsubscribe-auth/AA5XsCwXBlqIwvKXxxcnX-YNkQToK3Pbks5utaf8gaJpZM4YREoH .
Yes, alignement with Odoo guidelines is a good thing in general.
Thank you for the feedbacks and indications.
Best, Pablo.
According to section 1.5 File naming
In this point the suffix is singular mode view. However the complete tree structure states:
There is no suffix for main_model.xml and it is in plural for the inherited_mainmodelviews.xml example.
Which would be the correct way?
Best, Pablo.