forked from OCA/account-analytic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
290825a
commit 41a9c0e
Showing
15 changed files
with
542 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
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. | ||
|
||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/87/8.0 | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
* This module hasn't been tested with *account_analytic_plans* module | ||
installed, so maybe it's incompatible with it. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Pedro M. Baeza <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: http://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: http://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit http://odoo-community.org. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2015 Pedro M. Baeza | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2015 Pedro M. Baeza | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
{ | ||
'name': 'Partner in analytics', | ||
'version': '8.0.1.0.0', | ||
'summary': 'Classify analytic entries by partner', | ||
'category': 'Analytic Accounting', | ||
'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza, ' | ||
'Antiun Ingeniería S.L., ' | ||
'Odoo Community Association (OCA)', | ||
'website': 'http://www.serviciosbaeza.com', | ||
'depends': [ | ||
'analytic', | ||
'account', | ||
], | ||
'data': [ | ||
'views/account_analytic_line_views.xml', | ||
'views/res_partner_views.xml', | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * analytic_partner | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2015-08-12 23:41+0000\n" | ||
"PO-Revision-Date: 2015-08-12 23:41+0000\n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: analytic_partner | ||
#: view:res.partner:analytic_partner.view_partner_form_analytic | ||
msgid "Cost/Revenue" | ||
msgstr "" | ||
|
||
#. module: analytic_partner | ||
#: model:ir.actions.act_window,name:analytic_partner.act_analytic_cost_revenue | ||
msgid "Costs & Revenues" | ||
msgstr "" | ||
|
||
#. module: analytic_partner | ||
#: view:account.analytic.line:analytic_partner.view_account_analytic_line_filter_partner | ||
#: field:account.analytic.line,partner_id:0 | ||
msgid "Partner" | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * analytic_partner | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2015-08-12 23:41+0000\n" | ||
"PO-Revision-Date: 2015-08-12 23:41+0000\n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: analytic_partner | ||
#: view:res.partner:analytic_partner.view_partner_form_analytic | ||
msgid "Cost/Revenue" | ||
msgstr "Costes/Ingresos" | ||
|
||
#. module: analytic_partner | ||
#: model:ir.actions.act_window,name:analytic_partner.act_analytic_cost_revenue | ||
msgid "Costs & Revenues" | ||
msgstr "Costes e ingresos" | ||
|
||
#. module: analytic_partner | ||
#: view:account.analytic.line:analytic_partner.view_account_analytic_line_filter_partner | ||
#: field:account.analytic.line,partner_id:0 | ||
msgid "Partner" | ||
msgstr "Empresa" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2015 Pedro M. Baeza | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from . import account_analytic_line | ||
from . import account_invoice | ||
from . import account_move_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2015 Pedro M. Baeza | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from openerp import models, fields | ||
|
||
|
||
class AccountAnalyticLine(models.Model): | ||
_inherit = 'account.analytic.line' | ||
|
||
partner_id = fields.Many2one( | ||
comodel_name='res.partner', string="Partner", | ||
domain="[('parent_id', '=', False)]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2015 Pedro M. Baeza | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from openerp import models, api | ||
|
||
|
||
class AccountInvoice(models.Model): | ||
_inherit = 'account.invoice' | ||
|
||
@api.multi | ||
def _get_analytic_lines(self): | ||
"""Put partner on generated analytic lines""" | ||
iml = super(AccountInvoice, self)._get_analytic_lines() | ||
for il in iml: | ||
for analytic_vals in il.get('analytic_lines', []): | ||
analytic_vals[2]['partner_id'] = ( | ||
self.partner_id.commercial_partner_id.id) | ||
return iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -*- coding: utf-8 -*- | ||
# (c) 2015 Pedro M. Baeza | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from openerp import models, api | ||
|
||
|
||
class AccountMoveLine(models.Model): | ||
_inherit = 'account.move.line' | ||
|
||
@api.model | ||
def _prepare_analytic_line(self, obj_line): | ||
res = super(AccountMoveLine, self)._prepare_analytic_line(obj_line) | ||
res['partner_id'] = ( | ||
obj_line.invoice.partner_id.commercial_partner_id.id) | ||
return res |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.