-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
[16.0][ADD] account_analytic_tag #572
Conversation
5a73f68
to
ea90829
Compare
ping @sergio-teruel , @pedrobaeza |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a lot of things:
- Analytic tags on invoices.
- Transfer such tags on the created analytic entries when publishing the invoices.
from odoo import fields, models | ||
|
||
|
||
class AccountAnalyticDistribution(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is not needed anymore. You only need the tag
active_analytic_distribution = fields.Boolean("Analytic Distribution") | ||
analytic_distribution_ids = fields.One2many( | ||
"account.analytic.distribution", "tag_id", string="Analytic Accounts" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these 2 fields. We are only wanting the tag part.
|
||
|
||
class AccountAnalyticLine(models.Model): | ||
_inherit = "account.analytic.line" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go into a separate file.
@@ -0,0 +1 @@ | |||
This module adds *account analytic tags* on accounts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module adds *account analytic tags* on accounts. | |
This module restores the *account analytic tags* as a method for categorizing analytic entries, selectable from the invoices, and transferred to them on publishing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add empty files.
@@ -0,0 +1 @@ | |||
* Yadier Quesada - Tecnativa <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the form we put it:
* Yadier Quesada - Tecnativa <yadier.dequesada@tecnativa.com> | |
* `Tecnativa <https://www.tecnativa.com>`__: | |
* Yadier Quesada |
32f2c0d
to
650b157
Compare
All suggestions were made, please review @pedrobaeza |
87b62ce
to
d36983e
Compare
ping @pilarvargas-tecnativa , @carlosdauden Please review |
Thank you! Great contribution! I will review this Friday! |
@Yadier-Tecnativa @pedrobaeza nice PR!, would you please drop some light on why do you remove the analytic_distribution_ids? The analytic_distribution_ids allowed to have a "predefined" percentage for each analytic account so that it is easier for and end-user to quickly select a set of "predefined" percentages. This is not covered by standard Odoo in v16.0 not even by using the new analytic plans. Thanks in advance for any light |
Because this feature is already covered by standard v16. |
Hello! Really thank you very much for this contribution. The implementation with this PR of analytic tags is different from Odoo 15 and previous. In this moment functionality of this module duplicated the function of Analytic Plans.
You create analytic tags for many analytic accounts that will be created in the future (like projects) Important: When the mind behind this decision in Odoo deleted the tags, he/she thought that all Odoo customers worldwide where using tags for distributions! But not, just tag. See I have recorded a video and created an excel 😄 see: This PR should be able to reproduce that use case like in Odoo 15, 14, 13, 12, 11, etc.
Let me know please if I can help you further Regards, |
account_analytic_tag/README.rst
Outdated
===== | ||
|
||
Analytical tags. | ||
This function allows you to create formulas to establish the distribution of prices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yadier-Tecnativa this is not the function of analytic tags
account_analytic_tag/README.rst
Outdated
Analytical tags. | ||
This function allows you to create formulas to establish the distribution of prices | ||
between analytical accounts. This means that when we create an analytics tag, | ||
we must establish an Analytical Account to which it is directed and the monetary percentage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented previously not this is not. Please check the video I recorded 🙏🏼 😄
Thanks for this work. I think there are many different ways people were using analytic tags with other versions. Would this make sense to you that we split the feature with first a base module that just provides the |
company_id = fields.Many2one("res.company", string="Company") | ||
account_analytic_id = fields.Many2one( | ||
"account.analytic.account", string="Analytic Account", required=True | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This m2o field seems wrong ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a help text that explains the purpose of this account_analytic_id
field? Perhaps a more specific label than Analytic Account
would help too.
I don't see many sense on splitting model definition from account.move.line links at least. No need to extra dependencies (all are in |
FYI, I will overtake this PR and finish it. |
In our use case we need the tags but not the link with So I don't mind if the link with move lines is in the same module, but then we also need the group to show the analytic tags on move lines only to selected users. In general I prefer small modules with restricted scope because they are easier to migrate. But I'm not blocking on this, especially if you do the work :).
@pedrobaeza thanks! Do you know approximately when you'll work on that? |
Probably next week. |
I agree 👍🏼 , thank you!
@sbidoul then you set
Interesting too. I guess the users with permissions in analytic with an extra security group can.
Awesome! Thank you ver much. |
d36983e
to
e4951af
Compare
The following changes have been done:
|
a0742ba
to
6f487a2
Compare
Changes done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @victoralmau !
I will finish my review today! This evening 😄 |
I'm thinking on reintroducing the distributions on tags as others have commented, as a way of "templating" this without defining a distribution model. What do you think about it? |
This is a very good point. Previously (up to v15) we all modeled the analytical distribution with labels, but now in v16 the concept of distributions has been introduced. Advantages / disadvantages of each option. Option A: Keep the distributions in the labels.
Option B: Leave the analytical tags without distributions.
Maybe option A is the most reasonable, what do others think? |
@pedrobaeza Can this be done in another module, or in a second step after merging this PR? |
To me this justifies doing another analytic distributions mechanisms in a different module. |
Ok, thinking about this again, I think the best thing to do would be:
In this way, I think it avoids "duplicating" the operation of the analytical distributions and could be used in one way or another. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK about a separated module for distributions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
Thank you for this great work @victoralmau
After review, I see this (let me know your opinions):
- In Invoice lines, set Analytic Tags after Analytic
- Go to Accounting -> Accounting -> Journal Items , Then we cannot group by "Analytic Account"
- Go to Accounting -> Accounting -> Management -> Analytic Items, change label "Tags" by "Analytic Tags" for better fields order (as alphabetical) and understanding
In a separate comment I can give my personal opinion about distributions.
Thank you very much! ❤️
============= | ||
|
||
To manage analytic account tags using this module, you need to: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go to Accounting -> Configuraton -> Settings -> Activate "Analytic Tags"
This PR has the |
Hello, this is my opinion about a new module for distributions. The most important writing this down here is that I don't want to be right, I am aware that there are many different types of Odoo implementations and different types of companies and clients. I don't want to convince anyone. I just want to provide a vision that may help someone else make their own decisions. In fact, I really like reading your opinions and decisions and they make me wonder why and what I can learn from it. So... If we in OCA reintroduce analytic distributions in tags with are confusing users further. As for every one in Odoo distributions are done in Analytic Plans ( I'm not opposed to anything 😄, this is an open community, but I do think that in addition to having a separate module we should make a separate repository like https://github.com/OCA/account-analytic-tags-distribution . Because we must keep an open scenario where contributors extend Odoo using Odoo analytics distributions with their analytics Plans. In other case, this will be really confusing when developing modules around distributions in Analytic Plans like Odoo Core and Analytic Tags as older versions. In Odoo 18 nobody (new contributors) will remember about why are Distributions in Tags talking around product vision. You have done a really nice analysis 👍🏼 take this point of view just if it gives you more perspective: Perfect migrations from Odoo 15 to Odoo 16 for me is like:
Opining and introducing more points about this great 🥇 pros and cons analysis:
For me this is a disadvantage as you are separating important concepts in Odoo Core. Imagine you decide in Odoo 13 to maintain account.invoice model as a similar example.
For me this is not a Advantage as you don't need to define
As said before, you don't have to define concept of distributions. It's not a must, it is an option. Analytic Plans are just plans of analytic account, grouped, that maybe you you may want to distribute among them or not.
If you think is needed is OK. I think all the time about have we have (a lot) to not repeat my self (DRY)
My best!, sorry for the length! (my fault) 💯 🥇 👍🏼 Thank you very much for this work! 👍🏼 |
6f487a2
to
7f99d4c
Compare
Changes done:
Other comments:
|
@victoralmau put |
Restore account.analytic.tag TT44062 Co-authored-by: victoralmau
7f99d4c
to
28e3d95
Compare
/ocabot merge nobump Fantastic! You are awesome! 💚 |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 70bde0c. Thanks a lot for contributing to OCA. ❤️ |
Restore account.analytic.tag
Solve the issue #551
@Tecnativa TT44062