-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[8.0] add analytic_structure #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… with many models
…ionality This view is editable in tree view
new group group_ans_manager, people of this group can create analytic structure
… analytic_structure class. These methods should be called by models that implement analytic fields, respectively in their fields_get and fields_view_get methods.
…y, etc. in the view. When updating the invisible and tree_invisible modifiers, the analytic_fields_view_get method used to override the entire "modifiers" attribute. This isn't the case anymore.
|
Hey @gavrelj, thank you for your Pull Request. It looks like some users haven't signed our Contributor License Agreement, yet.
Appreciation of efforts, |
|
This module was merged from the XCG repositories at the PyConFR 2015. It requires base_model_metaclass_mixin to function. See pull request #273 |
|
Very interesting. AFAICS this implements true multi-dimensions like Ms NAV and Oracle. Thoughts? |
|
I also see this for account-analytic |
|
Challenge: I wonder if the |
|
Hey, I'm not the best person to explain, but basically: this is not (explicitly) related to accounting, and also not related to Odoo analytics. This module should work fine alongside Odoo analytics, but using both would be functionally useless. That is why, with Alexandre Fayolle, we figured server-tools would be a better fit for analytic_structure. |
|
I see, I didn't notice that. |
|
I had a look at the code, and there's a lot of magic going there, to dynamically inject fields in other models and views. I'm afraid it's too much for my Python skills. I wonder if there isn't a way to achieve the same effect in a less "invasive" way? It might not be a masterpiece, but it would allow to significantly cut down the complexity and line count. |
|
Hey Daniel, Thanks for looking closer into this! Regarding your 2 points:
|
|
Thanks for being open for a design discussion.
The It doesn't automatically add them to the views. You can keep For example , Ms NAV usually has only Dim1 and Dim2 directly available in forms. To see the full dimension combination you have a button opening a popup navigate to a popup window. A similar feature would be simple to implement in Odoo. And IMO you can customize views to add extra dimensions to be available directly in the main form. The |
|
Hi Daniel, thanks for your review. I am happy you see this as "true" multi dimensional analytics :) This is indeed inspired by our experience with true accounting & analytics :) Getting to the point: I think removing the metaclass adds a burden on the developper putting him in charge of the maintenance of a running system and moreover putting him in the critical path of the functionnal teams who typically designs and implements the analytic matrix without asking developper help in our deployment scenario. I don't see the metaclass as a big hassle regarding the fact that it gives you dynamic addition of dimensions in your structure without any development. Maintaining multi dimensionnal analytics and multi currency systems is (somewhat) complex and will require a certain level of dedication that we are ready to maintain. You can see these modules have been around for a long time and we constantly improve and bugfix on them (and port the from one version to another). From the functionnal team perspective it would be perceived as a regression to be forced to ask a developper to add dimension columns to the analysed object. And I don't see how we could achieve the same level of dynamicity without a metaclass. To tell you the truth I challenged the metaclass proposition a lot when it first popped up in our team. The first implementation I did (not in this repos) was without metaclasses and limited to 5 dimensions per object. When my team came to me proposing to become more dynamic with the use of metaclass I was reluctant for the same reasons as you are (level of entry for maintenance). But after challenging the team they convinced me. I never regretted my decision to allow them to use metaclasses for this purpose. Metaclass programing is not that hard and gives a real advantage in that case. |
|
@faide That's a constructive discussion. Please bear with me challenging the approach a little more. At the model level, I argue that my Many2one delegated field solution achieves that: At the Views level, adding a field to a form view XML is not that complicated. But supposing that you still object that, we could keep the existing approach of Wrapping up, my point is that wisely used delegation inheritance can replace the field injection metaclass. |
|
@dreispt thanks for taking time to help us review this module. I appreciate this and the constructive approach you take on it. I'll try to clear up some points I may not have correctly expressed. Our design goal was:
Using delegate=True on a many2one is the new way for inherits (iirc). This means the data is not stored "in line" but in another table. If we wanted to use this mechanism for eg: account.move.line we would have a new object spawned for every line in the system linked to the account.move.line This would make things slower when creating a lot of account.move.line and things slower and harder on the reporting side (end user of analytics is always a report designer) For the field_get injection what kind of companion module would you see? The metaclass permits to auto inject the field_get mechanism on all analyzable object without ever implementing the field get by yourself. This represents a huge time and maintenance boost for the integrator. |
|
@faide And what about inheriting from an AbstractModel, like what it's done in the core to enable messaging features in Models. That inheritance style adds the extra field directly on each model. A non-technical person would add the needed fields to the AbstractModel, which is as simple as filling a form to create a record (probably followed by module upgrades). AFAICS, at the model level this achieves your goals. |
|
Any news about this PR? As runbot has errors - even not possible to test it. Also will there be any instructions on testing? |
|
I only looked at the code superficially, but this looks like having a lot of potential! I'd suggest to get started by making it testable on runbot, this way, you should get functional people in the boat. Also consider adding some self-demo features on runbot like https://github.com/OCA/server-tools/blob/8.0/field_rrule/hooks.py#L10 |
|
Thanks for the review and test suggestions - for now though, this addon does not install in travis because it depends on |
|
any news on this PR somewhere? Does it inclusion under OCA umbrella is abandoned? |
|
AFAICS, 3 years later there's still no signed CLA and CI is still ❌, so closing. Feel free to reopen if needed. |
Syncing from upstream OCA/server-tools (8.0)

This module allows using several analytic dimensions through a structure related to an object model.
See the README.rst file for informations about how to integrate analytic functionalities into a model.