Skip to content
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][mig] analytic_partner #609

Closed
wants to merge 22 commits into from

Conversation

dreispt
Copy link
Sponsor Member

@dreispt dreispt commented Nov 18, 2023

Supersedes #581

pedrobaeza and others added 21 commits November 18, 2023 13:46
Classify analytic items by partner
==================================

This module adds a partner on each analytic item for allowing to have another
dimension for analysing data.

It also handles the proper propagation of this field to the created analytic
entries when validating invoices.

Configuration
=============

You have to be granted as at least "Accountant" in your user profile and
have checked the "Analytic Accounting" access right.

Usage
=====

Go to Accounting > Analytic Journal Items, and there, you can set the partner
for the analytic items, and search or group by it.

You can also go to a partner, and click on the smart-button "Cost/Revenue",
placed on the upper-right part, and you will navigate to the analytic items
associated to this partner.

Known issues / Roadmap
======================

* This module hasn't been tested with *account_analytic_plans* module
installed, so maybe it's incompatible with it.
* IMP: Distinguish between the partner of the account and the specific partner
* FIX: Allow grouping on partner_id field. Fixes OCA#41
* FIX: README - Indentation is not correct in Known issues.
Currently translated at 100.0% (5 of 5 strings)

Translation: account-analytic-12.0/account-analytic-12.0-analytic_partner
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-analytic_partner/gl/
Currently translated at 100.0% (5 of 5 strings)

Translation: account-analytic-12.0/account-analytic-12.0-analytic_partner
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-analytic_partner/ca/
Currently translated at 100.0% (5 of 5 strings)

Translation: account-analytic-12.0/account-analytic-12.0-analytic_partner
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-analytic_partner/pt_BR/
Currently translated at 100.0% (5 of 5 strings)

Translation: account-analytic-12.0/account-analytic-12.0-analytic_partner
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-12-0/account-analytic-12-0-analytic_partner/zh_CN/
Currently translated at 100.0% (5 of 5 strings)

Translation: account-analytic-14.0/account-analytic-14.0-analytic_partner
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-14-0/account-analytic-14-0-analytic_partner/fr/
Currently translated at 87.5% (7 of 8 strings)

Translation: account-analytic-14.0/account-analytic-14.0-analytic_partner
Translate-URL: https://translation.odoo-community.org/projects/account-analytic-14-0/account-analytic-14-0-analytic_partner/fr_FR/
@dreispt dreispt force-pushed the heliaktiv-16.0-mig-analytic_partner branch from e15e516 to 8701283 Compare November 18, 2023 20:01
@dreispt dreispt force-pushed the heliaktiv-16.0-mig-analytic_partner branch 2 times, most recently from 222226e to 329642e Compare December 3, 2023 16:02
Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @dreispt I'm struggling to find out why this module is still needed. Searching for previous internal issues the problem seemed to be that when the analytic account used had a partner set it took that one instead of the one in the move line...

But I can't reproduce that issue anymore. What case are we covering here right now? As far as I could test, the other partner is always the same as the partner.

@@ -0,0 +1,9 @@
#. Go to **Invoicing > Configuration > Management > Analytic Items**.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#. Go to **Invoicing > Configuration > Management > Analytic Items**.
#. Go to **Invoicing > Accounting > Management > Analytic Items**.

def _prepare_analytic_line(self):
res = super()._prepare_analytic_line()
res[0]["other_partner_id"] = self.move_id.partner_id.commercial_partner_id.id
def _prepare_analytic_lines(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that _prepare_analytic_distribution_line is the proper method to hook into now.

Copy link

@maisim maisim Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chienandalu , I think you are right, we can add other_partner_id to the dict returned by _prepare_analytic_distribution_line.
Somethings like:

def _prepare_analytic_distribution_line(self, distribution, account_id, distribution_on_each_plan):
    vals = super()._prepare_analytic_distribution_line(distribution, account_id, distribution_on_each_plan)
    vals['other_partner_id'] = self.move_id.partner_id.commercial_partner_id.id
    return vals

Hi @dreispt, How do you want to proceed? Can I create a PR on your fork?

def _prepare_analytic_line(self):
res = super()._prepare_analytic_line()
res[0]["other_partner_id"] = self.move_id.partner_id.commercial_partner_id.id
def _prepare_analytic_lines(self):
Copy link

@maisim maisim Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chienandalu , I think you are right, we can add other_partner_id to the dict returned by _prepare_analytic_distribution_line.
Somethings like:

def _prepare_analytic_distribution_line(self, distribution, account_id, distribution_on_each_plan):
    vals = super()._prepare_analytic_distribution_line(distribution, account_id, distribution_on_each_plan)
    vals['other_partner_id'] = self.move_id.partner_id.commercial_partner_id.id
    return vals

Hi @dreispt, How do you want to proceed? Can I create a PR on your fork?

@flotho
Copy link
Member

flotho commented Jun 29, 2024

Hi @maisim , thanks for review with @chienandalu
Ad @dreispt doesn't seems to have new commits since a long time, I think you could use his branch to create a new PR to supersedes this one. Authoring will be kept anyway.
Regards

@dreispt
Copy link
Sponsor Member Author

dreispt commented Aug 22, 2024

@maisim Yes, you are welcome to pull this branch into your fork and make your own PR.

@maisim
Copy link

maisim commented Aug 26, 2024

There is another PR (a third) to migrate this module to 16.0 : #672
It seems almost finish \o/

Can someone update the Migration to 16.0 issue #489 and close the current PR #609 ?

@rafaelbn
Copy link
Member

/ocabot migration analytic_partner

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Aug 26, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Aug 26, 2024
17 tasks
@dreispt dreispt closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.