Compare commits
259 Commits
accounting
...
18.0
| Author | SHA1 | Date | |
|---|---|---|---|
| a498653c26 | |||
| 730cb8ddde | |||
| 33b1eeedf8 | |||
| 4915aaa882 | |||
| ffd1dd0b18 | |||
| c670be57f6 | |||
| 4ac0b04bca | |||
| c5a4899c9f | |||
| bbb6d4c35c | |||
| 0a9a96ae77 | |||
| 7a4b7d8e8f | |||
| 285e2e807a | |||
| b3c96f6416 | |||
| 30f5ab37d2 | |||
| de21d5cb55 | |||
| d4dd28c402 | |||
| 45eaa252bd | |||
| 45222f6bb7 | |||
| d9715fff07 | |||
| 5227767283 | |||
| f76d79a606 | |||
| 14fd3e2f1e | |||
| e3ce2be1f4 | |||
| 0329122548 | |||
| f31284a113 | |||
| dcccf8b034 | |||
| 9751faf173 | |||
| 0d94303107 | |||
| fcd0cfb26f | |||
| 48863fc6d5 | |||
| 8ba35217bf | |||
| afe168723d | |||
| 72273b580f | |||
| 095ed48ded | |||
| 3a18336cc4 | |||
| 33c3ae3585 | |||
| aa7c94b0dc | |||
| e30a37898b | |||
| 88e1fa7965 | |||
| 9f19b53414 | |||
| 26fa9e2871 | |||
| 825423b3af | |||
| 06a1e15a4f | |||
| 23c6cf64cf | |||
| ae9617dedd | |||
| 2884546072 | |||
| d5ae939266 | |||
| 89047fe79c | |||
| d323267a28 | |||
| edf915943b | |||
| d7c9aee436 | |||
| e497c2b5d0 | |||
| 582b9e1b9b | |||
| 2b1c7afdf1 | |||
| 882ba9247a | |||
| 0671d0b2e9 | |||
| 509006cce4 | |||
| 44c55e900a | |||
| db83188b88 | |||
| aa4d44164c | |||
| ea9d3ff61f | |||
| f63dd818aa | |||
| 27f8b2541e | |||
| 558a815535 | |||
| 6d6add697b | |||
| bb235faf39 | |||
| 3951faca64 | |||
| 3db314cedb | |||
| 3e4faf0dc7 | |||
| a70964ad21 | |||
| d0a79ac5a6 | |||
| 04c6e4d523 | |||
| 3d2cbfcb74 | |||
| 320f8e5bbf | |||
| 4d495e5cc5 | |||
| dbb7322fce | |||
| ad78baae06 | |||
| b3f9c9f989 | |||
| 773476029f | |||
| bdf313b39e | |||
| 0b3fafc478 | |||
| ebe63f69ab | |||
| a59bf97a36 | |||
| a64c72a5d4 | |||
| 8b0f9d6361 | |||
| aa5439325d | |||
| b1dbab9942 | |||
| 43ae1490f5 | |||
| 2a07cab00b | |||
| 08fe99a3dd | |||
| 1dae9452af | |||
| 0c15c42d4f | |||
| 7a0ffe51cd | |||
| effc02f01b | |||
| e585583bf5 | |||
| eab73a9964 | |||
| fe62898189 | |||
| dd454b6269 | |||
| 3a469c333d | |||
| 3fe3d5944a | |||
| 42ecceac62 | |||
| f5a379f683 | |||
| 834b292f73 | |||
| d29c58ac6c | |||
| 1095317b23 | |||
| 80ff9d095b | |||
| e110187874 | |||
| 0786f81d63 | |||
| dcb6ca59fc | |||
| 3eb6ee6758 | |||
| 97753affb8 | |||
| e19d374f2b | |||
| 30a33e939f | |||
| d2e38977c2 | |||
| fa3cb047c8 | |||
| 8441d1956d | |||
| 633253de00 | |||
| 9dfa1d4d03 | |||
| 4350577ab7 | |||
| 63becde73e | |||
| 65dc01b15e | |||
| d0e0bb7b0c | |||
| 26ce32efb8 | |||
| aa9004b2ef | |||
| cd8b9c7975 | |||
| 500026c640 | |||
| bd2ee6d072 | |||
| da58849aae | |||
| 570140673c | |||
| 0e56aa652c | |||
| f3b0ba4632 | |||
| 2462220921 | |||
| 17efcd0fbc | |||
| 5d3db75b14 | |||
| ea03f85024 | |||
| be600989ba | |||
| 362fe7126a | |||
| 439ebf4356 | |||
| 9b50ec37a6 | |||
| 829a0fe36f | |||
| 6fc36fd5c5 | |||
| cbc31eaf55 | |||
| d63a402aaf | |||
| 31047a2670 | |||
| 24adc03ab3 | |||
| 4e051d6c52 | |||
| 2ebb0a73c2 | |||
| 906671a8b5 | |||
| a401dc3abd | |||
| 124377f7c5 | |||
| 90836e2f2a | |||
| 90d9a2b202 | |||
| c62d637f56 | |||
| ce90945990 | |||
| bb42154f35 | |||
| 3fd4eb215e | |||
| 543f423825 | |||
| 3d2ad55cfa | |||
| 50cf4b4107 | |||
| 8b6528cb8b | |||
| a55dafa6e0 | |||
| 24c89d97e5 | |||
| a7c36be076 | |||
| 2ef98a3897 | |||
| e21d4e66a9 | |||
| 38c91ef94c | |||
| 454e6936fb | |||
| 6d49162c09 | |||
| 5bd5c7b906 | |||
| a4de8697da | |||
| ce8f7f8711 | |||
| ca0ca65f14 | |||
| 30f2cf9b0e | |||
| f68e2d23e7 | |||
| 05c33d06c3 | |||
| 46fca55d81 | |||
| 4db469f273 | |||
| 72a652a5c6 | |||
| 5523995594 | |||
| 7b7bcf73e6 | |||
| acb3564750 | |||
| bb3359a309 | |||
| 8b1544647a | |||
| f727f3ab67 | |||
| a371ac9bdc | |||
| f84c891e96 | |||
| c31947bfab | |||
| d783d0d08d | |||
| 7a9e3c56fe | |||
| 11770d4950 | |||
| 0d150fa92e | |||
| 2933122464 | |||
| 5ab0886edf | |||
| e2045b21e2 | |||
| 596bd0a761 | |||
| 2a19267d2f | |||
| 50105c5ba6 | |||
| 434b1d46ab | |||
| d4945d20ee | |||
| 6e05ee4c57 | |||
| 33ba2de5dd | |||
| bb075fe036 | |||
| 60687c611a | |||
| 776bcc1f7f | |||
| 61061bdee9 | |||
| 77d467de70 | |||
| e4a63ec0e4 | |||
| 77dc1762c0 | |||
| e2bf6c22f9 | |||
| f9b4e1582a | |||
| 53a05d2240 | |||
| 8512a1d196 | |||
| 41a130c1d6 | |||
| 13b8322e3c | |||
| d18265433c | |||
| 16e661f8e8 | |||
| 8a40edf6c6 | |||
| 831cbe1449 | |||
| aea1722933 | |||
| 51a39b2e6e | |||
| 21e6a6f3f6 | |||
| dbca7e34e1 | |||
| ac8400512b | |||
| 817b05fe06 | |||
| cb1c9a1ffa | |||
| bc7dbb494a | |||
| 7827e2f224 | |||
| c4edb6b3af | |||
| bdc66120f3 | |||
| 636938581d | |||
| 2c3cfc3978 | |||
| 0236ef0809 | |||
| de9fd7b71d | |||
| eaeb978c19 | |||
| 2e55efb312 | |||
| b786492d5e | |||
| 6086717e66 | |||
| 375466beea | |||
| 8dfe9e9874 | |||
| 385ef060ed | |||
| 6c8b3cbd74 | |||
| 90d1e47e03 | |||
| 9700c192d0 | |||
| 25596b4149 | |||
| 0885b59bb3 | |||
| fcbe9a17db | |||
| 860fedb7e0 | |||
| 85ada8e9b7 | |||
| 6b98bf8be1 | |||
| 55fb716490 | |||
|
|
ab214ac9dd | ||
|
|
304da43eb8 | ||
| 48b0b7a283 | |||
| 40c3e1d471 | |||
| c1ecf1289d | |||
| 0741834b31 | |||
| 7a2debb3d7 | |||
| 6ef9d029eb | |||
|
|
96edc0c694 |
@@ -1,46 +0,0 @@
|
||||
====================================
|
||||
Odoo 19 Accounting Financial Reports
|
||||
====================================
|
||||
|
||||
This Module will provide all the financial reports for odoo 19
|
||||
community edition
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
To install this module, you need to:
|
||||
|
||||
Download the module and add it to your Odoo addons folder. Afterward, log on to
|
||||
your Odoo server and go to the Apps menu. Trigger the debug mode and update the
|
||||
list by clicking on the "Update Apps List" link. Now install the module by
|
||||
clicking on the install button.
|
||||
|
||||
Upgrade
|
||||
============
|
||||
|
||||
To upgrade this module, you need to:
|
||||
|
||||
Download the module and add it to your Odoo addons folder. Restart the server
|
||||
and log on to your Odoo server. Select the Apps menu and upgrade the module by
|
||||
clicking on the upgrade button.
|
||||
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
There is Nothing to Configure
|
||||
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Odoo Mates <odoomates@gmail.com>
|
||||
|
||||
|
||||
Author & Maintainer
|
||||
-------------------
|
||||
|
||||
This module is maintained by the Odoo Mates
|
||||
@@ -1,7 +0,0 @@
|
||||
from . import wizard
|
||||
from . import models
|
||||
from . import report
|
||||
|
||||
|
||||
def _pre_init_clean_m2m_models(env):
|
||||
env.cr.execute("""DROP TABLE IF EXISTS account_journal_account_report_partner_ledger_rel""")
|
||||
@@ -1,45 +0,0 @@
|
||||
{
|
||||
'name': 'Odoo 19 Accounting Financial Reports',
|
||||
'version': '1.0.2',
|
||||
'category': 'Invoicing Management',
|
||||
'description': 'Accounting Reports For Odoo 19, Accounting Financial Reports, '
|
||||
'Odoo 19 Financial Reports',
|
||||
'summary': 'Accounting Reports For Odoo 19',
|
||||
'sequence': '1',
|
||||
'author': 'Odoo Mates, Odoo SA',
|
||||
'license': 'LGPL-3',
|
||||
'company': 'Odoo Mates',
|
||||
'maintainer': 'Odoo Mates',
|
||||
'support': 'odoomates@gmail.com',
|
||||
'website': 'https://www.youtube.com/watch?v=yA4NLwOLZms',
|
||||
'depends': ['account'],
|
||||
'live_test_url': 'https://www.youtube.com/watch?v=yA4NLwOLZms',
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'data/account_account_type.xml',
|
||||
'views/menu.xml',
|
||||
'views/ledger_menu.xml',
|
||||
'views/financial_report.xml',
|
||||
'views/settings.xml',
|
||||
'wizard/account_report_common_view.xml',
|
||||
'wizard/partner_ledger.xml',
|
||||
'wizard/general_ledger.xml',
|
||||
'wizard/trial_balance.xml',
|
||||
'wizard/balance_sheet.xml',
|
||||
'wizard/profit_and_loss.xml',
|
||||
'wizard/tax_report.xml',
|
||||
'wizard/aged_partner.xml',
|
||||
'wizard/journal_audit.xml',
|
||||
'report/report.xml',
|
||||
'report/report_partner_ledger.xml',
|
||||
'report/report_general_ledger.xml',
|
||||
'report/report_trial_balance.xml',
|
||||
'report/report_financial.xml',
|
||||
'report/report_tax.xml',
|
||||
'report/report_aged_partner.xml',
|
||||
'report/report_journal_audit.xml',
|
||||
'report/report_journal_entries.xml',
|
||||
],
|
||||
'pre_init_hook': '_pre_init_clean_m2m_models',
|
||||
'images': ['static/description/banner.gif'],
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
|
||||
<record model="account.account.type" id="data_account_type_receivable">
|
||||
<field name="name">Receivable</field>
|
||||
<field name="type">asset_receivable</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_payable">
|
||||
<field name="name">Payable</field>
|
||||
<field name="type">liability_payable</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_liquidity">
|
||||
<field name="name">Bank and Cash</field>
|
||||
<field name="type">asset_cash</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_credit_card">
|
||||
<field name="name">Credit Card</field>
|
||||
<field name="type">liability_credit_card</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_current_assets">
|
||||
<field name="name">Current Assets</field>
|
||||
<field name="type">asset_current</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_non_current_assets">
|
||||
<field name="name">Non-current Assets</field>
|
||||
<field name="type">asset_non_current</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_prepayments">
|
||||
<field name="name">Prepayments</field>
|
||||
<field name="type">asset_prepayments</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_fixed_assets">
|
||||
<field name="name">Fixed Assets</field>
|
||||
<field name="type">asset_fixed</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_current_liabilities">
|
||||
<field name="name">Current Liabilities</field>
|
||||
<field name="type">liability_current</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_non_current_liabilities">
|
||||
<field name="name">Non-current Liabilities</field>
|
||||
<field name="type">liability_non_current</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_equity">
|
||||
<field name="name">Equity</field>
|
||||
<field name="type">equity</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_unaffected_earnings">
|
||||
<field name="name">Current Year Earnings</field>
|
||||
<field name="type">equity_unaffected</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_revenue">
|
||||
<field name="name">Income</field>
|
||||
<field name="type">income</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_other_income">
|
||||
<field name="name">Other Income</field>
|
||||
<field name="type">income_other</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_expenses">
|
||||
<field name="name">Expenses</field>
|
||||
<field name="type">expense</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_depreciation">
|
||||
<field name="name">Depreciation</field>
|
||||
<field name="type">expense_depreciation</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_type_direct_costs">
|
||||
<field name="name">Cost of Revenue</field>
|
||||
<field name="type">expense_direct_cost</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="data_account_off_sheet">
|
||||
<field name="name">Off-Balance Sheet</field>
|
||||
<field name="type">off_balance</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,3 +0,0 @@
|
||||
from . import account_account_type
|
||||
from . import account_financial_report
|
||||
from . import account_move_line
|
||||
@@ -1,34 +0,0 @@
|
||||
from odoo import api, models, fields
|
||||
|
||||
|
||||
class AccountAccountType(models.Model):
|
||||
_name = "account.account.type"
|
||||
_description = "Account Account Type"
|
||||
|
||||
name = fields.Char('Name', required=True, translate=True)
|
||||
type = fields.Selection(
|
||||
selection=[
|
||||
("asset_receivable", "Receivable"),
|
||||
("asset_cash", "Bank and Cash"),
|
||||
("asset_current", "Current Assets"),
|
||||
("asset_non_current", "Non-current Assets"),
|
||||
("asset_prepayments", "Prepayments"),
|
||||
("asset_fixed", "Fixed Assets"),
|
||||
("liability_payable", "Payable"),
|
||||
("liability_credit_card", "Credit Card"),
|
||||
("liability_current", "Current Liabilities"),
|
||||
("liability_non_current", "Non-current Liabilities"),
|
||||
("equity", "Equity"),
|
||||
("equity_unaffected", "Current Year Earnings"),
|
||||
("income", "Income"),
|
||||
("income_other", "Other Income"),
|
||||
("expense", "Expenses"),
|
||||
("expense_depreciation", "Depreciation"),
|
||||
("expense_direct_cost", "Cost of Revenue"),
|
||||
("off_balance", "Off-Balance Sheet"),
|
||||
],
|
||||
string="Type",
|
||||
help="These types are defined according to your country. The type contains more information " \
|
||||
"about the account and its specificities."
|
||||
)
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
from odoo import api, models, fields
|
||||
|
||||
|
||||
class AccountFinancialReport(models.Model):
|
||||
_name = "account.financial.report"
|
||||
_description = "Account Report"
|
||||
|
||||
@api.depends('parent_id', 'parent_id.level')
|
||||
def _get_level(self):
|
||||
'''Returns a dictionary with key=the ID of a record and value = the level of this
|
||||
record in the tree structure.'''
|
||||
for report in self:
|
||||
level = 0
|
||||
if report.parent_id:
|
||||
level = report.parent_id.level + 1
|
||||
report.level = level
|
||||
|
||||
def _get_children_by_order(self):
|
||||
res = self
|
||||
children = self.search([('parent_id', 'in', self.ids)], order='sequence ASC')
|
||||
if children:
|
||||
for child in children:
|
||||
res += child._get_children_by_order()
|
||||
return res
|
||||
|
||||
name = fields.Char('Report Name', required=True, translate=True)
|
||||
parent_id = fields.Many2one('account.financial.report', 'Parent')
|
||||
children_ids = fields.One2many('account.financial.report', 'parent_id', 'Account Report')
|
||||
sequence = fields.Integer('Sequence')
|
||||
level = fields.Integer(compute='_get_level', string='Level', store=True, recursive=True)
|
||||
type = fields.Selection([
|
||||
('sum', 'View'),
|
||||
('accounts', 'Accounts'),
|
||||
('account_type', 'Account Type'),
|
||||
('account_report', 'Report Value'),
|
||||
], 'Type', default='sum')
|
||||
account_ids = fields.Many2many(
|
||||
'account.account', 'account_account_financial_report',
|
||||
'report_line_id', 'account_id', 'Accounts'
|
||||
)
|
||||
account_report_id = fields.Many2one('account.financial.report', 'Report Value')
|
||||
account_type_ids = fields.Many2many(
|
||||
'account.account.type', 'account_account_financial_report_type',
|
||||
'report_id', 'account_type_id', 'Account Types'
|
||||
)
|
||||
report_domain = fields.Char(string="Report Domain")
|
||||
sign = fields.Selection(
|
||||
[('-1', 'Reverse balance sign'), ('1', 'Preserve balance sign')], 'Sign on Reports',
|
||||
required=True, default='1',
|
||||
help='For accounts that are typically more debited than credited and that you would '
|
||||
'like to print as negative amounts in your reports, you should reverse the sign '
|
||||
'of the balance; e.g.: Expense account. The same applies for accounts that are '
|
||||
'typically more credited than debited and that you would like to print as positive '
|
||||
'amounts in your reports; e.g.: Income account.'
|
||||
)
|
||||
display_detail = fields.Selection([
|
||||
('no_detail', 'No detail'),
|
||||
('detail_flat', 'Display children flat'),
|
||||
('detail_with_hierarchy', 'Display children with hierarchy')
|
||||
], 'Display details', default='detail_flat')
|
||||
style_overwrite = fields.Selection([
|
||||
('0', 'Automatic formatting'),
|
||||
('1', 'Main Title 1 (bold, underlined)'),
|
||||
('2', 'Title 2 (bold)'),
|
||||
('3', 'Title 3 (bold, smaller)'),
|
||||
('4', 'Normal Text'),
|
||||
('5', 'Italic Text (smaller)'),
|
||||
('6', 'Smallest Text'),
|
||||
], 'Financial Report Style', default='0',
|
||||
help="You can set up here the format you want this record to be displayed. "
|
||||
"If you leave the automatic formatting, it will be computed based on the "
|
||||
"financial reports hierarchy (auto-computed field 'level').")
|
||||
children_ids = fields.One2many('account.financial.report', 'parent_id', string='Children')
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
import ast
|
||||
from odoo.osv import expression
|
||||
from odoo import api, models, fields
|
||||
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
_inherit = "account.move.line"
|
||||
|
||||
@api.model
|
||||
def _where_calc(self, domain, active_test=True):
|
||||
"""Computes the WHERE clause needed to implement an OpenERP domain.
|
||||
|
||||
:param list domain: the domain to compute
|
||||
:param bool active_test: whether the default filtering of records with
|
||||
``active`` field set to ``False`` should be applied.
|
||||
:return: the query expressing the given domain as provided in domain
|
||||
:rtype: Query
|
||||
"""
|
||||
# if the object has an active field ('active', 'x_active'), filter out all
|
||||
# inactive records unless they were explicitly asked for
|
||||
if self._active_name and active_test and self.env.context.get('active_test', True):
|
||||
# the item[0] trick below works for domain items and '&'/'|'/'!'
|
||||
# operators too
|
||||
if not any(item[0] == self._active_name for item in domain):
|
||||
domain = [(self._active_name, '=', 1)] + domain
|
||||
|
||||
if domain:
|
||||
return expression.expression(domain, self).query
|
||||
else:
|
||||
return Query(self.env, self._table, self._table_sql)
|
||||
|
||||
@api.model
|
||||
def _apply_ir_rules(self, query, mode='read'):
|
||||
"""Add what's missing in ``query`` to implement all appropriate ir.rules
|
||||
(using the ``model_name``'s rules or the current model's rules if ``model_name`` is None)
|
||||
|
||||
:param query: the current query object
|
||||
"""
|
||||
if self.env.su:
|
||||
return
|
||||
|
||||
# apply main rules on the object
|
||||
Rule = self.env['ir.rule']
|
||||
domain = Rule._compute_domain(self._name, mode)
|
||||
if domain:
|
||||
expression.expression(domain, self.sudo(), self._table, query)
|
||||
|
||||
@api.model
|
||||
def _query_get(self, domain=None):
|
||||
self.check_access('read')
|
||||
|
||||
context = dict(self.env.context or {})
|
||||
domain = domain or []
|
||||
if not isinstance(domain, (list, tuple)):
|
||||
domain = ast.literal_eval(domain)
|
||||
|
||||
date_field = 'date'
|
||||
if context.get('aged_balance'):
|
||||
date_field = 'date_maturity'
|
||||
if context.get('date_to'):
|
||||
domain += [(date_field, '<=', context['date_to'])]
|
||||
if context.get('date_from'):
|
||||
if not context.get('strict_range'):
|
||||
domain += ['|', (date_field, '>=', context['date_from']), ('account_id.include_initial_balance', '=', True)]
|
||||
elif context.get('initial_bal'):
|
||||
domain += [(date_field, '<', context['date_from'])]
|
||||
else:
|
||||
domain += [(date_field, '>=', context['date_from'])]
|
||||
|
||||
if context.get('journal_ids'):
|
||||
domain += [('journal_id', 'in', context['journal_ids'])]
|
||||
|
||||
state = context.get('state')
|
||||
if state and state.lower() != 'all':
|
||||
domain += [('parent_state', '=', state)]
|
||||
|
||||
if context.get('company_id'):
|
||||
domain += [('company_id', '=', context['company_id'])]
|
||||
elif context.get('allowed_company_ids'):
|
||||
domain += [('company_id', 'in', self.env.companies.ids)]
|
||||
else:
|
||||
domain += [('company_id', '=', self.env.company.id)]
|
||||
|
||||
if context.get('reconcile_date'):
|
||||
domain += ['|', ('reconciled', '=', False), '|', ('matched_debit_ids.max_date', '>', context['reconcile_date']), ('matched_credit_ids.max_date', '>', context['reconcile_date'])]
|
||||
|
||||
if context.get('account_tag_ids'):
|
||||
domain += [('account_id.tag_ids', 'in', context['account_tag_ids'].ids)]
|
||||
|
||||
if context.get('account_ids'):
|
||||
domain += [('account_id', 'in', context['account_ids'].ids)]
|
||||
|
||||
if context.get('analytic_tag_ids'):
|
||||
domain += [('analytic_tag_ids', 'in', context['analytic_tag_ids'].ids)]
|
||||
|
||||
if context.get('analytic_account_ids'):
|
||||
domain += [('analytic_distribution', 'in', context['analytic_account_ids'].ids)]
|
||||
|
||||
if context.get('partner_ids'):
|
||||
domain += [('partner_id', 'in', context['partner_ids'].ids)]
|
||||
|
||||
if context.get('partner_categories'):
|
||||
domain += [('partner_id.category_id', 'in', context['partner_categories'].ids)]
|
||||
|
||||
where_clause = ""
|
||||
where_clause_params = []
|
||||
tables = ''
|
||||
if domain:
|
||||
domain.append(('display_type', 'not in', ('line_section', 'line_note')))
|
||||
domain.append(('parent_state', '!=', 'cancel'))
|
||||
|
||||
query = self._where_calc(domain)
|
||||
self._apply_ir_rules(query)
|
||||
from_string, from_params = query.from_clause
|
||||
where_string, where_params = query.where_clause
|
||||
tables, where_clause, where_clause_params = from_string, where_string, from_params + where_params
|
||||
return tables, where_clause, where_clause_params
|
||||
@@ -1,12 +0,0 @@
|
||||
from . import report_partner_ledger
|
||||
from . import report_general_ledger
|
||||
from . import report_trial_balance
|
||||
from . import report_tax
|
||||
from . import report_aged_partner
|
||||
from . import report_journal
|
||||
from . import report_financial
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="action_report_general_ledger" model="ir.actions.report">
|
||||
<field name="name">General Ledger</field>
|
||||
<field name="model">account.report.general.ledger</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">accounting_pdf_reports.report_general_ledger</field>
|
||||
<field name="report_file">accounting_pdf_reports.report_general_ledger</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_partnerledger" model="ir.actions.report">
|
||||
<field name="name">Partner Ledger</field>
|
||||
<field name="model">account.report.partner.ledger</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">accounting_pdf_reports.report_partnerledger</field>
|
||||
<field name="report_file">accounting_pdf_reports.report_partnerledger</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_report_trial_balance" model="ir.actions.report">
|
||||
<field name="name">Trial Balance</field>
|
||||
<field name="model">account.balance.report</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">accounting_pdf_reports.report_trialbalance</field>
|
||||
<field name="report_file">accounting_pdf_reports.report_trialbalance</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_financial" model="ir.actions.report">
|
||||
<field name="name">Financial Report</field>
|
||||
<field name="model">account.financial.report</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">accounting_pdf_reports.report_financial</field>
|
||||
<field name="report_file">accounting_pdf_reports.report_financial</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_account_tax" model="ir.actions.report">
|
||||
<field name="name">Tax Report</field>
|
||||
<field name="model">account.tax.report.wizard</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">accounting_pdf_reports.report_tax</field>
|
||||
<field name="report_file">accounting_pdf_reports.report_tax</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_aged_partner_balance" model="ir.actions.report">
|
||||
<field name="name">Aged Partner Balance</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">accounting_pdf_reports.report_agedpartnerbalance</field>
|
||||
<field name="report_file">accounting_pdf_reports.report_agedpartnerbalance</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_journal" model="ir.actions.report">
|
||||
<field name="name">Journals Audit</field>
|
||||
<field name="model">account.common.journal.report</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">accounting_pdf_reports.report_journal</field>
|
||||
<field name="report_file">accounting_pdf_reports.report_journal</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_journal_entries" model="ir.actions.report">
|
||||
<field name="name">Journals Entries</field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">accounting_pdf_reports.report_journal_entries</field>
|
||||
<field name="report_file">accounting_pdf_reports.report_journal_entries</field>
|
||||
<field name="binding_model_id" ref="account.model_account_move"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,263 +0,0 @@
|
||||
import time
|
||||
from odoo import api, models, fields, _
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.tools import float_is_zero
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
|
||||
class ReportAgedPartnerBalance(models.AbstractModel):
|
||||
_name = 'report.accounting_pdf_reports.report_agedpartnerbalance'
|
||||
_description = 'Aged Partner Balance Report'
|
||||
|
||||
def _get_partner_move_lines(self, account_type, partner_ids,
|
||||
date_from, target_move, period_length):
|
||||
# This method can receive the context key 'include_nullified_amount' {Boolean}
|
||||
# Do an invoice and a payment and unreconcile. The amount will be nullified
|
||||
# By default, the partner wouldn't appear in this report.
|
||||
# The context key allow it to appear
|
||||
# In case of a period_length of 30 days as of 2019-02-08, we want the following periods:
|
||||
# Name Stop Start
|
||||
# 1 - 30 : 2019-02-07 - 2019-01-09
|
||||
# 31 - 60 : 2019-01-08 - 2018-12-10
|
||||
# 61 - 90 : 2018-12-09 - 2018-11-10
|
||||
# 91 - 120 : 2018-11-09 - 2018-10-11
|
||||
# +120 : 2018-10-10
|
||||
periods = {}
|
||||
start = datetime.strptime(str(date_from), "%Y-%m-%d")
|
||||
date_from = datetime.strptime(str(date_from), "%Y-%m-%d").date()
|
||||
for i in range(5)[::-1]:
|
||||
stop = start - relativedelta(days=period_length)
|
||||
period_name = str((5-(i+1)) * period_length + 1) + '-' + str((5-i) * period_length)
|
||||
period_stop = (start - relativedelta(days=1)).strftime('%Y-%m-%d')
|
||||
if i == 0:
|
||||
period_name = '+' + str(4 * period_length)
|
||||
periods[str(i)] = {
|
||||
'name': period_name,
|
||||
'stop': period_stop,
|
||||
'start': (i!=0 and stop.strftime('%Y-%m-%d') or False),
|
||||
}
|
||||
start = stop
|
||||
|
||||
res = []
|
||||
total = []
|
||||
cr = self.env.cr
|
||||
user_company = self.env.user.company_id
|
||||
user_currency = user_company.currency_id
|
||||
company_ids = self.env.context.get('company_ids') or [user_company.id]
|
||||
move_state = ['draft', 'posted']
|
||||
date = self.env.context.get('date') or fields.Date.today()
|
||||
company = self.env['res.company'].browse(self.env.context.get('company_id')) or self.env.company
|
||||
|
||||
if target_move == 'posted':
|
||||
move_state = ['posted']
|
||||
arg_list = (tuple(move_state), tuple(account_type))
|
||||
|
||||
reconciliation_clause = '(l.reconciled IS FALSE)'
|
||||
cr.execute('SELECT debit_move_id, credit_move_id FROM account_partial_reconcile where max_date > %s', (date_from,))
|
||||
reconciled_after_date = []
|
||||
for row in cr.fetchall():
|
||||
reconciled_after_date += [row[0], row[1]]
|
||||
if reconciled_after_date:
|
||||
reconciliation_clause = '(l.reconciled IS FALSE OR l.id IN %s)'
|
||||
arg_list += (tuple(reconciled_after_date),)
|
||||
arg_list += (date_from, tuple(company_ids))
|
||||
query = '''
|
||||
SELECT DISTINCT l.partner_id, UPPER(res_partner.name)
|
||||
FROM account_move_line AS l left join res_partner on l.partner_id = res_partner.id, account_account, account_move am
|
||||
WHERE (l.account_id = account_account.id)
|
||||
AND (l.move_id = am.id)
|
||||
AND (am.state IN %s)
|
||||
AND (account_account.account_type IN %s)
|
||||
AND ''' + reconciliation_clause + '''
|
||||
AND (l.date <= %s)
|
||||
AND l.company_id IN %s
|
||||
ORDER BY UPPER(res_partner.name)'''
|
||||
cr.execute(query, arg_list)
|
||||
partners = cr.dictfetchall()
|
||||
# put a total of 0
|
||||
for i in range(7):
|
||||
total.append(0)
|
||||
|
||||
# Build a string like (1,2,3) for easy use in SQL query
|
||||
if not partner_ids:
|
||||
partner_ids = [partner['partner_id'] for partner in partners if partner['partner_id']]
|
||||
lines = dict((partner['partner_id'] or False, []) for partner in partners)
|
||||
if not partner_ids:
|
||||
return [], [], {}
|
||||
|
||||
# This dictionary will store the not due amount of all partners
|
||||
undue_amounts = {}
|
||||
query = '''SELECT l.id
|
||||
FROM account_move_line AS l, account_account, account_move am
|
||||
WHERE (l.account_id = account_account.id) AND (l.move_id = am.id)
|
||||
AND (am.state IN %s)
|
||||
AND (account_account.account_type IN %s)
|
||||
AND (COALESCE(l.date_maturity,l.date) >= %s)\
|
||||
AND ((l.partner_id IN %s) OR (l.partner_id IS NULL))
|
||||
AND (l.date <= %s)
|
||||
AND l.company_id IN %s'''
|
||||
cr.execute(query, (tuple(move_state), tuple(account_type), date_from,
|
||||
tuple(partner_ids), date_from, tuple(company_ids)))
|
||||
aml_ids = cr.fetchall()
|
||||
aml_ids = aml_ids and [x[0] for x in aml_ids] or []
|
||||
for line in self.env['account.move.line'].browse(aml_ids):
|
||||
partner_id = line.partner_id.id or False
|
||||
if partner_id not in undue_amounts:
|
||||
undue_amounts[partner_id] = 0.0
|
||||
line_amount = line.company_id.currency_id._convert(line.balance,
|
||||
user_currency,
|
||||
company, date)
|
||||
if user_currency.is_zero(line_amount):
|
||||
continue
|
||||
for partial_line in line.matched_debit_ids:
|
||||
if partial_line.max_date <= date_from:
|
||||
line_currency = partial_line.company_id.currency_id
|
||||
line_amount += line_currency._convert(partial_line.amount,
|
||||
user_currency,
|
||||
company, date)
|
||||
for partial_line in line.matched_credit_ids:
|
||||
if partial_line.max_date <= date_from:
|
||||
line_currency = partial_line.company_id.currency_id
|
||||
line_amount -= line_currency._convert(partial_line.amount,
|
||||
user_currency,
|
||||
company, date)
|
||||
if not self.env.user.company_id.currency_id.is_zero(line_amount):
|
||||
undue_amounts[partner_id] += line_amount
|
||||
lines[partner_id].append({
|
||||
'line': line,
|
||||
'amount': line_amount,
|
||||
'period': 6,
|
||||
})
|
||||
|
||||
# Use one query per period and store results in history (a list variable)
|
||||
# Each history will contain: history[1] = {'<partner_id>': <partner_debit-credit>}
|
||||
history = []
|
||||
for i in range(5):
|
||||
args_list = (tuple(move_state), tuple(account_type), tuple(partner_ids),)
|
||||
dates_query = '(COALESCE(l.date_maturity,l.date)'
|
||||
|
||||
if periods[str(i)]['start'] and periods[str(i)]['stop']:
|
||||
dates_query += ' BETWEEN %s AND %s)'
|
||||
args_list += (periods[str(i)]['start'], periods[str(i)]['stop'])
|
||||
elif periods[str(i)]['start']:
|
||||
dates_query += ' >= %s)'
|
||||
args_list += (periods[str(i)]['start'],)
|
||||
else:
|
||||
dates_query += ' <= %s)'
|
||||
args_list += (periods[str(i)]['stop'],)
|
||||
args_list += (date_from, tuple(company_ids))
|
||||
|
||||
query = '''SELECT l.id
|
||||
FROM account_move_line AS l, account_account, account_move am
|
||||
WHERE (l.account_id = account_account.id) AND (l.move_id = am.id)
|
||||
AND (am.state IN %s)
|
||||
AND (account_account.account_type IN %s)
|
||||
AND ((l.partner_id IN %s) OR (l.partner_id IS NULL))
|
||||
AND ''' + dates_query + '''
|
||||
AND (l.date <= %s)
|
||||
AND l.company_id IN %s'''
|
||||
cr.execute(query, args_list)
|
||||
partners_amount = {}
|
||||
aml_ids = cr.fetchall()
|
||||
aml_ids = aml_ids and [x[0] for x in aml_ids] or []
|
||||
for line in self.env['account.move.line'].browse(aml_ids):
|
||||
partner_id = line.partner_id.id or False
|
||||
if partner_id not in partners_amount:
|
||||
partners_amount[partner_id] = 0.0
|
||||
line_currency_id = line.company_id.currency_id
|
||||
line_amount = line_currency_id._convert(line.balance, user_currency, company, date)
|
||||
if user_currency.is_zero(line_amount):
|
||||
continue
|
||||
for partial_line in line.matched_debit_ids:
|
||||
if partial_line.max_date <= date_from:
|
||||
line_currency_id = partial_line.company_id.currency_id
|
||||
line_amount += line_currency_id._convert(
|
||||
partial_line.amount, user_currency, company, date)
|
||||
for partial_line in line.matched_credit_ids:
|
||||
if partial_line.max_date <= date_from:
|
||||
line_currency_id = partial_line.company_id.currency_id
|
||||
line_amount -= line_currency_id._convert(
|
||||
partial_line.amount, user_currency, company, date)
|
||||
if not self.env.user.company_id.currency_id.is_zero(line_amount):
|
||||
partners_amount[partner_id] += line_amount
|
||||
lines[partner_id].append({
|
||||
'line': line,
|
||||
'amount': line_amount,
|
||||
'period': i + 1,
|
||||
})
|
||||
history.append(partners_amount)
|
||||
|
||||
for partner in partners:
|
||||
if partner['partner_id'] is None:
|
||||
partner['partner_id'] = False
|
||||
at_least_one_amount = False
|
||||
values = {}
|
||||
undue_amt = 0.0
|
||||
if partner['partner_id'] in undue_amounts: # Making sure this partner actually was found by the query
|
||||
undue_amt = undue_amounts[partner['partner_id']]
|
||||
|
||||
total[6] = total[6] + undue_amt
|
||||
values['direction'] = undue_amt
|
||||
if not float_is_zero(values['direction'], precision_rounding=self.env.user.company_id.currency_id.rounding):
|
||||
at_least_one_amount = True
|
||||
|
||||
for i in range(5):
|
||||
during = False
|
||||
if partner['partner_id'] in history[i]:
|
||||
during = [history[i][partner['partner_id']]]
|
||||
# Adding counter
|
||||
total[(i)] = total[(i)] + (during and during[0] or 0)
|
||||
values[str(i)] = during and during[0] or 0.0
|
||||
if not float_is_zero(values[str(i)],
|
||||
precision_rounding=self.env.user.company_id.currency_id.rounding):
|
||||
at_least_one_amount = True
|
||||
values['total'] = sum([values['direction']] + [values[str(i)] for i in range(5)])
|
||||
## Add for total
|
||||
total[(i + 1)] += values['total']
|
||||
values['partner_id'] = partner['partner_id']
|
||||
if partner['partner_id']:
|
||||
browsed_partner = self.env['res.partner'].browse(partner['partner_id'])
|
||||
values['name'] = browsed_partner.name and len(
|
||||
browsed_partner.name) >= 45 and browsed_partner.name[
|
||||
0:40] + '...' or browsed_partner.name
|
||||
values['trust'] = browsed_partner.trust
|
||||
else:
|
||||
values['name'] = _('Unknown Partner')
|
||||
values['trust'] = False
|
||||
|
||||
if at_least_one_amount or (self.env.context.get('include_nullified_amount') and lines[partner['partner_id']]):
|
||||
res.append(values)
|
||||
|
||||
return res, total, lines
|
||||
|
||||
@api.model
|
||||
def _get_report_values(self, docids, data=None):
|
||||
if not data.get('form') or not self.env.context.get('active_model') or not self.env.context.get('active_id'):
|
||||
raise UserError(_("Form content is missing, this report cannot be printed."))
|
||||
|
||||
model = self.env.context.get('active_model')
|
||||
docs = self.env[model].browse(self.env.context.get('active_id'))
|
||||
|
||||
target_move = data['form'].get('target_move', 'all')
|
||||
date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d'))
|
||||
|
||||
if data['form']['result_selection'] == 'customer':
|
||||
account_type = ['asset_receivable']
|
||||
elif data['form']['result_selection'] == 'supplier':
|
||||
account_type = ['liability_payable']
|
||||
else:
|
||||
account_type = ['asset_receivable', 'liability_payable']
|
||||
partner_ids = data['form']['partner_ids']
|
||||
movelines, total, dummy = self._get_partner_move_lines(
|
||||
account_type, partner_ids, date_from, target_move, data['form']['period_length']
|
||||
)
|
||||
return {
|
||||
'doc_ids': self.ids,
|
||||
'doc_model': model,
|
||||
'data': data['form'],
|
||||
'docs': docs,
|
||||
'time': time,
|
||||
'get_partner_lines': movelines,
|
||||
'get_direction': total,
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_agedpartnerbalance">
|
||||
<t t-call="web.html_container">
|
||||
<t t-set="data_report_margin_top" t-value="12"/>
|
||||
<t t-set="data_report_header_spacing" t-value="9"/>
|
||||
<t t-set="data_report_dpi" t-value="110"/>
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2>Aged Partner Balance</h2>
|
||||
|
||||
<div class="row mt32">
|
||||
<div class="col-3">
|
||||
<strong>Start Date:</strong>
|
||||
<p t-esc="data['date_from']"/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Period Length (days)</strong>
|
||||
<p t-esc="data['period_length']"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb32">
|
||||
<div class="col-3">
|
||||
<strong>Partner's:</strong>
|
||||
<p>
|
||||
<span t-if="data['result_selection'] == 'customer'">Receivable Accounts</span>
|
||||
<span t-if="data['result_selection'] == 'supplier'">Payable Accounts</span>
|
||||
<span t-if="data['result_selection'] == 'customer_supplier'">Receivable and Payable Accounts</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Target Moves:</strong>
|
||||
<p>
|
||||
<span t-if="data['target_move'] == 'all'">All Entries</span>
|
||||
<span t-if="data['target_move'] == 'posted'">All Posted Entries</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-sm table-reports">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Partners</th>
|
||||
<th class="text-end">
|
||||
<span>Not due</span>
|
||||
</th>
|
||||
<th class="text-end"><span t-esc="data['4']['name']"/></th>
|
||||
<th class="text-end"><span t-esc="data['3']['name']"/></th>
|
||||
<th class="text-end"><span t-esc="data['2']['name']"/></th>
|
||||
<th class="text-end"><span t-esc="data['1']['name']"/></th>
|
||||
<th class="text-end"><span t-esc="data['0']['name']"/></th>
|
||||
<th class="text-end">Total</th>
|
||||
</tr>
|
||||
<tr t-if="get_partner_lines">
|
||||
<th>Account Total</th>
|
||||
<th class="text-end"><span t-esc="get_direction[6]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th>
|
||||
<th class="text-end"><span t-esc="get_direction[4]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th>
|
||||
<th class="text-end"><span t-esc="get_direction[3]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th>
|
||||
<th class="text-end"><span t-esc="get_direction[2]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th>
|
||||
<th class="text-end"><span t-esc="get_direction[1]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th>
|
||||
<th class="text-end"><span t-esc="get_direction[0]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th>
|
||||
<th class="text-end"><span t-esc="get_direction[5]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="get_partner_lines" t-as="partner">
|
||||
<td>
|
||||
<span t-esc="partner['name']"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="partner['direction']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="partner['4']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="partner['3']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="partner['2']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="partner['1']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="partner['0']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="partner['total']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -1,163 +0,0 @@
|
||||
import time
|
||||
from odoo import api, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ReportFinancial(models.AbstractModel):
|
||||
_name = 'report.accounting_pdf_reports.report_financial'
|
||||
_description = 'Financial Reports'
|
||||
|
||||
def _compute_account_balance(self, accounts):
|
||||
""" compute the balance, debit and credit for the provided accounts
|
||||
"""
|
||||
mapping = {
|
||||
'balance': "COALESCE(SUM(debit),0) - COALESCE(SUM(credit), 0) as balance",
|
||||
'debit': "COALESCE(SUM(debit), 0) as debit",
|
||||
'credit': "COALESCE(SUM(credit), 0) as credit",
|
||||
}
|
||||
|
||||
res = {}
|
||||
for account in accounts:
|
||||
res[account.id] = dict.fromkeys(mapping, 0.0)
|
||||
if accounts:
|
||||
tables, where_clause, where_params = self.env['account.move.line']._query_get()
|
||||
tables = tables.replace('"', '') if tables else "account_move_line"
|
||||
wheres = [""]
|
||||
if where_clause.strip():
|
||||
wheres.append(where_clause.strip())
|
||||
filters = " AND ".join(wheres)
|
||||
request = "SELECT account_id as id, " + ', '.join(mapping.values()) + \
|
||||
" FROM " + tables + \
|
||||
" WHERE account_id IN %s " \
|
||||
+ filters + \
|
||||
" GROUP BY account_id"
|
||||
params = (tuple(accounts._ids),) + tuple(where_params)
|
||||
self.env.cr.execute(request, params)
|
||||
for row in self.env.cr.dictfetchall():
|
||||
res[row['id']] = row
|
||||
return res
|
||||
|
||||
def _compute_report_balance(self, reports):
|
||||
'''returns a dictionary with key=the ID of a record and value=the credit, debit and balance amount
|
||||
computed for this record. If the record is of type :
|
||||
'accounts' : it's the sum of the linked accounts
|
||||
'account_type' : it's the sum of leaf accoutns with such an account_type
|
||||
'account_report' : it's the amount of the related report
|
||||
'sum' : it's the sum of the children of this record (aka a 'view' record)'''
|
||||
res = {}
|
||||
fields = ['credit', 'debit', 'balance']
|
||||
for report in reports:
|
||||
if report.id in res:
|
||||
continue
|
||||
res[report.id] = dict((fn, 0.0) for fn in fields)
|
||||
if report.type == 'accounts':
|
||||
# it's the sum of the linked accounts
|
||||
res[report.id]['account'] = self._compute_account_balance(report.account_ids)
|
||||
for value in res[report.id]['account'].values():
|
||||
for field in fields:
|
||||
res[report.id][field] += value.get(field)
|
||||
elif report.type == 'account_type':
|
||||
# it's the sum the leaf accounts with such an account type
|
||||
accounts = self.env['account.account'].search(
|
||||
[('account_type', 'in', report.account_type_ids.mapped('type'))])
|
||||
|
||||
res[report.id]['account'] = self._compute_account_balance(accounts)
|
||||
for value in res[report.id]['account'].values():
|
||||
for field in fields:
|
||||
res[report.id][field] += value.get(field)
|
||||
elif report.type == 'account_report' and report.account_report_id:
|
||||
# it's the amount of the linked report
|
||||
res2 = self._compute_report_balance(report.account_report_id)
|
||||
for key, value in res2.items():
|
||||
for field in fields:
|
||||
res[report.id][field] += value[field]
|
||||
elif report.type == 'sum':
|
||||
# it's the sum of the children of this account.report
|
||||
res2 = self._compute_report_balance(report.children_ids)
|
||||
for key, value in res2.items():
|
||||
for field in fields:
|
||||
res[report.id][field] += value[field]
|
||||
return res
|
||||
|
||||
def get_account_lines(self, data):
|
||||
lines = []
|
||||
account_report = self.env['account.financial.report'].search(
|
||||
[('id', '=', data['account_report_id'][0])])
|
||||
child_reports = account_report._get_children_by_order()
|
||||
res = self.with_context(data.get('used_context'))._compute_report_balance(child_reports)
|
||||
if data['enable_filter']:
|
||||
comparison_res = self.with_context(
|
||||
data.get('comparison_context'))._compute_report_balance(
|
||||
child_reports)
|
||||
for report_id, value in comparison_res.items():
|
||||
res[report_id]['comp_bal'] = value['balance']
|
||||
report_acc = res[report_id].get('account')
|
||||
if report_acc:
|
||||
for account_id, val in comparison_res[report_id].get('account').items():
|
||||
report_acc[account_id]['comp_bal'] = val['balance']
|
||||
for report in child_reports:
|
||||
vals = {
|
||||
'name': report.name,
|
||||
'balance': res[report.id]['balance'] * float(report.sign),
|
||||
'type': 'report',
|
||||
'level': bool(report.style_overwrite) and report.style_overwrite or report.level,
|
||||
'account_type': report.type or False, #used to underline the financial report balances
|
||||
}
|
||||
if data['debit_credit']:
|
||||
vals['debit'] = res[report.id]['debit']
|
||||
vals['credit'] = res[report.id]['credit']
|
||||
|
||||
if data['enable_filter']:
|
||||
vals['balance_cmp'] = res[report.id]['comp_bal'] * float(report.sign)
|
||||
|
||||
lines.append(vals)
|
||||
if report.display_detail == 'no_detail':
|
||||
#the rest of the loop is used to display the details of the financial report, so it's not needed here.
|
||||
continue
|
||||
if res[report.id].get('account'):
|
||||
sub_lines = []
|
||||
for account_id, value in res[report.id]['account'].items():
|
||||
#if there are accounts to display, we add them to the lines with a level equals to their level in
|
||||
#the COA + 1 (to avoid having them with a too low level that would conflicts with the level of data
|
||||
#financial reports for Assets, liabilities...)
|
||||
flag = False
|
||||
account = self.env['account.account'].browse(account_id)
|
||||
vals = {
|
||||
'name': account.code + ' ' + account.name,
|
||||
'balance': value['balance'] * float(report.sign) or 0.0,
|
||||
'type': 'account',
|
||||
'level': report.display_detail == 'detail_with_hierarchy' and 4,
|
||||
'account_type': account.account_type,
|
||||
}
|
||||
if data['debit_credit']:
|
||||
vals['debit'] = value['debit']
|
||||
vals['credit'] = value['credit']
|
||||
if not self.env.company.currency_id.is_zero(vals['debit']) or not self.env.company.currency_id.is_zero(vals['credit']):
|
||||
flag = True
|
||||
if not self.env.company.currency_id.is_zero(vals['balance']):
|
||||
flag = True
|
||||
if data['enable_filter']:
|
||||
vals['balance_cmp'] = value['comp_bal'] * float(report.sign)
|
||||
if not self.env.company.currency_id.is_zero(vals['balance_cmp']):
|
||||
flag = True
|
||||
if flag:
|
||||
sub_lines.append(vals)
|
||||
lines += sorted(sub_lines, key=lambda sub_line: sub_line['name'])
|
||||
return lines
|
||||
|
||||
@api.model
|
||||
def _get_report_values(self, docids, data=None):
|
||||
if not data.get('form') or not self.env.context.get('active_model') or not self.env.context.get('active_id'):
|
||||
raise UserError(_("Form content is missing, this report cannot be printed."))
|
||||
|
||||
model = self.env.context.get('active_model')
|
||||
docs = self.env[model].browse(self.env.context.get('active_id'))
|
||||
report_lines = self.get_account_lines(data.get('form'))
|
||||
return {
|
||||
'doc_ids': self.ids,
|
||||
'doc_model': model,
|
||||
'data': data['form'],
|
||||
'docs': docs,
|
||||
'time': time,
|
||||
'get_account_lines': report_lines,
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_financial">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2 t-esc="data['account_report_id'][1]"/>
|
||||
|
||||
<div class="row mt32 mb32">
|
||||
<div class="col-4">
|
||||
<strong>Target Moves:</strong>
|
||||
<p>
|
||||
<span t-if="data['target_move'] == 'all'">All Entries</span>
|
||||
<span t-if="data['target_move'] == 'posted'">All Posted Entries</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p>
|
||||
<t t-if="data['date_from']"><strong>Date from :</strong> <span t-esc="data['date_from']"/><br/></t>
|
||||
<t t-if="data['date_to']"><strong>Date to :</strong> <span t-esc="data['date_to']"/></t>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-sm table-reports" t-if="data['debit_credit'] == 1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th class="text-end">Debit</th>
|
||||
<th class="text-end">Credit</th>
|
||||
<th class="text-end">Balance</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="get_account_lines" t-as="a">
|
||||
<t t-if="a['level'] != 0">
|
||||
<t t-if="int(a.get('level')) > 3"><t t-set="style" t-value="'font-weight: normal;'"/></t>
|
||||
<t t-if="not int(a.get('level')) > 3"><t t-set="style" t-value="'font-weight: bold;'"/></t>
|
||||
|
||||
<td>
|
||||
<span style="color: white;" t-esc="'..' * int(a.get('level', 0))"/>
|
||||
<span t-att-style="style" t-esc="a.get('name')"/>
|
||||
</td>
|
||||
<td class="text-end" style="white-space: text-nowrap;">
|
||||
<span t-att-style="style" t-esc="a.get('debit')" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end" style="white-space: text-nowrap;">
|
||||
<span t-att-style="style" t-esc="a.get('credit')" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end" style="white-space: text-nowrap;">
|
||||
<span t-att-style="style" t-esc="a.get('balance')" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="table table-sm table-reports" t-if="not data['enable_filter'] and not data['debit_credit']">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th class="text-end">Balance</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="get_account_lines" t-as="a">
|
||||
<t t-if="a['level'] != 0">
|
||||
<t t-if="int(a.get('level')) > 3"><t t-set="style" t-value="'font-weight: normal;'"/></t>
|
||||
<t t-if="not int(a.get('level')) > 3"><t t-set="style" t-value="'font-weight: bold;'"/></t>
|
||||
|
||||
<td>
|
||||
<span style="color: white;" t-esc="'..' * int(a.get('level', 0))"/>
|
||||
<span t-att-style="style" t-esc="a.get('name')"/>
|
||||
</td>
|
||||
<td class="text-end"><span t-att-style="style" t-esc="a.get('balance')" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
|
||||
</t>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="table table-sm table-reports" t-if="data['enable_filter'] == 1 and not data['debit_credit']">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th class="text-end">Balance</th>
|
||||
<th class="text-end"><span t-esc="data['label_filter']"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="get_account_lines" t-as="a">
|
||||
<t t-if="a['level'] != 0">
|
||||
<t t-if="int(a.get('level')) > 3"><t t-set="style" t-value="'font-weight: normal;'"/></t>
|
||||
<t t-if="not int(a.get('level')) > 3"><t t-set="style" t-value="'font-weight: bold;'"/></t>
|
||||
<td>
|
||||
<span style="color: white;" t-esc="'..'"/>
|
||||
<span t-att-style="style" t-esc="a.get('name')"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-att-style="style" t-esc="a.get('balance')" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-att-style="style" t-esc="a.get('balance_cmp')" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -1,184 +0,0 @@
|
||||
import time
|
||||
from odoo import api, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ReportGeneralLedger(models.AbstractModel):
|
||||
_name = 'report.accounting_pdf_reports.report_general_ledger'
|
||||
_description = 'General Ledger Report'
|
||||
|
||||
def _get_account_move_entry(self, accounts, analytic_account_ids,
|
||||
partner_ids, init_balance,
|
||||
sortby, display_account):
|
||||
"""
|
||||
:param:
|
||||
accounts: the recordset of accounts
|
||||
analytic_account_ids: the recordset of analytic accounts
|
||||
init_balance: boolean value of initial_balance
|
||||
sortby: sorting by date or partner and journal
|
||||
display_account: type of account(receivable, payable and both)
|
||||
|
||||
Returns a dictionary of accounts with following key and value {
|
||||
'code': account code,
|
||||
'name': account name,
|
||||
'debit': sum of total debit amount,
|
||||
'credit': sum of total credit amount,
|
||||
'balance': total balance,
|
||||
'amount_currency': sum of amount_currency,
|
||||
'move_lines': list of move line
|
||||
}
|
||||
"""
|
||||
cr = self.env.cr
|
||||
MoveLine = self.env['account.move.line']
|
||||
move_lines = {x: [] for x in accounts.ids}
|
||||
|
||||
# Prepare initial sql query and Get the initial move lines
|
||||
if init_balance:
|
||||
context = dict(self.env.context)
|
||||
context['date_from'] = self.env.context.get('date_from')
|
||||
context['date_to'] = False
|
||||
context['initial_bal'] = True
|
||||
if analytic_account_ids:
|
||||
context['analytic_account_ids'] = analytic_account_ids
|
||||
if partner_ids:
|
||||
context['partner_ids'] = partner_ids
|
||||
init_tables, init_where_clause, init_where_params = MoveLine.with_context(context)._query_get()
|
||||
init_wheres = [""]
|
||||
if init_where_clause.strip():
|
||||
init_wheres.append(init_where_clause.strip())
|
||||
init_filters = " AND ".join(init_wheres)
|
||||
filters = init_filters.replace('account_move_line__move_id', 'm').replace('account_move_line', 'l')
|
||||
sql = ("""SELECT 0 AS lid, l.account_id AS account_id, '' AS ldate,
|
||||
'' AS lcode, 0.0 AS amount_currency,
|
||||
'' AS analytic_account_id, '' AS lref,
|
||||
'Initial Balance' AS lname, COALESCE(SUM(l.debit),0.0) AS debit,
|
||||
COALESCE(SUM(l.credit),0.0) AS credit,
|
||||
COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) as balance,
|
||||
'' AS lpartner_id,\
|
||||
'' AS move_name, '' AS move_id, '' AS currency_code,\
|
||||
NULL AS currency_id,\
|
||||
'' AS invoice_id, '' AS invoice_type, '' AS invoice_number,\
|
||||
'' AS partner_name\
|
||||
FROM account_move_line l\
|
||||
LEFT JOIN account_move m ON (l.move_id=m.id)\
|
||||
LEFT JOIN res_currency c ON (l.currency_id=c.id)\
|
||||
LEFT JOIN res_partner p ON (l.partner_id=p.id)\
|
||||
JOIN account_journal j ON (l.journal_id=j.id)\
|
||||
WHERE l.account_id IN %s""" + filters + ' GROUP BY l.account_id')
|
||||
params = (tuple(accounts.ids),) + tuple(init_where_params)
|
||||
cr.execute(sql, params)
|
||||
for row in cr.dictfetchall():
|
||||
move_lines[row.pop('account_id')].append(row)
|
||||
|
||||
sql_sort = 'l.date, l.move_id'
|
||||
if sortby == 'sort_journal_partner':
|
||||
sql_sort = 'j.code, p.name, l.move_id'
|
||||
|
||||
# Prepare sql query base on selected parameters from wizard
|
||||
context = dict(self.env.context)
|
||||
if analytic_account_ids:
|
||||
context['analytic_account_ids'] = analytic_account_ids
|
||||
if partner_ids:
|
||||
context['partner_ids'] = partner_ids
|
||||
tables, where_clause, where_params = MoveLine.with_context(context)._query_get()
|
||||
wheres = [""]
|
||||
if where_clause.strip():
|
||||
wheres.append(where_clause.strip())
|
||||
filters = " AND ".join(wheres)
|
||||
filters = filters.replace('account_move_line__move_id', 'm').replace('account_move_line', 'l')
|
||||
|
||||
# Get move lines base on sql query and Calculate the total balance of move lines
|
||||
sql = ('''SELECT l.id AS lid, l.account_id AS account_id,
|
||||
l.date AS ldate, j.code AS lcode, l.currency_id,
|
||||
l.amount_currency, '' AS analytic_account_id,
|
||||
l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit,
|
||||
COALESCE(l.credit,0) AS credit,
|
||||
COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) AS balance,\
|
||||
m.name AS move_name, c.symbol AS currency_code,
|
||||
p.name AS partner_name\
|
||||
FROM account_move_line l\
|
||||
JOIN account_move m ON (l.move_id=m.id)\
|
||||
LEFT JOIN res_currency c ON (l.currency_id=c.id)\
|
||||
LEFT JOIN res_partner p ON (l.partner_id=p.id)\
|
||||
JOIN account_journal j ON (l.journal_id=j.id)\
|
||||
JOIN account_account acc ON (l.account_id = acc.id) \
|
||||
WHERE l.account_id IN %s ''' + filters + ''' GROUP BY l.id,
|
||||
l.account_id, l.date, j.code, l.currency_id, l.amount_currency,
|
||||
l.ref, l.name, m.name, c.symbol, p.name ORDER BY ''' + sql_sort)
|
||||
params = (tuple(accounts.ids),) + tuple(where_params)
|
||||
cr.execute(sql, params)
|
||||
|
||||
for row in cr.dictfetchall():
|
||||
balance = 0
|
||||
for line in move_lines.get(row['account_id']):
|
||||
balance += line['debit'] - line['credit']
|
||||
row['balance'] += balance
|
||||
move_lines[row.pop('account_id')].append(row)
|
||||
|
||||
# Calculate the debit, credit and balance for Accounts
|
||||
account_res = []
|
||||
for account in accounts:
|
||||
currency = account.currency_id and account.currency_id or self.env.company.currency_id
|
||||
res = dict((fn, 0.0) for fn in ['credit', 'debit', 'balance'])
|
||||
res['code'] = account.code
|
||||
res['name'] = account.name
|
||||
res['move_lines'] = move_lines[account.id]
|
||||
for line in res.get('move_lines'):
|
||||
res['debit'] += line['debit']
|
||||
res['credit'] += line['credit']
|
||||
res['balance'] = line['balance']
|
||||
if display_account == 'all':
|
||||
account_res.append(res)
|
||||
if display_account == 'movement' and res.get('move_lines'):
|
||||
account_res.append(res)
|
||||
if display_account == 'not_zero' and not currency.is_zero(res['balance']):
|
||||
account_res.append(res)
|
||||
return account_res
|
||||
|
||||
@api.model
|
||||
def _get_report_values(self, docids, data=None):
|
||||
if not data.get('form') or not self.env.context.get('active_model'):
|
||||
raise UserError(_("Form content is missing, this report cannot be printed."))
|
||||
model = self.env.context.get('active_model')
|
||||
docs = self.env[model].browse(self.env.context.get('active_ids', []))
|
||||
init_balance = data['form'].get('initial_balance', True)
|
||||
sortby = data['form'].get('sortby', 'sort_date')
|
||||
display_account = data['form']['display_account']
|
||||
codes = []
|
||||
if data['form'].get('journal_ids', False):
|
||||
codes = [journal.code for journal in
|
||||
self.env['account.journal'].search(
|
||||
[('id', 'in', data['form']['journal_ids'])])]
|
||||
analytic_account_ids = False
|
||||
if data['form'].get('analytic_account_ids', False):
|
||||
analytic_account_ids = self.env['account.analytic.account'].search(
|
||||
[('id', 'in', data['form']['analytic_account_ids'])])
|
||||
partner_ids = False
|
||||
if data['form'].get('partner_ids', False):
|
||||
partner_ids = self.env['res.partner'].search(
|
||||
[('id', 'in', data['form']['partner_ids'])])
|
||||
if model == 'account.account':
|
||||
accounts = docs
|
||||
else:
|
||||
domain = []
|
||||
if data['form'].get('account_ids', False):
|
||||
domain.append(('id', 'in', data['form']['account_ids']))
|
||||
accounts = self.env['account.account'].search(domain)
|
||||
accounts_res = self.with_context(
|
||||
data['form'].get('used_context', {}))._get_account_move_entry(
|
||||
accounts,
|
||||
analytic_account_ids,
|
||||
partner_ids,
|
||||
init_balance, sortby, display_account)
|
||||
return {
|
||||
'doc_ids': docids,
|
||||
'doc_model': model,
|
||||
'data': data['form'],
|
||||
'docs': docs,
|
||||
'time': time,
|
||||
'Accounts': accounts_res,
|
||||
'print_journal': codes,
|
||||
'accounts': accounts,
|
||||
'partner_ids': partner_ids,
|
||||
'analytic_account_ids': analytic_account_ids,
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_general_ledger">
|
||||
<t t-call="web.html_container">
|
||||
<t t-set="data_report_margin_top" t-value="12"/>
|
||||
<t t-set="data_report_header_spacing" t-value="9"/>
|
||||
<t t-set="data_report_dpi" t-value="110"/>
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2><span t-esc="res_company.name"/>: General ledger</h2>
|
||||
|
||||
<div class="row mt32">
|
||||
<div class="col-4">
|
||||
<strong>Journals:</strong>
|
||||
<p t-esc="', '.join([ lt or '' for lt in print_journal ])"/>
|
||||
</div>
|
||||
<t groups="analytic.group_analytic_accounting">
|
||||
<t t-if="analytic_account_ids">
|
||||
<div class="col-4">
|
||||
<strong>Analytic Accounts:</strong>
|
||||
<p t-esc="', '.join([aa.name or '' for aa in analytic_account_ids ])"/>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
<div class="col-4">
|
||||
<strong>Display Account</strong>
|
||||
<p>
|
||||
<span t-if="data['display_account'] == 'all'">All accounts'</span>
|
||||
<span t-if="data['display_account'] == 'movement'">With movements</span>
|
||||
<span t-if="data['display_account'] == 'not_zero'">With balance not equal to zero</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<strong>Target Moves:</strong>
|
||||
<p t-if="data['target_move'] == 'all'">All Entries</p>
|
||||
<p t-if="data['target_move'] == 'posted'">All Posted Entries</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb32">
|
||||
<div class="col-4">
|
||||
<strong>Sorted By:</strong>
|
||||
<p t-if="data['sortby'] == 'sort_date'">Date</p>
|
||||
<p t-if="data['sortby'] == 'sort_journal_partner'">Journal and Partner</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<t t-if="data['date_from']"><strong>Date from :</strong> <span t-esc="data['date_from']"/><br/></t>
|
||||
<t t-if="data['date_to']"><strong>Date to :</strong> <span t-esc="data['date_to']"/></t>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-sm table-reports">
|
||||
<thead>
|
||||
<tr class="text-center">
|
||||
<th>Date</th>
|
||||
<th>JRNL</th>
|
||||
<th>Partner</th>
|
||||
<th>Ref</th>
|
||||
<th>Move</th>
|
||||
<t groups="analytic.group_analytic_accounting">
|
||||
<th>Analytic Account</th>
|
||||
</t>
|
||||
<th>Entry Label</th>
|
||||
<th>Debit</th>
|
||||
<th>Credit</th>
|
||||
<th>Balance</th>
|
||||
<th groups="base.group_multi_currency">Currency</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="Accounts" t-as="account">
|
||||
<tr style="font-weight: bold;">
|
||||
<td colspan="6">
|
||||
<span style="color: white;" t-esc="'..'"/>
|
||||
<span t-esc="account['code']"/>
|
||||
<span t-esc="account['name']"/>
|
||||
</td>
|
||||
<t groups="analytic.group_analytic_accounting">
|
||||
<td></td>
|
||||
</t>
|
||||
<td class="text-end">
|
||||
<span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td groups="base.group_multi_currency"/>
|
||||
</tr>
|
||||
<tr t-foreach="account['move_lines']" t-as="line">
|
||||
<td><span t-esc="line['ldate']"/></td>
|
||||
<td><span t-esc="line['lcode']"/></td>
|
||||
<td><span t-esc="line['partner_name']"/></td>
|
||||
<td><span t-if="line['lref']" t-esc="line['lref']"/></td>
|
||||
<td><span t-esc="line['move_name']"/></td>
|
||||
<t groups="analytic.group_analytic_accounting">
|
||||
<td><span t-esc="line['analytic_account_id']"/></td>
|
||||
</t>
|
||||
<td><span t-esc="line['lname']"/></td>
|
||||
<td class="text-end">
|
||||
<span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end" groups="base.group_multi_currency">
|
||||
<span t-esc="line['amount_currency'] if line['amount_currency'] and line['amount_currency'] > 0.00 else ''"/>
|
||||
<span t-esc="line['currency_code'] if line['amount_currency'] and line['amount_currency'] > 0.00 else ''"/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -1,117 +0,0 @@
|
||||
import time
|
||||
from odoo import api, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ReportJournal(models.AbstractModel):
|
||||
_name = 'report.accounting_pdf_reports.report_journal'
|
||||
_description = 'Journal Audit Report'
|
||||
|
||||
def lines(self, target_move, journal_ids, sort_selection, data):
|
||||
if isinstance(journal_ids, int):
|
||||
journal_ids = [journal_ids]
|
||||
|
||||
move_state = ['draft', 'posted']
|
||||
if target_move == 'posted':
|
||||
move_state = ['posted']
|
||||
|
||||
query_get_clause = self._get_query_get_clause(data)
|
||||
params = [tuple(move_state), tuple(journal_ids)] + query_get_clause[2]
|
||||
query = 'SELECT "account_move_line".id FROM ' + query_get_clause[0] + ', account_move am, account_account acc WHERE "account_move_line".account_id = acc.id AND "account_move_line".move_id=am.id AND am.state IN %s AND "account_move_line".journal_id IN %s AND ' + query_get_clause[1] + ' ORDER BY '
|
||||
if sort_selection == 'date':
|
||||
query += '"account_move_line".date'
|
||||
else:
|
||||
query += 'am.name'
|
||||
query += ', "account_move_line".move_id'
|
||||
self.env.cr.execute(query, tuple(params))
|
||||
ids = (x[0] for x in self.env.cr.fetchall())
|
||||
return self.env['account.move.line'].browse(ids)
|
||||
|
||||
def _sum_debit(self, data, journal_id):
|
||||
move_state = ['draft', 'posted']
|
||||
if data['form'].get('target_move', 'all') == 'posted':
|
||||
move_state = ['posted']
|
||||
|
||||
query_get_clause = self._get_query_get_clause(data)
|
||||
params = [tuple(move_state), tuple(journal_id.ids)] + query_get_clause[2]
|
||||
self.env.cr.execute('SELECT SUM(debit) FROM ' + query_get_clause[0] + ', account_move am '
|
||||
'WHERE "account_move_line".move_id=am.id AND am.state IN %s AND "account_move_line".journal_id IN %s AND ' + query_get_clause[1] + ' ',
|
||||
tuple(params))
|
||||
return self.env.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _sum_credit(self, data, journal_id):
|
||||
move_state = ['draft', 'posted']
|
||||
if data['form'].get('target_move', 'all') == 'posted':
|
||||
move_state = ['posted']
|
||||
|
||||
query_get_clause = self._get_query_get_clause(data)
|
||||
params = [tuple(move_state), tuple(journal_id.ids)] + query_get_clause[2]
|
||||
self.env.cr.execute('SELECT SUM(credit) FROM ' + query_get_clause[0] + ', account_move am '
|
||||
'WHERE "account_move_line".move_id=am.id AND am.state IN %s AND "account_move_line".journal_id IN %s AND ' + query_get_clause[1] + ' ',
|
||||
tuple(params))
|
||||
return self.env.cr.fetchone()[0] or 0.0
|
||||
|
||||
def _get_taxes(self, data, journal_id):
|
||||
move_state = ['draft', 'posted']
|
||||
if data['form'].get('target_move', 'all') == 'posted':
|
||||
move_state = ['posted']
|
||||
|
||||
query_get_clause = self._get_query_get_clause(data)
|
||||
params = [tuple(move_state), tuple(journal_id.ids)] + query_get_clause[2]
|
||||
query = """
|
||||
SELECT rel.account_tax_id, SUM("account_move_line".balance) AS base_amount
|
||||
FROM account_move_line_account_tax_rel rel, """ + query_get_clause[0] + """
|
||||
LEFT JOIN account_move am ON "account_move_line".move_id = am.id
|
||||
WHERE "account_move_line".id = rel.account_move_line_id
|
||||
AND am.state IN %s
|
||||
AND "account_move_line".journal_id IN %s
|
||||
AND """ + query_get_clause[1] + """
|
||||
GROUP BY rel.account_tax_id"""
|
||||
self.env.cr.execute(query, tuple(params))
|
||||
ids = []
|
||||
base_amounts = {}
|
||||
for row in self.env.cr.fetchall():
|
||||
ids.append(row[0])
|
||||
base_amounts[row[0]] = row[1]
|
||||
|
||||
|
||||
res = {}
|
||||
for tax in self.env['account.tax'].browse(ids):
|
||||
self.env.cr.execute('SELECT sum(debit - credit) FROM ' + query_get_clause[0] + ', account_move am '
|
||||
'WHERE "account_move_line".move_id=am.id AND am.state IN %s AND "account_move_line".journal_id IN %s AND ' + query_get_clause[1] + ' AND tax_line_id = %s',
|
||||
tuple(params + [tax.id]))
|
||||
res[tax] = {
|
||||
'base_amount': base_amounts[tax.id],
|
||||
'tax_amount': self.env.cr.fetchone()[0] or 0.0,
|
||||
}
|
||||
if journal_id.type == 'sale':
|
||||
#sales operation are credits
|
||||
res[tax]['base_amount'] = res[tax]['base_amount'] * -1
|
||||
res[tax]['tax_amount'] = res[tax]['tax_amount'] * -1
|
||||
return res
|
||||
|
||||
def _get_query_get_clause(self, data):
|
||||
return self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get()
|
||||
|
||||
@api.model
|
||||
def _get_report_values(self, docids, data=None):
|
||||
if not data.get('form'):
|
||||
raise UserError(_("Form content is missing, this report cannot be printed."))
|
||||
|
||||
target_move = data['form'].get('target_move', 'all')
|
||||
sort_selection = data['form'].get('sort_selection', 'date')
|
||||
|
||||
res = {}
|
||||
for journal in data['form']['journal_ids']:
|
||||
res[journal] = self.with_context(data['form'].get('used_context', {})).lines(target_move, journal, sort_selection, data)
|
||||
return {
|
||||
'doc_ids': data['form']['journal_ids'],
|
||||
'doc_model': self.env['account.journal'],
|
||||
'data': data,
|
||||
'docs': self.env['account.journal'].browse(data['form']['journal_ids']),
|
||||
'time': time,
|
||||
'lines': res,
|
||||
'sum_credit': self._sum_credit,
|
||||
'sum_debit': self._sum_debit,
|
||||
'get_taxes': self._get_taxes,
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_journal">
|
||||
<t t-call="web.html_container">
|
||||
<t t-set="data_report_margin_top" t-value="12"/>
|
||||
<t t-set="data_report_header_spacing" t-value="9"/>
|
||||
<t t-set="data_report_dpi" t-value="110"/>
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2><t t-esc="o.name"/> Journal</h2>
|
||||
|
||||
<div class="row mt32">
|
||||
<div class="col-3">
|
||||
<strong>Company:</strong>
|
||||
<p t-esc="res_company.name"/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Journal:</strong>
|
||||
<p t-esc="o.name"/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Entries Sorted By:</strong>
|
||||
<p t-if="data['form'].get('sort_selection') != 'l.date'">Journal Entry Number</p>
|
||||
<p t-if="data['form'].get('sort_selection') == 'l.date'">Date</p>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Target Moves:</strong>
|
||||
<p t-if="data['form']['target_move'] == 'all'">All Entries</p>
|
||||
<p t-if="data['form']['target_move'] == 'posted'">All Posted Entries</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-sm table-reports">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Move</th>
|
||||
<th>Date</th>
|
||||
<th>Account</th>
|
||||
<th>Partner</th>
|
||||
<th>Label</th>
|
||||
<th>Debit</th>
|
||||
<th>Credit</th>
|
||||
<th t-if="data['form']['amount_currency']">Currency</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="lines[o.id]" t-as="aml">
|
||||
<td><span t-esc="aml.move_id.name != '/' and aml.move_id.name or ('*'+str(aml.move_id.id))"/></td>
|
||||
<td><span t-field="aml.date"/></td>
|
||||
<td><span t-field="aml.account_id.code"/></td>
|
||||
<td><span t-esc="aml.sudo().partner_id and aml.sudo().partner_id.name and aml.sudo().partner_id.name[:23] or ''"/></td>
|
||||
<td><span t-esc="aml.name and aml.name[:35]"/></td>
|
||||
<td><span t-esc="aml.debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
|
||||
<td><span t-esc="aml.credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
|
||||
<td t-if="data['form']['amount_currency'] and aml.amount_currency">
|
||||
<span t-esc="aml.amount_currency" t-options="{'widget': 'monetary', 'display_currency': aml.currency_id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4 pull-right">
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>Total</strong></td>
|
||||
<td><span t-esc="sum_debit(data, o)" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
|
||||
<td><span t-esc="sum_credit(data, o)" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<table class="table table-sm table-reports">
|
||||
<thead>
|
||||
<tr><th colspan="3">Tax Declaration</th></tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Base Amount</th>
|
||||
<th>Tax Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-set="taxes" t-value="get_taxes(data, o)"/>
|
||||
<tr t-foreach="taxes" t-as="tax">
|
||||
<td><span t-esc="tax.name"/></td>
|
||||
<td><span t-esc="taxes[tax]['base_amount']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
|
||||
<td><span t-esc="taxes[tax]['tax_amount']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -1,108 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_journal_entries">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<div class="page" style="font-size:15px;">
|
||||
<div>
|
||||
<h3>
|
||||
<span t-field="o.name"/>
|
||||
</h3>
|
||||
</div>
|
||||
<br></br>
|
||||
<div class="row">
|
||||
<table width="100%" class="table-bordered">
|
||||
|
||||
<tr>
|
||||
<td>Journal:
|
||||
<span t-field="o.journal_id.name"/>
|
||||
</td>
|
||||
<td>
|
||||
Date:
|
||||
<span t-field="o.date" t-options="{'widget': 'date'}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Partner:
|
||||
<span t-field="o.partner_id.display_name"/>
|
||||
</td>
|
||||
<td>
|
||||
Reference:
|
||||
<span t-field="o.ref"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<br></br>
|
||||
<table width="100%" class="table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Account</th>
|
||||
<th>Date</th>
|
||||
<th>Partner</th>
|
||||
<th>Label</th>
|
||||
<th>Analytic Account</th>
|
||||
<th>Debit</th>
|
||||
<th>Credit</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-set="total_credit" t-value="0"/>
|
||||
<t t-set="total_debit" t-value="0"/>
|
||||
<t t-foreach="o.line_ids" t-as="line">
|
||||
<tr>
|
||||
<td>
|
||||
<span t-field="line.account_id.name"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-field="line.date" t-options="{'widget': 'date'}"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-field="line.partner_id.display_name"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-field="line.name"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-field="line.analytic_account_id.display_name"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-field="line.debit"
|
||||
t-options="{'widget': 'monetary', 'display_currency': line.currency_id}"/>
|
||||
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-field="line.credit"
|
||||
t-options="{'widget': 'monetary', 'display_currency': line.currency_id}"/>
|
||||
</td>
|
||||
<t t-set="total_credit" t-value="total_credit + line.credit"/>
|
||||
<t t-set="total_debit" t-value="total_debit + line.debit"/>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
<tfooter>
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
<td class="text-end">
|
||||
<span t-esc="total_debit"
|
||||
t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="total_credit"
|
||||
t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tfooter>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -1,122 +0,0 @@
|
||||
import time
|
||||
from odoo import api, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ReportPartnerLedger(models.AbstractModel):
|
||||
_name = 'report.accounting_pdf_reports.report_partnerledger'
|
||||
_description = 'Partner Ledger Report'
|
||||
|
||||
def _lines(self, data, partner):
|
||||
full_account = []
|
||||
currency = self.env['res.currency']
|
||||
query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get()
|
||||
reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL '
|
||||
params = [partner.id, tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2]
|
||||
query = """
|
||||
SELECT "account_move_line".id, "account_move_line".date, j.code, acc.name->>'en_US' as a_name, "account_move_line".ref, m.name as move_name, "account_move_line".name, "account_move_line".debit, "account_move_line".credit, "account_move_line".amount_currency,"account_move_line".currency_id, c.symbol AS currency_code
|
||||
FROM """ + query_get_data[0] + """
|
||||
LEFT JOIN account_journal j ON ("account_move_line".journal_id = j.id)
|
||||
LEFT JOIN account_account acc ON ("account_move_line".account_id = acc.id)
|
||||
LEFT JOIN res_currency c ON ("account_move_line".currency_id=c.id)
|
||||
LEFT JOIN account_move m ON (m.id="account_move_line".move_id)
|
||||
WHERE "account_move_line".partner_id = %s
|
||||
AND m.state IN %s
|
||||
AND "account_move_line".account_id IN %s AND """ + query_get_data[1] + reconcile_clause + """
|
||||
ORDER BY "account_move_line".date"""
|
||||
self.env.cr.execute(query, tuple(params))
|
||||
res = self.env.cr.dictfetchall()
|
||||
sum = 0.0
|
||||
lang_code = self.env.context.get('lang') or 'en_US'
|
||||
lang = self.env['res.lang']
|
||||
lang_id = lang._lang_get(lang_code)
|
||||
date_format = lang_id.date_format
|
||||
for r in res:
|
||||
r['date'] = r['date']
|
||||
r['displayed_name'] = '-'.join(
|
||||
r[field_name] for field_name in ('move_name', 'ref', 'name')
|
||||
if r[field_name] not in (None, '', '/')
|
||||
)
|
||||
sum += r['debit'] - r['credit']
|
||||
r['progress'] = sum
|
||||
r['currency_id'] = currency.browse(r.get('currency_id'))
|
||||
full_account.append(r)
|
||||
return full_account
|
||||
|
||||
def _sum_partner(self, data, partner, field):
|
||||
if field not in ['debit', 'credit', 'debit - credit']:
|
||||
return
|
||||
result = 0.0
|
||||
query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get()
|
||||
reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL '
|
||||
|
||||
params = [partner.id, tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2]
|
||||
query = """SELECT sum(""" + field + """)
|
||||
FROM """ + query_get_data[0] + """, account_move AS m
|
||||
WHERE "account_move_line".partner_id = %s
|
||||
AND m.id = "account_move_line".move_id
|
||||
AND m.state IN %s
|
||||
AND account_id IN %s
|
||||
AND """ + query_get_data[1] + reconcile_clause
|
||||
self.env.cr.execute(query, tuple(params))
|
||||
|
||||
contemp = self.env.cr.fetchone()
|
||||
if contemp is not None:
|
||||
result = contemp[0] or 0.0
|
||||
return result
|
||||
|
||||
@api.model
|
||||
def _get_report_values(self, docids, data=None):
|
||||
if not data.get('form'):
|
||||
raise UserError(_("Form content is missing, this report cannot be printed."))
|
||||
data['computed'] = {}
|
||||
|
||||
obj_partner = self.env['res.partner']
|
||||
query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get()
|
||||
data['computed']['move_state'] = ['draft', 'posted']
|
||||
if data['form'].get('target_move', 'all') == 'posted':
|
||||
data['computed']['move_state'] = ['posted']
|
||||
result_selection = data['form'].get('result_selection', 'customer')
|
||||
if result_selection == 'supplier':
|
||||
data['computed']['ACCOUNT_TYPE'] = ['liability_payable']
|
||||
elif result_selection == 'customer':
|
||||
data['computed']['ACCOUNT_TYPE'] = ['asset_receivable']
|
||||
else:
|
||||
data['computed']['ACCOUNT_TYPE'] = ['asset_receivable', 'liability_payable']
|
||||
|
||||
self.env.cr.execute("""
|
||||
SELECT a.id
|
||||
FROM account_account a
|
||||
WHERE a.account_type IN %s
|
||||
AND a.active""", (tuple(data['computed']['ACCOUNT_TYPE']),))
|
||||
data['computed']['account_ids'] = [a for (a,) in self.env.cr.fetchall()]
|
||||
params = [tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2]
|
||||
reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL '
|
||||
query = """
|
||||
SELECT DISTINCT "account_move_line".partner_id
|
||||
FROM """ + query_get_data[0] + """, account_account AS account, account_move AS am
|
||||
WHERE "account_move_line".partner_id IS NOT NULL
|
||||
AND "account_move_line".account_id = account.id
|
||||
AND am.id = "account_move_line".move_id
|
||||
AND am.state IN %s
|
||||
AND "account_move_line".account_id IN %s
|
||||
AND account.active
|
||||
AND """ + query_get_data[1] + reconcile_clause
|
||||
self.env.cr.execute(query, tuple(params))
|
||||
if data['form']['partner_ids']:
|
||||
partner_ids = data['form']['partner_ids']
|
||||
else:
|
||||
partner_ids = [res['partner_id'] for res in
|
||||
self.env.cr.dictfetchall()]
|
||||
partners = obj_partner.browse(partner_ids)
|
||||
partners = sorted(partners, key=lambda x: (x.ref or '', x.name or ''))
|
||||
|
||||
return {
|
||||
'doc_ids': partner_ids,
|
||||
'doc_model': self.env['res.partner'],
|
||||
'data': data,
|
||||
'docs': partners,
|
||||
'time': time,
|
||||
'lines': self._lines,
|
||||
'sum_partner': self._sum_partner,
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_partnerledger">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.internal_layout">
|
||||
<t t-set="data_report_margin_top" t-value="12"/>
|
||||
<t t-set="data_report_header_spacing" t-value="9"/>
|
||||
<t t-set="data_report_dpi" t-value="110"/>
|
||||
<div class="page">
|
||||
<h2>Partner Ledger</h2>
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<strong>Company:</strong>
|
||||
<p t-esc="res_company.name"/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<t t-if="data['form']['date_from']">
|
||||
<strong>Date from :</strong>
|
||||
<span t-esc="data['form']['date_from']"/>
|
||||
<br/>
|
||||
</t>
|
||||
<t t-if="data['form']['date_to']">
|
||||
<strong>Date to :</strong>
|
||||
<span t-esc="data['form']['date_to']"/>
|
||||
</t>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Target Moves:</strong>
|
||||
<p t-if="data['form']['target_move'] == 'all'">All Entries</p>
|
||||
<p t-if="data['form']['target_move'] == 'posted'">All Posted Entries</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-sm table-reports">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>JRNL</th>
|
||||
<th>Account</th>
|
||||
<th>Ref</th>
|
||||
<th>Debit</th>
|
||||
<th>Credit</th>
|
||||
<th>Balance</th>
|
||||
<th t-if="data['form']['amount_currency']">Currency</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<strong t-esc="o.ref"/>
|
||||
-
|
||||
<strong t-esc="o.name"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<strong t-esc="sum_partner(data, o, 'debit')"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<strong t-esc="sum_partner(data, o, 'credit')"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<strong t-esc="sum_partner(data, o, 'debit - credit')"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr t-foreach="lines(data, o)" t-as="line">
|
||||
<td>
|
||||
<span t-esc="line['date']"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-esc="line['code']"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-esc="line['a_name']"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-esc="line['displayed_name']"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="line['debit']"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="line['credit']"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-esc="line['progress']"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end" t-if="data['form']['amount_currency']">
|
||||
<t t-if="line['currency_id']">
|
||||
<span t-esc="line['amount_currency']"
|
||||
t-options="{'widget': 'monetary', 'display_currency': line['currency_id']}"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</t>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -1,70 +0,0 @@
|
||||
from odoo import api, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ReportTax(models.AbstractModel):
|
||||
_name = 'report.accounting_pdf_reports.report_tax'
|
||||
_description = 'Tax Report'
|
||||
|
||||
@api.model
|
||||
def _get_report_values(self, docids, data=None):
|
||||
if not data.get('form'):
|
||||
raise UserError(_("Form content is missing, this report cannot be printed."))
|
||||
return {
|
||||
'data': data['form'],
|
||||
'lines': self.get_lines(data.get('form')),
|
||||
}
|
||||
|
||||
def _sql_from_amls_one(self):
|
||||
sql = """SELECT "account_move_line".tax_line_id, COALESCE(SUM("account_move_line".debit-"account_move_line".credit), 0)
|
||||
FROM %s
|
||||
WHERE %s GROUP BY "account_move_line".tax_line_id"""
|
||||
return sql
|
||||
|
||||
def _sql_from_amls_two(self):
|
||||
sql = """SELECT r.account_tax_id, COALESCE(SUM("account_move_line".debit-"account_move_line".credit), 0)
|
||||
FROM %s
|
||||
INNER JOIN account_move_line_account_tax_rel r ON ("account_move_line".id = r.account_move_line_id)
|
||||
INNER JOIN account_tax t ON (r.account_tax_id = t.id)
|
||||
WHERE %s GROUP BY r.account_tax_id"""
|
||||
return sql
|
||||
|
||||
def _compute_from_amls(self, options, taxes):
|
||||
#compute the tax amount
|
||||
sql = self._sql_from_amls_one()
|
||||
tables, where_clause, where_params = self.env['account.move.line']._query_get()
|
||||
query = sql % (tables, where_clause)
|
||||
self.env.cr.execute(query, where_params)
|
||||
results = self.env.cr.fetchall()
|
||||
for result in results:
|
||||
if result[0] in taxes:
|
||||
taxes[result[0]]['tax'] = abs(result[1])
|
||||
|
||||
#compute the net amount
|
||||
sql2 = self._sql_from_amls_two()
|
||||
query = sql2 % (tables, where_clause)
|
||||
self.env.cr.execute(query, where_params)
|
||||
results = self.env.cr.fetchall()
|
||||
for result in results:
|
||||
if result[0] in taxes:
|
||||
taxes[result[0]]['net'] = abs(result[1])
|
||||
|
||||
@api.model
|
||||
def get_lines(self, options):
|
||||
taxes = {}
|
||||
for tax in self.env['account.tax'].search([('type_tax_use', '!=', 'none')]):
|
||||
if tax.children_tax_ids:
|
||||
for child in tax.children_tax_ids:
|
||||
if child.type_tax_use != 'none':
|
||||
continue
|
||||
taxes[child.id] = {'tax': 0, 'net': 0, 'name': child.name, 'type': tax.type_tax_use}
|
||||
else:
|
||||
taxes[tax.id] = {'tax': 0, 'net': 0, 'name': tax.name, 'type': tax.type_tax_use}
|
||||
self.with_context(date_from=options['date_from'], date_to=options['date_to'],
|
||||
state=options['target_move'],
|
||||
strict_range=True)._compute_from_amls(options, taxes)
|
||||
groups = dict((tp, []) for tp in ['sale', 'purchase'])
|
||||
for tax in taxes.values():
|
||||
if tax['tax']:
|
||||
groups[tax['type']].append(tax)
|
||||
return groups
|
||||
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_tax">
|
||||
<t t-call="web.html_container">
|
||||
<t t-set="data_report_margin_top" t-value="12"/>
|
||||
<t t-set="data_report_header_spacing" t-value="9"/>
|
||||
<t t-set="data_report_dpi" t-value="110"/>
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h3>Tax Report</h3>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<strong>Company:</strong>
|
||||
<p t-esc="res_company.name"/>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<t>
|
||||
<strong>Date from :</strong>
|
||||
<span t-esc="data['date_from']"/>
|
||||
</t>
|
||||
<br/>
|
||||
<t>
|
||||
<strong>Date to :</strong>
|
||||
<span t-esc="data['date_to']"/>
|
||||
</t>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<strong>Target Moves:</strong>
|
||||
<p>
|
||||
<span t-if="data['target_move'] == 'all'">All Entries</span>
|
||||
<span t-if="data['target_move'] == 'posted'">All Posted Entries</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<table class="table table-sm table-reports">
|
||||
<thead>
|
||||
<tr align="left">
|
||||
<th>Sale</th>
|
||||
<th>Net</th>
|
||||
<th>Tax</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr align="left" t-foreach="lines['sale']" t-as="line">
|
||||
<td>
|
||||
<span t-esc="line.get('name')"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-att-style="style" t-esc="line.get('net')"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-att-style="style" t-esc="line.get('tax')"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<br/>
|
||||
<tr align="left">
|
||||
<td>
|
||||
<strong>Purchase</strong>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr align="left" t-foreach="lines['purchase']" t-as="line">
|
||||
<td>
|
||||
<span t-esc="line.get('name')"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-att-style="style" t-esc="line.get('net')"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-att-style="style" t-esc="line.get('tax')"
|
||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -1,90 +0,0 @@
|
||||
import time
|
||||
from odoo import api, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ReportTrialBalance(models.AbstractModel):
|
||||
_name = 'report.accounting_pdf_reports.report_trialbalance'
|
||||
_description = 'Trial Balance Report'
|
||||
|
||||
def _get_accounts(self, accounts, display_account):
|
||||
""" compute the balance, debit and credit for the provided accounts
|
||||
:Arguments:
|
||||
`accounts`: list of accounts record,
|
||||
`display_account`: it's used to display either all accounts or those accounts which balance is > 0
|
||||
:Returns a list of dictionary of Accounts with following key and value
|
||||
`name`: Account name,
|
||||
`code`: Account code,
|
||||
`credit`: total amount of credit,
|
||||
`debit`: total amount of debit,
|
||||
`balance`: total amount of balance,
|
||||
"""
|
||||
|
||||
account_result = {}
|
||||
# Prepare sql query base on selected parameters from wizard
|
||||
tables, where_clause, where_params = self.env['account.move.line']._query_get()
|
||||
tables = tables.replace('"','')
|
||||
if not tables:
|
||||
tables = 'account_move_line'
|
||||
wheres = [""]
|
||||
if where_clause.strip():
|
||||
wheres.append(where_clause.strip())
|
||||
filters = " AND ".join(wheres)
|
||||
# compute the balance, debit and credit for the provided accounts
|
||||
request = ("SELECT account_id AS id, SUM(debit) AS debit, SUM(credit) AS credit, "
|
||||
"(SUM(debit) - SUM(credit)) AS balance" +\
|
||||
" FROM " + tables + " WHERE account_id IN %s " + filters + " GROUP BY account_id")
|
||||
params = (tuple(accounts.ids),) + tuple(where_params)
|
||||
self.env.cr.execute(request, params)
|
||||
for row in self.env.cr.dictfetchall():
|
||||
account_result[row.pop('id')] = row
|
||||
|
||||
account_res = []
|
||||
for account in accounts:
|
||||
res = dict((fn, 0.0) for fn in ['credit', 'debit', 'balance'])
|
||||
currency = account.currency_id and account.currency_id or self.env.company.currency_id
|
||||
res['code'] = account.code
|
||||
res['name'] = account.name
|
||||
if account.id in account_result:
|
||||
res['debit'] = account_result[account.id].get('debit')
|
||||
res['credit'] = account_result[account.id].get('credit')
|
||||
res['balance'] = account_result[account.id].get('balance')
|
||||
if display_account == 'all':
|
||||
account_res.append(res)
|
||||
if display_account == 'not_zero' and not currency.is_zero(res['balance']):
|
||||
account_res.append(res)
|
||||
if display_account == 'movement' and (not currency.is_zero(res['debit']) or not currency.is_zero(res['credit'])):
|
||||
account_res.append(res)
|
||||
return account_res
|
||||
|
||||
@api.model
|
||||
def _get_report_values(self, docids, data=None):
|
||||
if not data.get('form') or not self.env.context.get('active_model'):
|
||||
raise UserError(_("Form content is missing, this report cannot be printed."))
|
||||
|
||||
model = self.env.context.get('active_model')
|
||||
docs = self.env[model].browse(self.env.context.get('active_ids', []))
|
||||
display_account = data['form'].get('display_account')
|
||||
accounts = docs if model == 'account.account' else self.env['account.account'].search([])
|
||||
context = data['form'].get('used_context')
|
||||
analytic_accounts = []
|
||||
if data['form'].get('analytic_account_ids'):
|
||||
analytic_account_ids = self.env['account.analytic.account'].browse(data['form'].get('analytic_account_ids'))
|
||||
context['analytic_account_ids'] = analytic_account_ids
|
||||
analytic_accounts = [account.name for account in analytic_account_ids]
|
||||
account_res = self.with_context(context)._get_accounts(accounts, display_account)
|
||||
codes = []
|
||||
if data['form'].get('journal_ids', False):
|
||||
codes = [journal.code for journal in
|
||||
self.env['account.journal'].search(
|
||||
[('id', 'in', data['form']['journal_ids'])])]
|
||||
return {
|
||||
'doc_ids': self.ids,
|
||||
'doc_model': model,
|
||||
'data': data['form'],
|
||||
'docs': docs,
|
||||
'print_journal': codes,
|
||||
'analytic_accounts': analytic_accounts,
|
||||
'time': time,
|
||||
'Accounts': account_res,
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_trialbalance">
|
||||
<t t-call="web.html_container">
|
||||
<t t-set="data_report_margin_top" t-value="12"/>
|
||||
<t t-set="data_report_header_spacing" t-value="9"/>
|
||||
<t t-set="data_report_dpi" t-value="110"/>
|
||||
<t t-call="web.internal_layout">
|
||||
<div class="page">
|
||||
<h2><span t-esc="res_company.name"/>: Trial Balance</h2>
|
||||
|
||||
<div class="row mt32">
|
||||
<div class="col-4">
|
||||
<strong>Display Account:</strong>
|
||||
<p>
|
||||
<span t-if="data['display_account'] == 'all'">All accounts</span>
|
||||
<span t-if="data['display_account'] == 'movement'">With movements</span>
|
||||
<span t-if="data['display_account'] == 'not_zero'">With balance not equal to zero</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<p>
|
||||
<t t-if="data['date_from']"><strong>Date from :</strong> <span t-esc="data['date_from']"/><br/></t>
|
||||
<t t-if="data['date_to']"><strong>Date to :</strong> <span t-esc="data['date_to']"/></t>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<strong>Target Moves:</strong>
|
||||
<p>
|
||||
<span t-if="data['target_move'] == 'all'">All Entries</span>
|
||||
<span t-if="data['target_move'] == 'posted'">All Posted Entries</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt32">
|
||||
<div class="col-6">
|
||||
<strong>Journals:</strong>
|
||||
<p t-esc="', '.join([ lt or '' for lt in print_journal ])"/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<t t-if="analytic_accounts">
|
||||
<strong>Analytic Accounts:</strong>
|
||||
<p t-esc="', '.join([ analytic_account or '' for analytic_account in analytic_accounts ])"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-sm table-reports">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Code</th>
|
||||
<th>Account</th>
|
||||
<th class="text-end">Debit</th>
|
||||
<th class="text-end">Credit</th>
|
||||
<th class="text-end">Balance</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="Accounts" t-as="account">
|
||||
<td>
|
||||
<span t-att-style="style" t-esc="account['code']"/>
|
||||
</td>
|
||||
<td>
|
||||
<span style="color: white;" t-esc="'..'"/>
|
||||
<span t-att-style="style" t-esc="account['name']"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-att-style="style" t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-att-style="style" t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<span t-att-style="style" t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
@@ -1,25 +0,0 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_account_financial_report_accountant,access.account.financial.report.manager,model_account_financial_report,account.group_account_user,1,1,1,1
|
||||
access_account_report_general_ledger,access.account.report.general.ledger,model_account_report_general_ledger,account.group_account_user,1,1,1,1
|
||||
access_account_balance_report,access.account.balance.report,model_account_balance_report,account.group_account_user,1,1,1,1
|
||||
access_account_report_partner_ledger,access.account.report.partner.ledger,model_account_report_partner_ledger,account.group_account_invoice,1,1,1,1
|
||||
access_accounting_report,access.accounting.report,model_accounting_report,account.group_account_user,1,1,1,1
|
||||
access_account_aged_trial_balance,access.account.aged.trial.balance,model_account_aged_trial_balance,account.group_account_user,1,1,1,1
|
||||
access_account_tax_report,access.account.tax.report.wizard,model_account_tax_report_wizard,account.group_account_user,1,1,1,1
|
||||
|
||||
access_account_financial_report_accountant_bm,access.account.financial.report.bmanager,model_account_financial_report,account.group_account_manager,1,1,1,1
|
||||
access_account_report_general_ledger_bm,access.account.report.general.ledger.bmanager,model_account_report_general_ledger,account.group_account_manager,1,1,1,1
|
||||
access_account_balance_report_bm,access.account.balance.report.bmanager,model_account_balance_report,account.group_account_manager,1,1,1,1
|
||||
access_account_report_partner_ledger_bm,access.account.report.partner.ledger.bmanager,model_account_report_partner_ledger,account.group_account_manager,1,1,1,1
|
||||
access_accounting_report_bm,access.accounting.report.bmanager,model_accounting_report,account.group_account_manager,1,1,1,1
|
||||
access_account_aged_trial_balance_bm,access.account.aged.trial.balance.bmanager,model_account_aged_trial_balance,account.group_account_manager,1,1,1,1
|
||||
access_account_tax_report_bm,access.account.tax.report.wizard.bmanager,model_account_tax_report_wizard,account.group_account_manager,1,1,1,1
|
||||
access_account_print_journal_bm,access.account.account.print.journal.bmanager,model_account_print_journal,account.group_account_manager,1,1,1,1
|
||||
|
||||
access_account_common_journal_report,access.account.common.journal.report,model_account_common_journal_report,account.group_account_user,1,1,1,0
|
||||
access_account_print_journal,access.account.print.journal,model_account_print_journal,account.group_account_user,1,1,1,0
|
||||
|
||||
access_account_common_account_report,access_account_common_account_report,model_account_common_account_report,base.group_user,1,0,0,0
|
||||
access_account_common_partner_report,access_account_common_partner_report,model_account_common_partner_report,base.group_user,1,0,0,0
|
||||
access_account_common_report,access_account_common_report,accounting_pdf_reports.model_account_common_report,base.group_user,1,0,0,0
|
||||
access_account_account_type,access_account_account_type,accounting_pdf_reports.model_account_account_type,base.group_user,1,0,0,0
|
||||
|
|
Before Width: | Height: | Size: 218 KiB |
|
Before Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 911 KiB |
|
Before Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,155 +0,0 @@
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="col-md-12">
|
||||
<h2 class="oe_slogan" style="font-size: 35px;color:#2C0091"><b>Accounting Reports Odoo 18</b></h2>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div style="align:center;">
|
||||
<h1 style="text-align: center;">
|
||||
<span align="center" style="color:#148963;">
|
||||
<span class="fa fa-star fa-spin">
|
||||
</span>
|
||||
Added Financial Reports:</span>
|
||||
</h1>
|
||||
<div class="row" style="margin-top: 2rem;">
|
||||
<div class="col-lg-12">
|
||||
<div class="mt-3">
|
||||
<p class="fa fa-check" style="color:green;font-size: 15px;">
|
||||
<span style="color:#000000;font-size: 15px;">Partner Ledger Report.</span>
|
||||
</p><br/>
|
||||
<p class="fa fa-check" style="color:green;font-size: 15px;">
|
||||
<span style="color:#000000;font-size: 15px;">Journals Audit.</span>
|
||||
</p><br/>
|
||||
<p class="fa fa-check" style="color:green;font-size: 15px;">
|
||||
<span style="color:#000000;font-size: 15px;">General Ledger.</span>
|
||||
</p><br/>
|
||||
<p class="fa fa-check" style="color:green;font-size: 15px;">
|
||||
<span style="color:#000000;font-size: 15px;">Trial Balance.</span>
|
||||
</p><br/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="mt-3">
|
||||
<p class="fa fa-check" style="color:green;font-size: 15px;">
|
||||
<span style="color:#000000;font-size: 15px;">Aged Partner Balance.</span>
|
||||
</p><br/>
|
||||
<p class="fa fa-check" style="color:green;font-size: 15px;">
|
||||
<span style="color:#000000;font-size: 15px;">Profit and Loss.</span>
|
||||
</p><br/>
|
||||
<p class="fa fa-check" style="color:green;font-size: 15px;">
|
||||
<span style="color:#000000;font-size: 15px;">Balance Sheet.</span>
|
||||
</p><br/>
|
||||
<p class="fa fa-check" style="color:green;font-size: 15px;">
|
||||
<span style="color:#000000;font-size: 15px;">Tax Report.</span>
|
||||
</p><br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
</section>
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_centeralign oe_websiteonly">
|
||||
<h4 class="oe_slogan"><a href="https://www.youtube.com/watch?v=yA4NLwOLZms" target="_blank" style="color: #FFFFFF !important; border-radius: 0; background-color: #9c676e; border-color: #005ca7; padding: 15px; font-weight: bold;">
|
||||
<i class="fa fa-youtube">
|
||||
Watch on YouTube
|
||||
</i>
|
||||
</a></h4>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="oe_slogan" style="color:olive;">Accounting Reports</h2>
|
||||
<h3 class="oe_slogan" style="color:#000066;font-size: 24px;">All in one financial reports for odoo community edition</h3>
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_reports.png" style="height:400px;">
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h3 class="oe_slogan" style="color:#332c3c;font-size: 28px;">General Ledger</h3>
|
||||
<h3 class="oe_slogan" style="color:#000066;font-size: 24px;">General ledger report with accounts, partners and analytic account filter</h3>
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="general_ledger_filter.png" style="height:400px;">
|
||||
</div>
|
||||
<br/>
|
||||
<h4 class="oe_slogan" style="color:#332c3c;font-size: 28px;">Report</h4>
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="general_ledger_report.png" style="height:400px;">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h3 class="oe_slogan" style="color:#1b1d26;">Partner Ledger</h3>
|
||||
<h3 class="oe_slogan" style="color:#000066;font-size: 24px;">Partner ledger report with partner filter.</h3>
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="partner_ledger_filter.png" style="height:400px;">
|
||||
</div>
|
||||
<br/>
|
||||
<h4 class="oe_slogan" style="color:#332c3c;font-size: 28px;">Report</h4>
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="partner_ledger_report.png" style="height:400px;">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h3 class="oe_slogan" style="color:#1b1d26;">Aged Partner Balance</h3>
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="aged_partner_balance_filter.png" style="height:400px;">
|
||||
</div>
|
||||
<br/>
|
||||
<h4 class="oe_slogan" style="color:#332c3c;font-size: 28px;">Report</h4>
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="aged_partner_balance_report.png" style="height:400px;">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<br/>
|
||||
|
||||
<hr style="width: 100%;height: 4px;background: #2C0091;margin: 0px 0px;">
|
||||
<hr style="width: 100%;height: 4px;background: #148963;margin: 0px 0px;">
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row ">
|
||||
<div class="oe_slogan text-center">
|
||||
<img src="odoo_mates.png"/>
|
||||
<div style="color:#269900;">
|
||||
<h3 style="color:#2C0091;font-size: 25px;">If you need any support or want more features, just contact us:</h3><br>
|
||||
<h3 style="color:#2C0091;font-size: 20px;">Email: <a href="odoomates@gmail.com">odoomates@gmail.com</a> <br></h3>
|
||||
</div>
|
||||
<div class="oe_slogan">
|
||||
<h2>
|
||||
<a target="_blank" href="https://www.facebook.com/odoomate/" target="new">
|
||||
<i class="fa fa-facebook-square" style="font-size:38px;"></i>
|
||||
</a>
|
||||
<a target="_blank" href="https://twitter.com/odoomates/" target="new">
|
||||
<i class="fa fa-twitter" style="font-size:38px;"></i>
|
||||
</a>
|
||||
<a href="#" target="_blank">
|
||||
<i class="fa fa-linkedin" style="font-size:38px;"></i>
|
||||
</a>
|
||||
<a target="_blank" href="https://www.youtube.com/channel/UCVKlUZP7HAhdQgs-9iTJklQ">
|
||||
<i class="fa fa-youtube-play" style="font-size:38px;"></i>
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<hr style="width: 100%;height: 4px;background: #148963;margin: 0px 0px;">
|
||||
<hr style="width: 100%;height: 4px;background: #2C0091;margin: 0px 0px;">
|
||||
|
||||
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 87 KiB |
@@ -1,98 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="view_account_financial_report_form" model="ir.ui.view">
|
||||
<field name="name">account.financial.report.form</field>
|
||||
<field name="model">account.financial.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Report">
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="type"/>
|
||||
<field name="sign"/>
|
||||
<field name="style_overwrite"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Report"
|
||||
invisible="type not in ['accounts', 'account_type', 'account_report']">
|
||||
<group>
|
||||
<field name="display_detail"
|
||||
invisible="type not in ['accounts', 'account_type', 'account_report']"/>
|
||||
<field name="account_report_id"
|
||||
invisible="type != 'account_report'"/>
|
||||
</group>
|
||||
<field name="account_ids" invisible="type != 'accounts'"/>
|
||||
<field name="account_type_ids" invisible="type != 'account_type'"/>
|
||||
</page>
|
||||
<page string="Childrens">
|
||||
<field name="children_ids" nolabel="1">
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_financial_report_tree" model="ir.ui.view">
|
||||
<field name="name">account.financial.report.list</field>
|
||||
<field name="model">account.financial.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="Account Report">
|
||||
<field name="name"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
<field name="type"/>
|
||||
<field name="account_report_id"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_financial_report_search" model="ir.ui.view">
|
||||
<field name="name">account.financial.report.search</field>
|
||||
<field name="model">account.financial.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Account Report">
|
||||
<field name="name" string="Account Report"/>
|
||||
<field name="type"/>
|
||||
<field name="account_report_id"/>
|
||||
<filter string="Reports" name="filter_parent_id" domain="[('parent_id','=', False)]"/>
|
||||
<group>
|
||||
<filter name="parent_report" string="Parent Report"
|
||||
context="{'group_by':'parent_id'}"/>
|
||||
<filter name="report_type" string="Report Type" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_financial_report_tree" model="ir.actions.act_window">
|
||||
<field name="name">Financial Reports</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.financial.report</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="context">{'search_default_filter_parent_id': True}</field>
|
||||
<field name="search_view_id" ref="view_account_financial_report_search"/>
|
||||
<field name="view_id" ref="view_account_financial_report_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_finance_reports_settings"
|
||||
name="Financial Reports"
|
||||
sequence="9"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
parent="account.menu_finance_configuration"/>
|
||||
|
||||
<menuitem id="menu_account_reports"
|
||||
name="Account Reports"
|
||||
action="action_account_financial_report_tree"
|
||||
groups="account.group_account_user,account.group_account_manager"
|
||||
parent="menu_finance_reports_settings"/>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="action_account_moves_ledger_general" model="ir.actions.act_window">
|
||||
<field name="context">{'journal_type':'general', 'search_default_group_by_account': 1, 'search_default_posted':1}</field>
|
||||
<field name="name">General Ledger</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
|
||||
<field name="view_id" ref="account.view_move_line_tree_grouped_general"/>
|
||||
<field name="search_view_id" ref="account.view_account_move_line_filter"/>
|
||||
<field name="view_mode">list,pivot,graph</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_moves_ledger_partner" model="ir.actions.act_window">
|
||||
<field name="context">{'journal_type':'general', 'search_default_group_by_partner': 1,
|
||||
'search_default_posted':1, 'search_default_payable':1, 'search_default_receivable':1,
|
||||
'search_default_unreconciled':1}
|
||||
</field>
|
||||
<field name="name">Partner Ledger</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
|
||||
<field name="view_id" ref="account.view_move_line_tree_grouped_partner"/>
|
||||
<field name="search_view_id" ref="account.view_account_move_line_filter"/>
|
||||
<field name="view_mode">list,pivot,graph</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_finance_entries_accounting_ledgers" name="Ledgers" parent="account.menu_finance_entries"
|
||||
sequence="3">
|
||||
<menuitem id="menu_action_account_moves_ledger_general" action="action_account_moves_ledger_general"
|
||||
groups="account.group_account_readonly" sequence="1"/>
|
||||
<menuitem id="menu_action_account_moves_ledger_partner" action="action_account_moves_ledger_partner"
|
||||
groups="account.group_account_readonly" sequence="2"/>
|
||||
</menuitem>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<menuitem id="menu_finance_legal_statement"
|
||||
name="Financial Reports"
|
||||
sequence="10"
|
||||
parent="account.menu_finance_reports"/>
|
||||
|
||||
<menuitem id="menu_finance_partner_reports"
|
||||
name="Partner Reports"
|
||||
sequence="20"
|
||||
parent="account.menu_finance_reports"/>
|
||||
|
||||
<menuitem id="menu_finance_audit_reports"
|
||||
name="Audit Reports"
|
||||
sequence="30"
|
||||
parent="account.menu_finance_reports"/>
|
||||
|
||||
<record id="account.account_reports_management_menu" model="ir.ui.menu">
|
||||
<field name="sequence" eval="40"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="res_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.accountant</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="account.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<app name="account" position="inside">
|
||||
<h2>Enhanced Financial Reports</h2>
|
||||
<div>
|
||||
<div class="row mt16 o_settings_container" name="report_setting_container">
|
||||
<div class="col-6 col-lg-6 o_setting_box" id="enhanced_reports">
|
||||
<div>
|
||||
Preview financial reports without downloading
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<a target="_blank" href="https://apps.odoo.com/apps/modules/19.0/om_accounting_reports/"
|
||||
style="text-decoration: underline;">Enhanced Financial Reports</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 col-lg-6 o_setting_box" id="excel_reports">
|
||||
<div>
|
||||
Financial Reports in Excel
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<a target="_blank" href="https://apps.odoo.com/apps/modules/19.0/accounting_excel_reports/"
|
||||
style="text-decoration: underline;">Excel Reports</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</app>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,12 +0,0 @@
|
||||
from . import account_report_common
|
||||
from . import account_report_common_journal
|
||||
from . import account_report_print_journal
|
||||
from . import account_report
|
||||
from . import account_report_common_partner
|
||||
from . import account_report_common_account
|
||||
from . import account_partner_ledger
|
||||
from . import account_general_ledger
|
||||
from . import account_trial_balance
|
||||
from . import account_tax_report
|
||||
from . import aged_partner
|
||||
from . import account_journal_audit
|
||||
@@ -1,35 +0,0 @@
|
||||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class AccountReportGeneralLedger(models.TransientModel):
|
||||
_name = "account.report.general.ledger"
|
||||
_inherit = "account.common.account.report"
|
||||
_description = "General Ledger Report"
|
||||
|
||||
initial_balance = fields.Boolean(
|
||||
string='Include Initial Balances',
|
||||
help='If you selected date, this field allow you to add a row '
|
||||
'to display the amount of debit/credit/balance that precedes '
|
||||
'the filter you have set.'
|
||||
)
|
||||
sortby = fields.Selection(
|
||||
[('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')],
|
||||
string='Sort by', required=True, default='sort_date'
|
||||
)
|
||||
journal_ids = fields.Many2many(
|
||||
'account.journal', 'account_report_general_ledger_journal_rel',
|
||||
'account_id', 'journal_id', string='Journals', required=True
|
||||
)
|
||||
|
||||
def _get_report_data(self, data):
|
||||
data = self.pre_print_report(data)
|
||||
data['form'].update(self.read(['initial_balance', 'sortby'])[0])
|
||||
if data['form'].get('initial_balance') and not data['form'].get('date_from'):
|
||||
raise UserError(_("You must define a Start Date"))
|
||||
records = self.env[data['model']].browse(data.get('ids', []))
|
||||
return records, data
|
||||
|
||||
def _print_report(self, data):
|
||||
records, data = self._get_report_data(data)
|
||||
return self.env.ref('accounting_pdf_reports.action_report_general_ledger').with_context(landscape=True).report_action(records, data=data)
|
||||
@@ -1,21 +0,0 @@
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
class AccountPrintJournal(models.TransientModel):
|
||||
_name = "account.print.journal"
|
||||
_inherit = "account.common.journal.report"
|
||||
_description = "Account Print Journal"
|
||||
|
||||
sort_selection = fields.Selection([('date', 'Date'), ('move_name', 'Journal Entry Number')],
|
||||
'Entries Sorted by', required=True, default='move_name')
|
||||
journal_ids = fields.Many2many('account.journal', string='Journals', required=True,
|
||||
default=lambda self: self.env['account.journal'].search([('type', 'in', ['sale', 'purchase'])]))
|
||||
|
||||
def _get_report_data(self, data):
|
||||
data = self.pre_print_report(data)
|
||||
data['form'].update({'sort_selection': self.sort_selection})
|
||||
return data
|
||||
|
||||
def _print_report(self, data):
|
||||
data = self._get_report_data(data)
|
||||
return self.env.ref('accounting_pdf_reports.action_report_journal').with_context(landscape=True).report_action(self, data=data)
|
||||
@@ -1,24 +0,0 @@
|
||||
from odoo import fields, models, api, _
|
||||
|
||||
|
||||
class AccountPartnerLedger(models.TransientModel):
|
||||
_name = "account.report.partner.ledger"
|
||||
_inherit = "account.common.partner.report"
|
||||
_description = "Account Partner Ledger"
|
||||
|
||||
amount_currency = fields.Boolean("With Currency",
|
||||
help="It adds the currency column on "
|
||||
"report if the currency differs from "
|
||||
"the company currency.")
|
||||
reconciled = fields.Boolean('Reconciled Entries')
|
||||
|
||||
def _get_report_data(self, data):
|
||||
data = self.pre_print_report(data)
|
||||
data['form'].update({'reconciled': self.reconciled,
|
||||
'amount_currency': self.amount_currency})
|
||||
return data
|
||||
|
||||
def _print_report(self, data):
|
||||
data = self._get_report_data(data)
|
||||
return self.env.ref('accounting_pdf_reports.action_report_partnerledger').with_context(landscape=True).\
|
||||
report_action(self, data=data)
|
||||
@@ -1,55 +0,0 @@
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountingReport(models.TransientModel):
|
||||
_name = "accounting.report"
|
||||
_inherit = "account.common.report"
|
||||
_description = "Accounting Report"
|
||||
|
||||
@api.model
|
||||
def _get_account_report(self):
|
||||
reports = []
|
||||
if self.env.context.get('active_id'):
|
||||
menu = self.env['ir.ui.menu'].browse(self.env.context.get('active_id')).name
|
||||
reports = self.env['account.financial.report'].search([('name', 'ilike', menu)])
|
||||
return reports and reports[0] or False
|
||||
|
||||
enable_filter = fields.Boolean(string='Enable Comparison')
|
||||
account_report_id = fields.Many2one('account.financial.report', string='Account Reports',
|
||||
required=True, default=_get_account_report)
|
||||
label_filter = fields.Char(string='Column Label', help="This label will be displayed on report to "
|
||||
"show the balance computed for the given comparison filter.")
|
||||
filter_cmp = fields.Selection([('filter_no', 'No Filters'), ('filter_date', 'Date')],
|
||||
string='Filter by', required=True, default='filter_no')
|
||||
date_from_cmp = fields.Date(string='Date From')
|
||||
date_to_cmp = fields.Date(string='Date To')
|
||||
debit_credit = fields.Boolean(string='Display Debit/Credit Columns',
|
||||
help="This option allows you to get more details about "
|
||||
"the way your balances are computed."
|
||||
" Because it is space consuming, we do not allow to"
|
||||
" use it while doing a comparison.")
|
||||
|
||||
def _build_comparison_context(self, data):
|
||||
result = {}
|
||||
result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
|
||||
result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
|
||||
if data['form']['filter_cmp'] == 'filter_date':
|
||||
result['date_from'] = data['form']['date_from_cmp']
|
||||
result['date_to'] = data['form']['date_to_cmp']
|
||||
result['strict_range'] = True
|
||||
return result
|
||||
|
||||
def check_report(self):
|
||||
res = super(AccountingReport, self).check_report()
|
||||
data = {}
|
||||
data['form'] = self.read(['account_report_id', 'date_from_cmp', 'date_to_cmp', 'journal_ids', 'filter_cmp', 'target_move'])[0]
|
||||
for field in ['account_report_id']:
|
||||
if isinstance(data['form'][field], tuple):
|
||||
data['form'][field] = data['form'][field][0]
|
||||
comparison_context = self._build_comparison_context(data)
|
||||
res['data']['form']['comparison_context'] = comparison_context
|
||||
return res
|
||||
|
||||
def _print_report(self, data):
|
||||
data['form'].update(self.read(['date_from_cmp', 'debit_credit', 'date_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter', 'target_move'])[0])
|
||||
return self.env.ref('accounting_pdf_reports.action_report_financial').report_action(self, data=data, config=False)
|
||||
@@ -1,52 +0,0 @@
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.tools.misc import get_lang
|
||||
|
||||
|
||||
class AccountCommonReport(models.TransientModel):
|
||||
_name = "account.common.report"
|
||||
_description = "Account Common Report"
|
||||
|
||||
company_id = fields.Many2one('res.company', string='Company', required=True, readonly=True, default=lambda self: self.env.company)
|
||||
journal_ids = fields.Many2many(
|
||||
comodel_name='account.journal',
|
||||
string='Journals',
|
||||
required=True,
|
||||
default=lambda self: self.env['account.journal'].search([('company_id', '=', self.company_id.id)]),
|
||||
domain="[('company_id', '=', company_id)]",
|
||||
)
|
||||
date_from = fields.Date(string='Start Date')
|
||||
date_to = fields.Date(string='End Date')
|
||||
target_move = fields.Selection([('posted', 'All Posted Entries'),
|
||||
('all', 'All Entries'),
|
||||
], string='Target Moves', required=True, default='posted')
|
||||
|
||||
@api.onchange('company_id')
|
||||
def _onchange_company_id(self):
|
||||
if self.company_id:
|
||||
self.journal_ids = self.env['account.journal'].search(
|
||||
[('company_id', '=', self.company_id.id)])
|
||||
else:
|
||||
self.journal_ids = self.env['account.journal'].search([])
|
||||
|
||||
def _build_contexts(self, data):
|
||||
result = {}
|
||||
result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
|
||||
result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
|
||||
result['date_from'] = data['form']['date_from'] or False
|
||||
result['date_to'] = data['form']['date_to'] or False
|
||||
result['strict_range'] = True if result['date_from'] else False
|
||||
result['company_id'] = data['form']['company_id'][0] or False
|
||||
return result
|
||||
|
||||
def _print_report(self, data):
|
||||
raise NotImplementedError()
|
||||
|
||||
def check_report(self):
|
||||
self.ensure_one()
|
||||
data = {}
|
||||
data['ids'] = self.env.context.get('active_ids', [])
|
||||
data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
|
||||
data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0]
|
||||
used_context = self._build_contexts(data)
|
||||
data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code)
|
||||
return self.with_context(discard_logo_check=True)._print_report(data)
|
||||
@@ -1,26 +0,0 @@
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountCommonAccountReport(models.TransientModel):
|
||||
_name = 'account.common.account.report'
|
||||
_inherit = "account.common.report"
|
||||
_description = 'Account Common Account Report'
|
||||
|
||||
display_account = fields.Selection([('all', 'All'),
|
||||
('movement', 'With movements'),
|
||||
('not_zero', 'With balance is not equal to 0'), ],
|
||||
string='Display Accounts',
|
||||
required=True, default='movement')
|
||||
analytic_account_ids = fields.Many2many('account.analytic.account',
|
||||
string='Analytic Accounts')
|
||||
account_ids = fields.Many2many('account.account', string='Accounts')
|
||||
partner_ids = fields.Many2many('res.partner', string='Partners')
|
||||
|
||||
def pre_print_report(self, data):
|
||||
data['form'].update(self.read(['display_account'])[0])
|
||||
data['form'].update({
|
||||
'analytic_account_ids': self.analytic_account_ids.ids,
|
||||
'partner_ids': self.partner_ids.ids,
|
||||
'account_ids': self.account_ids.ids,
|
||||
})
|
||||
return data
|
||||
@@ -1,13 +0,0 @@
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountCommonJournalReport(models.TransientModel):
|
||||
_name = 'account.common.journal.report'
|
||||
_description = 'Common Journal Report'
|
||||
_inherit = "account.common.report"
|
||||
|
||||
amount_currency = fields.Boolean('With Currency', help="Print Report with the currency column if the currency differs from the company currency.")
|
||||
|
||||
def pre_print_report(self, data):
|
||||
data['form'].update({'amount_currency': self.amount_currency})
|
||||
return data
|
||||
@@ -1,18 +0,0 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountingCommonPartnerReport(models.TransientModel):
|
||||
_name = 'account.common.partner.report'
|
||||
_inherit = "account.common.report"
|
||||
_description = 'Account Common Partner Report'
|
||||
|
||||
result_selection = fields.Selection([('customer', 'Receivable Accounts'),
|
||||
('supplier', 'Payable Accounts'),
|
||||
('customer_supplier', 'Receivable and Payable Accounts')
|
||||
], string="Partner's", required=True, default='customer')
|
||||
partner_ids = fields.Many2many('res.partner', string='Partners')
|
||||
|
||||
def pre_print_report(self, data):
|
||||
data['form'].update(self.read(['result_selection'])[0])
|
||||
data['form'].update({'partner_ids': self.partner_ids.ids})
|
||||
return data
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="account_common_report_view" model="ir.ui.view">
|
||||
<field name="name">Common Report</field>
|
||||
<field name="model">account.common.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Report Options">
|
||||
<group col="4">
|
||||
<field name="target_move" widget="radio"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="journal_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight" data-hotkey="q"/>
|
||||
<button string="Cancel" class="btn btn-secondary" special="cancel" data-hotkey="z" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,21 +0,0 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountPrintJournal(models.TransientModel):
|
||||
_inherit = "account.common.journal.report"
|
||||
_name = "account.print.journal"
|
||||
_description = "Account Print Journal"
|
||||
|
||||
sort_selection = fields.Selection(
|
||||
[('date', 'Date'), ('move_name', 'Journal Entry Number')],
|
||||
'Entries Sorted by', required=True, default='move_name'
|
||||
)
|
||||
journal_ids = fields.Many2many(
|
||||
'account.journal', string='Journals', required=True,
|
||||
default=lambda self: self.env['account.journal'].search([('type', 'in', ['sale', 'purchase'])])
|
||||
)
|
||||
|
||||
def _print_report(self, data):
|
||||
data = self.pre_print_report(data)
|
||||
data['form'].update({'sort_selection': self.sort_selection})
|
||||
return self.env.ref('account.action_report_journal').with_context(landscape=True).report_action(self, data=data)
|
||||
@@ -1,20 +0,0 @@
|
||||
from odoo import models, api, fields
|
||||
from datetime import date
|
||||
|
||||
|
||||
class AccountTaxReport(models.TransientModel):
|
||||
_name = 'account.tax.report.wizard'
|
||||
_inherit = "account.common.report"
|
||||
_description = 'Tax Report'
|
||||
|
||||
date_from = fields.Date(
|
||||
string='Date From', required=True,
|
||||
default=lambda self: fields.Date.to_string(date.today().replace(day=1))
|
||||
)
|
||||
date_to = fields.Date(
|
||||
string='Date To', required=True,
|
||||
default=lambda self: fields.Date.to_string(date.today())
|
||||
)
|
||||
|
||||
def _print_report(self, data):
|
||||
return self.env.ref('accounting_pdf_reports.action_report_account_tax').report_action(self, data=data)
|
||||
@@ -1,26 +0,0 @@
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
class AccountBalanceReport(models.TransientModel):
|
||||
_name = 'account.balance.report'
|
||||
_inherit = "account.common.account.report"
|
||||
_description = 'Trial Balance Report'
|
||||
|
||||
journal_ids = fields.Many2many(
|
||||
'account.journal', 'account_balance_report_journal_rel',
|
||||
'account_id', 'journal_id',
|
||||
string='Journals', required=True, default=[]
|
||||
)
|
||||
analytic_account_ids = fields.Many2many(
|
||||
'account.analytic.account',
|
||||
'account_trial_balance_analytic_rel', string='Analytic Accounts'
|
||||
)
|
||||
|
||||
def _get_report_data(self, data):
|
||||
data = self.pre_print_report(data)
|
||||
records = self.env[data['model']].browse(data.get('ids', []))
|
||||
return records, data
|
||||
|
||||
def _print_report(self, data):
|
||||
records, data = self._get_report_data(data)
|
||||
return self.env.ref('accounting_pdf_reports.action_report_trial_balance').report_action(records, data=data)
|
||||
@@ -1,41 +0,0 @@
|
||||
import time
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class AccountAgedTrialBalance(models.TransientModel):
|
||||
_name = 'account.aged.trial.balance'
|
||||
_inherit = 'account.common.partner.report'
|
||||
_description = 'Account Aged Trial balance Report'
|
||||
|
||||
period_length = fields.Integer(string='Period Length (days)', required=True, default=30)
|
||||
journal_ids = fields.Many2many('account.journal', string='Journals', required=True)
|
||||
date_from = fields.Date(default=lambda *a: time.strftime('%Y-%m-%d'))
|
||||
|
||||
def _get_report_data(self, data):
|
||||
res = {}
|
||||
data = self.pre_print_report(data)
|
||||
data['form'].update(self.read(['period_length'])[0])
|
||||
period_length = data['form']['period_length']
|
||||
if period_length <= 0:
|
||||
raise UserError(_('You must set a period length greater than 0.'))
|
||||
if not data['form']['date_from']:
|
||||
raise UserError(_('You must set a start date.'))
|
||||
start = data['form']['date_from']
|
||||
for i in range(5)[::-1]:
|
||||
stop = start - relativedelta(days=period_length - 1)
|
||||
res[str(i)] = {
|
||||
'name': (i != 0 and (str((5 - (i + 1)) * period_length) + '-' + str((5 - i) * period_length)) or (
|
||||
'+' + str(4 * period_length))),
|
||||
'stop': start.strftime('%Y-%m-%d'),
|
||||
'start': (i != 0 and stop.strftime('%Y-%m-%d') or False),
|
||||
}
|
||||
start = stop - relativedelta(days=1)
|
||||
data['form'].update(res)
|
||||
return data
|
||||
|
||||
def _print_report(self, data):
|
||||
data = self._get_report_data(data)
|
||||
return self.env.ref('accounting_pdf_reports.action_report_aged_partner_balance').\
|
||||
with_context(landscape=True).report_action(self, data=data)
|
||||
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="account_aged_balance_view" model="ir.ui.view">
|
||||
<field name="name">Aged Partner Balance</field>
|
||||
<field name="model">account.aged.trial.balance</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Report Options">
|
||||
<group col="4">
|
||||
<field name="date_from"/>
|
||||
<field name="period_length"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<newline/>
|
||||
<field name="result_selection" widget="radio"
|
||||
invisible="context.get('hide_result_selection')"/>
|
||||
<field name="target_move" widget="radio"/>
|
||||
</group>
|
||||
<field name="journal_ids" required="0" invisible="1"/>
|
||||
<xpath expr="//field[@name='journal_ids']" position="before">
|
||||
<group>
|
||||
<field name="partner_ids" widget="many2many_tags"
|
||||
options="{'no_open': True, 'no_create': True}"/>
|
||||
</group>
|
||||
</xpath>
|
||||
<footer>
|
||||
<button name="check_report" class="oe_highlight"
|
||||
string="Print" type="object"/>
|
||||
<button string="Cancel" class="btn btn-default" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_aged_balance_view" model="ir.actions.act_window">
|
||||
<field name="name">Aged Partner Balance</field>
|
||||
<field name="res_model">account.aged.trial.balance</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="account_aged_balance_view"/>
|
||||
<field name="context"></field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_aged_trial_balance"
|
||||
name="Aged Partner Balance"
|
||||
sequence="10"
|
||||
action="action_account_aged_balance_view"
|
||||
parent="menu_finance_partner_reports"/>
|
||||
|
||||
<record id="action_account_aged_receivable" model="ir.actions.act_window">
|
||||
<field name="name">Aged Receivable</field>
|
||||
<field name="res_model">account.aged.trial.balance</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="account_aged_balance_view"/>
|
||||
<field name="context">{'default_result_selection': 'customer',
|
||||
'hide_result_selection': 1}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_aged_receivable"
|
||||
name="Aged Receivable"
|
||||
sequence="20"
|
||||
action="action_account_aged_receivable"
|
||||
parent="menu_finance_partner_reports"/>
|
||||
|
||||
|
||||
<record id="action_account_aged_payable" model="ir.actions.act_window">
|
||||
<field name="name">Aged Payable</field>
|
||||
<field name="res_model">account.aged.trial.balance</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="account_aged_balance_view"/>
|
||||
<field name="context">{'default_result_selection': 'supplier',
|
||||
'hide_result_selection': 1}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_aged_payable"
|
||||
name="Aged Payable"
|
||||
sequence="30"
|
||||
action="action_account_aged_payable"
|
||||
parent="menu_finance_partner_reports"/>
|
||||
|
||||
</odoo>
|
||||
@@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="account_financial_report_profitandloss0" model="account.financial.report">
|
||||
<field name="name">Profit and Loss</field>
|
||||
<field name="sign">-1</field>
|
||||
<field name="type">sum</field>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_income0" model="account.financial.report">
|
||||
<field name="name">Income</field>
|
||||
<field name="sign">-1</field>
|
||||
<field name="parent_id" ref="account_financial_report_profitandloss0"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
<field name="account_type_ids" eval="[(4,ref('accounting_pdf_reports.data_account_type_other_income')), (4,ref('accounting_pdf_reports.data_account_type_revenue'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_expense0" model="account.financial.report">
|
||||
<field name="name">Expense</field>
|
||||
<field name="sign">-1</field>
|
||||
<field name="parent_id" ref="account_financial_report_profitandloss0"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
<field name="account_type_ids" eval="[(4,ref('accounting_pdf_reports.data_account_type_expenses')),(4,ref('accounting_pdf_reports.data_account_type_direct_costs')), (4,ref('accounting_pdf_reports.data_account_type_depreciation'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_balancesheet0" model="account.financial.report">
|
||||
<field name="name">Balance Sheet</field>
|
||||
<field name="type">sum</field>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_assets0" model="account.financial.report">
|
||||
<field name="name">Assets</field>
|
||||
<field name="parent_id" ref="account_financial_report_balancesheet0"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
<field name="account_type_ids" eval="[(4,ref('accounting_pdf_reports.data_account_type_receivable')),
|
||||
(4,ref('accounting_pdf_reports.data_account_type_liquidity')), (4,ref('accounting_pdf_reports.data_account_type_current_assets')),
|
||||
(4,ref('accounting_pdf_reports.data_account_type_non_current_assets'), (4,ref('accounting_pdf_reports.data_account_type_prepayments'))),
|
||||
(4,ref('accounting_pdf_reports.data_account_type_fixed_assets'))]"/>
|
||||
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_liabilitysum0" model="account.financial.report">
|
||||
<field name="name">Liability</field>
|
||||
<field name="parent_id" ref="account_financial_report_balancesheet0"/>
|
||||
<field name="display_detail">no_detail</field>
|
||||
<field name="type">sum</field>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_liability0" model="account.financial.report">
|
||||
<field name="name">Liability</field>
|
||||
<field name="parent_id" ref="account_financial_report_liabilitysum0"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
<field name="account_type_ids" eval="[(4,ref('accounting_pdf_reports.data_account_type_payable')),
|
||||
(4,ref('accounting_pdf_reports.data_account_type_equity')), (4,ref('accounting_pdf_reports.data_account_type_current_liabilities')),
|
||||
(4,ref('accounting_pdf_reports.data_account_type_non_current_liabilities'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_profitloss_toreport0" model="account.financial.report">
|
||||
<field name="name">Profit (Loss) to report</field>
|
||||
<field name="parent_id" ref="account_financial_report_liabilitysum0"/>
|
||||
<field name="display_detail">no_detail</field>
|
||||
<field name="type">account_report</field>
|
||||
<field name="account_report_id" ref="account_financial_report_profitandloss0"/>
|
||||
</record>
|
||||
|
||||
<record id="accounting_report_view" model="ir.ui.view">
|
||||
<field name="name">Accounting Report</field>
|
||||
<field name="model">accounting.report</field>
|
||||
<field name="inherit_id" ref="accounting_pdf_reports.account_common_report_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="target_move" position="before">
|
||||
<field name="account_report_id" domain="[('parent_id','=',False)]"/>
|
||||
</field>
|
||||
<field name="target_move" position="after">
|
||||
<field name="enable_filter"/>
|
||||
<field name="debit_credit" invisible="enable_filter == True"/>
|
||||
</field>
|
||||
<field name="journal_ids" position="after">
|
||||
<notebook tabpos="up" colspan="4">
|
||||
<page string="Comparison" name="comparison" invisible="enable_filter == False">
|
||||
<group>
|
||||
<field name="label_filter" required="enable_filter == True"/>
|
||||
<field name="filter_cmp"/>
|
||||
</group>
|
||||
<group string="Dates" invisible="filter_cmp != 'filter_date'">
|
||||
<field name="date_from_cmp" required="filter_cmp == 'filter_date'"/>
|
||||
<field name="date_to_cmp" required="filter_cmp == 'filter_date'"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_bs" model="ir.actions.act_window">
|
||||
<field name="name">Balance Sheet</field>
|
||||
<field name="res_model">accounting.report</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="accounting_report_view"/>
|
||||
<field name="target">new</field>
|
||||
<field name="context" eval="{'default_account_report_id':ref('accounting_pdf_reports.account_financial_report_balancesheet0')}"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_account_report_bs"
|
||||
name="Balance Sheet"
|
||||
sequence="5"
|
||||
action="action_account_report_bs"
|
||||
parent="menu_finance_legal_statement"
|
||||
groups="account.group_account_user,account.group_account_manager"/>
|
||||
|
||||
</odoo>
|
||||
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="account_report_general_ledger_view" model="ir.ui.view">
|
||||
<field name="name">General Ledger</field>
|
||||
<field name="model">account.report.general.ledger</field>
|
||||
<field name="inherit_id" ref="accounting_pdf_reports.account_common_report_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='journal_ids']" position="after">
|
||||
<field name="analytic_account_ids" widget="many2many_tags"
|
||||
options="{'no_open': True, 'no_create': True}"
|
||||
invisible="1"
|
||||
groups="analytic.group_analytic_accounting"/>
|
||||
<field name="account_ids" widget="many2many_tags"
|
||||
options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="partner_ids" widget="many2many_tags"
|
||||
options="{'no_open': True, 'no_create': True}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="sortby" widget="radio"/>
|
||||
<field name="display_account" widget="radio"/>
|
||||
<field name="initial_balance"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_general_ledger_menu" model="ir.actions.act_window">
|
||||
<field name="name">General Ledger</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.report.general.ledger</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="account_report_general_ledger_view"/>
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="account.model_account_account" />
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_general_ledger"
|
||||
name="General Ledger"
|
||||
sequence="10"
|
||||
parent="menu_finance_audit_reports"
|
||||
action="action_account_general_ledger_menu"
|
||||
groups="account.group_account_user,account.group_account_manager"/>
|
||||
|
||||
</odoo>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="account_report_print_journal_view" model="ir.ui.view">
|
||||
<field name="name">Journals Audit</field>
|
||||
<field name="model">account.print.journal</field>
|
||||
<field name="inherit_id" ref="accounting_pdf_reports.account_common_report_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="amount_currency" groups="base.group_multi_currency"/>
|
||||
<field name="sort_selection" widget="radio"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_print_journal_menu" model="ir.actions.act_window">
|
||||
<field name="name">Journals Audit</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.print.journal</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="account_report_print_journal_view"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_print_journal"
|
||||
name="Journals Audit"
|
||||
sequence="40"
|
||||
parent="menu_finance_audit_reports"
|
||||
action="action_account_print_journal_menu"
|
||||
groups="account.group_account_manager,account.group_account_user"/>
|
||||
|
||||
</odoo>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="account_report_partner_ledger_view" model="ir.ui.view">
|
||||
<field name="name">Partner Ledger</field>
|
||||
<field name="model">account.report.partner.ledger</field>
|
||||
<field name="inherit_id" ref="accounting_pdf_reports.account_common_report_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='journal_ids']" position="before">
|
||||
<field name="partner_ids" widget="many2many_tags"
|
||||
options="{'no_open': True, 'no_create': True}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="result_selection"/>
|
||||
<field name="amount_currency" groups="base.group_multi_currency"/>
|
||||
<newline/>
|
||||
<field name="reconciled"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_partner_ledger_menu" model="ir.actions.act_window">
|
||||
<field name="name">Partner Ledger</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.report.partner.ledger</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="account_report_partner_ledger_view"/>
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="account.model_account_account" />
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_partner_ledger"
|
||||
name="Partner Ledger"
|
||||
sequence="5"
|
||||
parent="menu_finance_partner_reports"
|
||||
action="action_account_partner_ledger_menu"
|
||||
groups="account.group_account_invoice"/>
|
||||
|
||||
<!-- Add to Partner Print button -->
|
||||
<record id="action_partner_report_partnerledger" model="ir.actions.act_window">
|
||||
<field name="name">Balance Statement (Partner Ledger)</field>
|
||||
<field name="res_model">account.report.partner.ledger</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="account_report_partner_ledger_view" />
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="base.model_res_partner" />
|
||||
<field name="binding_type">report</field>
|
||||
<field name="context">{
|
||||
'default_partner_ids':active_ids,
|
||||
'default_target_move': 'posted',
|
||||
'default_result_selection': 'customer_supplier',
|
||||
'default_reconciled': True,
|
||||
'hide_partner':1,
|
||||
}</field>
|
||||
<field name="group_ids" eval="[(4, ref('account.group_account_invoice'))]"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="action_account_report_pl" model="ir.actions.act_window">
|
||||
<field name="name">Profit and Loss</field>
|
||||
<field name="res_model">accounting.report</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="accounting_report_view"/>
|
||||
<field name="target">new</field>
|
||||
<field name="context" eval="{'default_account_report_id':ref('accounting_pdf_reports.account_financial_report_profitandloss0')}"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_account_report_pl"
|
||||
name="Profit and Loss"
|
||||
sequence="6"
|
||||
action="action_account_report_pl"
|
||||
parent="accounting_pdf_reports.menu_finance_legal_statement"
|
||||
groups="account.group_account_user,account.group_account_manager"/>
|
||||
|
||||
</odoo>
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="accounting_tax_report_view" model="ir.ui.view">
|
||||
<field name="name">Tax Reports</field>
|
||||
<field name="model">account.tax.report.wizard</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Report Options">
|
||||
<group>
|
||||
<group>
|
||||
<field name="target_move" widget="radio"/>
|
||||
<field name="date_from"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="date_to" />
|
||||
</group>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight" data-hotkey="q"/>
|
||||
<button string="Cancel" class="btn btn-secondary" special="cancel" data-hotkey="z"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_tax_report" model="ir.actions.act_window">
|
||||
<field name="name">Tax Reports</field>
|
||||
<field name="res_model">account.tax.report.wizard</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="accounting_tax_report_view"/>
|
||||
<field name="context">{}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_account_report"
|
||||
name="Tax Report"
|
||||
sequence="30"
|
||||
action="action_account_tax_report"
|
||||
parent="menu_finance_audit_reports"
|
||||
groups="account.group_account_manager,account.group_account_user"/>
|
||||
|
||||
</odoo>
|
||||
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="account_report_balance_view" model="ir.ui.view">
|
||||
<field name="name">Trial Balance</field>
|
||||
<field name="model">account.balance.report</field>
|
||||
<field name="inherit_id" ref="accounting_pdf_reports.account_common_report_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="display_account" widget="radio"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='journal_ids']" position="after">
|
||||
<field name="analytic_account_ids" widget="many2many_tags"
|
||||
invisible="1"
|
||||
options="{'no_open': True, 'no_create': True}"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_balance_menu" model="ir.actions.act_window">
|
||||
<field name="name">Trial Balance</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.balance.report</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="account_report_balance_view"/>
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="account.model_account_account" />
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_general_balance_report"
|
||||
name="Trial Balance"
|
||||
sequence="20"
|
||||
parent="menu_finance_audit_reports"
|
||||
action="action_account_balance_menu"
|
||||
groups="account.group_account_user,account.group_account_manager"/>
|
||||
|
||||
</odoo>
|
||||
105
addons/at_accounting/__init__.py
Normal file
@@ -0,0 +1,105 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
from . import controllers
|
||||
|
||||
from odoo import Command
|
||||
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _at_accounting_post_init(env):
|
||||
country_code = env.company.country_id.code
|
||||
if country_code:
|
||||
module_list = []
|
||||
|
||||
sepa_zone = env.ref('base.sepa_zone', raise_if_not_found=False)
|
||||
sepa_zone_country_codes = sepa_zone and sepa_zone.mapped('country_ids.code') or []
|
||||
|
||||
if country_code in sepa_zone_country_codes:
|
||||
module_list.extend(['account_iso20022', 'account_bank_statement_import_camt'])
|
||||
|
||||
module_ids = env['ir.module.module'].search([('name', 'in', module_list), ('state', '=', 'uninstalled')])
|
||||
if module_ids:
|
||||
module_ids.sudo().button_install()
|
||||
|
||||
for company in env['res.company'].search([('chart_template', '!=', False)], order="parent_path"):
|
||||
ChartTemplate = env['account.chart.template'].with_company(company)
|
||||
ChartTemplate._load_data({
|
||||
'res.company': ChartTemplate._get_account_accountant_res_company(company.chart_template),
|
||||
})
|
||||
|
||||
country_code = env.company.country_id.code
|
||||
if country_code:
|
||||
module_list = []
|
||||
|
||||
if country_code in ('AU', 'CA', 'US'):
|
||||
module_list.append('account_reports_cash_basis')
|
||||
|
||||
module_ids = env['ir.module.module'].search([('name', 'in', module_list), ('state', '=', 'uninstalled')])
|
||||
if module_ids:
|
||||
module_ids.sudo().button_install()
|
||||
|
||||
for company in env['res.company'].search([]):
|
||||
company.account_tax_periodicity_journal_id = company._get_default_misc_journal()
|
||||
company.account_tax_periodicity_journal_id.show_on_dashboard = True
|
||||
company._initiate_account_onboardings()
|
||||
|
||||
|
||||
def uninstall_hook(env):
|
||||
group_basic = env.ref('account.group_account_basic')
|
||||
group_manager = env.ref('account.group_account_manager')
|
||||
if group_basic:
|
||||
group_basic.write({
|
||||
'users': [Command.clear()],
|
||||
'category_id': env.ref("base.module_category_hidden").id,
|
||||
})
|
||||
group_manager.write({
|
||||
'implied_ids': [Command.unlink(group_basic.id)],
|
||||
})
|
||||
|
||||
|
||||
try:
|
||||
group_user = env.ref("account.group_account_user")
|
||||
group_user.write({
|
||||
'name': "Show Full Accounting Features",
|
||||
'implied_ids': [(3, env.ref('account.group_account_invoice').id)],
|
||||
'category_id': env.ref("base.module_category_hidden").id,
|
||||
})
|
||||
group_readonly = env.ref("account.group_account_readonly")
|
||||
group_readonly.write({
|
||||
'name': "Show Full Accounting Features - Readonly",
|
||||
'category_id': env.ref("base.module_category_hidden").id,
|
||||
})
|
||||
except ValueError as e:
|
||||
_logger.warning(e)
|
||||
|
||||
try:
|
||||
group_manager = env.ref("account.group_account_manager")
|
||||
group_manager.write({'name': "Billing Manager",
|
||||
'implied_ids': [(4, env.ref("account.group_account_invoice").id),
|
||||
(3, env.ref("account.group_account_readonly").id),
|
||||
(3, env.ref("account.group_account_user").id)]})
|
||||
except ValueError as e:
|
||||
_logger.warning(e)
|
||||
|
||||
# make the account_accountant features disappear (magic)
|
||||
env.ref("account.group_account_user").write({'users': [(5, False, False)]})
|
||||
env.ref("account.group_account_readonly").write({'users': [(5, False, False)]})
|
||||
|
||||
|
||||
invoicing_menu = env.ref("account.menu_finance")
|
||||
menus_to_move = [
|
||||
"account.menu_finance_receivables",
|
||||
"account.menu_finance_payables",
|
||||
"account.menu_finance_entries",
|
||||
"account.menu_finance_reports",
|
||||
"account.menu_finance_configuration",
|
||||
"account.menu_board_journal_1",
|
||||
]
|
||||
for menu_xmlids in menus_to_move:
|
||||
try:
|
||||
env.ref(menu_xmlids).parent_id = invoicing_menu
|
||||
except ValueError as e:
|
||||
_logger.warning(e)
|
||||
178
addons/at_accounting/__manifest__.py
Normal file
@@ -0,0 +1,178 @@
|
||||
{
|
||||
'name': "Odoo 18 Vera Accounting",
|
||||
'version': "18.0.1.7",
|
||||
'category': 'Accounting/Accounting',
|
||||
'sequence': 1,
|
||||
'summary': "A complete accounting toolkit for Odoo 18 Community with advanced reports, wizards, and workflows.",
|
||||
'description': """
|
||||
========================================================
|
||||
Your Complete Professional Accounting Suite for Odoo 18
|
||||
========================================================
|
||||
|
||||
Transform your Odoo 18 Community into a powerful, professional-grade financial management system. This module provides the advanced tools and deep financial insights that growing businesses need to thrive.
|
||||
|
||||
Move beyond standard accounting with a comprehensive toolkit designed to improve accuracy, streamline workflows, and empower you to make smarter, data-driven decisions.
|
||||
|
||||
Key Features:
|
||||
-------------
|
||||
* **Advanced Reporting Engine:** Generate a full suite of essential financial reports on-demand, including:
|
||||
* Profit and Loss (P&L)
|
||||
* Balance Sheet
|
||||
* Cash Flow Statement
|
||||
* Aged Receivables & Payables
|
||||
* General Ledger & Partner Ledger
|
||||
* Trial Balance
|
||||
* Comprehensive Tax Reports
|
||||
* ...and many more.
|
||||
|
||||
* **Interactive Financial Dashboards:** Visualize your financial health with intuitive and dynamic dashboard components, bringing your numbers to life.
|
||||
|
||||
* **Streamlined Bank Reconciliation:** Utilize an enhanced bank reconciliation widget and powerful auto-reconciliation wizards to manage your statements faster and more accurately.
|
||||
|
||||
* **Powerful Accounting Wizards:** Simplify complex processes with guided, user-friendly wizards for tasks like Fiscal Year Closing, Multicurrency Revaluation, and Report Exporting.
|
||||
|
||||
* **Guided User Tours:** Onboard your team quickly and ensure they can leverage all the powerful new features with integrated user tours.
|
||||
|
||||
* **Professional PDF Exports:** Create clean, professionally formatted PDF documents for all your financial reports, ready for sharing with stakeholders.
|
||||
|
||||
Empower Your Finance Team
|
||||
-------------------------
|
||||
This module provides your team with the information they need, right where they need it. Reduce manual work, eliminate errors, and give your accountants the tools they need to perform at their best.
|
||||
""",
|
||||
'icon': 'static/description/icon.png',
|
||||
'author': 'Vera Software',
|
||||
"website": "https://www.erp-tradepro.com/",
|
||||
'support': 'vera@Software.com',
|
||||
'maintainer': 'Vera Software',
|
||||
'depends': ['account','web_tour', 'stock_account', 'base_import'],
|
||||
'data': [
|
||||
'data/ir_cron.xml',
|
||||
'data/digest_data.xml',
|
||||
'data/at_accounting_tour.xml',
|
||||
'data/at_accounting_data.xml',
|
||||
'data/pdf_export_templates.xml',
|
||||
'data/balance_sheet.xml',
|
||||
'data/cash_flow_report.xml',
|
||||
'data/executive_summary.xml',
|
||||
'data/profit_and_loss.xml',
|
||||
'data/bank_reconciliation_report.xml',
|
||||
'data/aged_partner_balance.xml',
|
||||
'data/general_ledger.xml',
|
||||
'data/trial_balance.xml',
|
||||
'data/sales_report.xml',
|
||||
'data/partner_ledger.xml',
|
||||
'data/multicurrency_revaluation_report.xml',
|
||||
'data/deferred_reports.xml',
|
||||
'data/journal_report.xml',
|
||||
'data/generic_tax_report.xml',
|
||||
'views/account_report_view.xml',
|
||||
'data/account_report_actions.xml',
|
||||
'data/report_send_cron.xml',
|
||||
'data/menuitems.xml',
|
||||
'data/mail_activity_type_data.xml',
|
||||
'data/mail_templates.xml',
|
||||
|
||||
'security/ir.model.access.csv',
|
||||
'security/at_accounting_security.xml',
|
||||
'security/accounting_security.xml',
|
||||
|
||||
'views/account_account_views.xml',
|
||||
'views/account_fiscal_year_view.xml',
|
||||
'views/account_journal_dashboard_views.xml',
|
||||
'views/account_move_views.xml',
|
||||
'views/account_payment_views.xml',
|
||||
'views/account_reconcile_views.xml',
|
||||
'views/account_reconcile_model_views.xml',
|
||||
'views/at_accounting_menuitems.xml',
|
||||
'views/digest_views.xml',
|
||||
'views/res_config_settings_views.xml',
|
||||
'views/product_views.xml',
|
||||
'views/bank_rec_widget_views.xml',
|
||||
'views/report_invoice.xml',
|
||||
'views/partner_views.xml',
|
||||
'views/account_activity.xml',
|
||||
'views/account_tax_views.xml',
|
||||
'views/mail_activity_views.xml',
|
||||
'views/report_template.xml',
|
||||
'views/res_company_views.xml',
|
||||
'views/res_partner_views.xml',
|
||||
|
||||
'wizard/account_change_lock_date.xml',
|
||||
'wizard/account_auto_reconcile_wizard.xml',
|
||||
'wizard/account_reconcile_wizard.xml',
|
||||
'wizard/reconcile_model_wizard.xml',
|
||||
'wizard/account_report_send.xml',
|
||||
'wizard/multicurrency_revaluation.xml',
|
||||
'wizard/report_export_wizard.xml',
|
||||
'wizard/account_report_file_download_error_wizard.xml',
|
||||
'wizard/fiscal_year.xml',
|
||||
'wizard/mail_activity_schedule_views.xml',
|
||||
'security/at_account_asset_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/asset_modify_views.xml',
|
||||
# 'views/account_account_views.xml',
|
||||
'views/account_asset_views.xml',
|
||||
'views/account_asset_group_views.xml',
|
||||
# 'views/account_move_views.xml',
|
||||
'data/assets_reports.xml',
|
||||
'data/account_report_actions_depr.xml',
|
||||
'views/account_bank_statement_import_view.xml',
|
||||
|
||||
],
|
||||
'demo': [
|
||||
'demo/at_accounting_demo.xml',
|
||||
'demo/partner_bank.xml',
|
||||
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'post_init_hook': '_at_accounting_post_init',
|
||||
'uninstall_hook': "uninstall_hook",
|
||||
'license': 'OPL-1',
|
||||
'assets':{
|
||||
'web.assets_backend': [
|
||||
'at_accounting/static/src/js/tours/at_accounting.js',
|
||||
'at_accounting/static/src/components/**/*',
|
||||
'at_accounting/static/src/**/*.xml',
|
||||
'at_accounting/static/src/js/**/*',
|
||||
'at_accounting/static/src/widgets/**/*',
|
||||
# Root-level JS files not covered by the patterns above
|
||||
'at_accounting/static/src/account_bank_statement_import_model.js',
|
||||
'at_accounting/static/src/bank_statement_csv_import_action.js',
|
||||
'at_accounting/static/src/bank_statement_csv_import_model.js',
|
||||
# Bank reconciliation view files (outside /components/)
|
||||
'at_accounting/static/src/bank_reconciliation/**/*',
|
||||
# Backend-only SCSS (excludes PDF stylesheets and dark-mode files)
|
||||
'at_accounting/static/src/scss/account_asset.scss',
|
||||
],
|
||||
'web.assets_unit_tests': [
|
||||
'at_accounting/static/tests/**/*',
|
||||
('remove', 'at_accounting/static/tests/tours/**/*'),
|
||||
'at_accounting/static/tests/*.js',
|
||||
'at_accounting/static/tests/account_report/**/*.js',
|
||||
],
|
||||
'web.assets_tests': [
|
||||
'at_accounting/static/tests/tours/**/*',
|
||||
],
|
||||
'at_accounting.assets_pdf_export': [
|
||||
('include', 'web._assets_helpers'),
|
||||
'web/static/src/scss/pre_variables.scss',
|
||||
'web/static/lib/bootstrap/scss/_variables.scss',
|
||||
'web/static/lib/bootstrap/scss/_variables-dark.scss',
|
||||
'web/static/lib/bootstrap/scss/_maps.scss',
|
||||
('include', 'web._assets_bootstrap_backend'),
|
||||
'web/static/fonts/fonts.scss',
|
||||
'at_accounting/static/src/scss/**/*',
|
||||
],
|
||||
'web.report_assets_common': [
|
||||
'at_accounting/static/src/scss/account_pdf_export_template.scss',
|
||||
],
|
||||
'web.assets_web_dark': [
|
||||
'at_accounting/static/src/scss/*.dark.scss',
|
||||
],
|
||||
'web.qunit_suite_tests': [
|
||||
'at_accounting/static/tests/legacy/*.js',
|
||||
],
|
||||
},
|
||||
'images': ['static/description/banner.png'],
|
||||
}
|
||||
BIN
addons/at_accounting/__pycache__/__init__.cpython-312.pyc
Normal file
1
addons/at_accounting/controllers/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import main
|
||||
89
addons/at_accounting/controllers/main.py
Normal file
@@ -0,0 +1,89 @@
|
||||
import werkzeug
|
||||
from werkzeug.exceptions import InternalServerError
|
||||
|
||||
from odoo.addons.at_accounting.models.account_report import AccountReportFileDownloadException
|
||||
from odoo.addons.account.controllers.download_docs import _get_headers
|
||||
from odoo import http
|
||||
from odoo.models import check_method_name
|
||||
from odoo.http import content_disposition, request
|
||||
from odoo.tools.misc import html_escape
|
||||
|
||||
import json
|
||||
|
||||
|
||||
class AccountReportController(http.Controller):
|
||||
|
||||
@http.route('/at_accounting', type='http', auth='user', methods=['POST'], csrf=False)
|
||||
def get_report(self, options, file_generator, **kwargs):
|
||||
uid = request.uid
|
||||
options = json.loads(options)
|
||||
|
||||
allowed_company_ids = request.env['account.report'].get_report_company_ids(options)
|
||||
if not allowed_company_ids:
|
||||
company_str = request.cookies.get('cids', str(request.env.user.company_id.id))
|
||||
allowed_company_ids = [int(str_id) for str_id in company_str.split('-')]
|
||||
|
||||
report = request.env['account.report'].with_user(uid).with_context(allowed_company_ids=allowed_company_ids).browse(options['report_id'])
|
||||
|
||||
try:
|
||||
check_method_name(file_generator)
|
||||
generated_file_data = report.dispatch_report_action(options, file_generator)
|
||||
file_content = generated_file_data['file_content']
|
||||
file_type = generated_file_data['file_type']
|
||||
response_headers = self._get_response_headers(file_type, generated_file_data['file_name'], file_content)
|
||||
|
||||
if file_type == 'xlsx':
|
||||
response = request.make_response(None, headers=response_headers)
|
||||
response.stream.write(file_content)
|
||||
else:
|
||||
response = request.make_response(file_content, headers=response_headers)
|
||||
|
||||
if file_type in ('zip', 'xaf'):
|
||||
# Adding direct_passthrough to the response and giving it a file
|
||||
# as content means that we will stream the content of the file to the user
|
||||
# Which will prevent having the whole file in memory
|
||||
response.direct_passthrough = True
|
||||
|
||||
return response
|
||||
except AccountReportFileDownloadException as e:
|
||||
if e.content:
|
||||
e.content['file_content'] = e.content['file_content'].decode()
|
||||
data = {
|
||||
'name': type(e).__name__,
|
||||
'arguments': [e.errors, e.content],
|
||||
}
|
||||
raise InternalServerError(response=self._generate_response(data)) from e
|
||||
except Exception as e: # noqa: BLE001
|
||||
data = http.serialize_exception(e)
|
||||
raise InternalServerError(response=self._generate_response(data)) from e
|
||||
|
||||
def _generate_response(self, data):
|
||||
error = {
|
||||
'code': 200,
|
||||
'message': 'Odoo Server Error',
|
||||
'data': data,
|
||||
}
|
||||
return request.make_response(html_escape(json.dumps(error)))
|
||||
|
||||
def _get_response_headers(self, file_type, file_name, file_content):
|
||||
headers = [
|
||||
('Content-Type', request.env['account.report'].get_export_mime_type(file_type)),
|
||||
('Content-Disposition', content_disposition(file_name)),
|
||||
]
|
||||
|
||||
if file_type in ('xml', 'txt', 'csv', 'kvr', 'csv'):
|
||||
headers.append(('Content-Length', len(file_content)))
|
||||
|
||||
return headers
|
||||
|
||||
@http.route('/at_accounting/download_attachments/<models("ir.attachment"):attachments>', type='http', auth='user')
|
||||
def download_report_attachments(self, attachments):
|
||||
attachments.check_access('read')
|
||||
assert all(attachment.res_id and attachment.res_model == 'res.partner' for attachment in attachments)
|
||||
if len(attachments) == 1:
|
||||
headers = _get_headers(attachments.name, attachments.mimetype, attachments.raw)
|
||||
return request.make_response(attachments.raw, headers)
|
||||
else:
|
||||
content = attachments._build_zip_from_attachments()
|
||||
headers = _get_headers('attachments.zip', 'zip', content)
|
||||
return request.make_response(content, headers)
|
||||
160
addons/at_accounting/data/account_report_actions.xml
Normal file
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record id="action_account_report_cs" model="ir.actions.client">
|
||||
<field name="name">Cash Flow Statement</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.cash_flow_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_bs" model="ir.actions.client">
|
||||
<field name="name">Balance Sheet</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">balance-sheet</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.balance_sheet')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_exec_summary" model="ir.actions.client">
|
||||
<field name="name">Executive Summary</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">executive-summary</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.executive_summary')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_pl" model="ir.actions.client">
|
||||
<field name="name">Profit and Loss</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">profit-and-loss</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.profit_and_loss')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_gt" model="ir.actions.client">
|
||||
<field name="name">Tax Return</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">tax-report</field>
|
||||
<field name="context" eval="{'report_id': ref('account.generic_tax_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_ja" model="ir.actions.client">
|
||||
<field name="name">Journal Audit</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">journal-report</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.journal_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_general_ledger" model="ir.actions.client">
|
||||
<field name="name">General Ledger</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">general-ledger</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.general_ledger_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_multicurrency_revaluation" model="ir.actions.client">
|
||||
<field name="name">Unrealized Currency Gains/Losses</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.multicurrency_revaluation_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_ar" model="ir.actions.client">
|
||||
<field name="name">Aged Receivable</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">aged-receivable</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.aged_receivable_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_ap" model="ir.actions.client">
|
||||
<field name="name">Aged Payable</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">aged-payable</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.aged_payable_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_coa" model="ir.actions.client">
|
||||
<field name="name">Trial Balance</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">trial-balance</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.trial_balance_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_partner_ledger" model="ir.actions.client">
|
||||
<field name="name">Partner Ledger</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">partner-ledger</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.partner_ledger_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_sales" model="ir.actions.client">
|
||||
<field name="name">EC Sales List</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.generic_ec_sales_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_deferred_expense" model="ir.actions.client">
|
||||
<field name="name">Deferred Expense</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">deferred-expense</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.deferred_expense_report')}"/>
|
||||
</record>
|
||||
<record id="action_account_report_deferred_revenue" model="ir.actions.client">
|
||||
<field name="name">Deferred Revenue</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="path">deferred-revenue</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.deferred_revenue_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_current_year_earnings0" model="account.report.line">
|
||||
<field name="action_id" ref="action_account_report_pl"/>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_executivesummary_profitability0" model="account.report.line">
|
||||
<field name="action_id" ref="action_account_report_pl"/>
|
||||
</record>
|
||||
|
||||
<record id="account_financial_report_executivesummary_balancesheet0" model="account.report.line">
|
||||
<field name="action_id" ref="action_account_report_bs"/>
|
||||
</record>
|
||||
|
||||
<record id="action_create_report_menu" model="ir.actions.server">
|
||||
<field name="name">Create Menu Item</field>
|
||||
<field name="model_id" ref="account.model_account_report"/>
|
||||
<field name="binding_model_id" ref="account.model_account_report"/>
|
||||
<field name="state">code</field>
|
||||
<field name="binding_view_types">form</field>
|
||||
<field name="code">
|
||||
if records:
|
||||
action = records._create_menu_item_for_report()
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_tree" model="ir.actions.act_window">
|
||||
<field name="name">Accounting Reports</field>
|
||||
<field name="res_model">account.report</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="account_report_tree"/>
|
||||
<field name="search_view_id" ref="view_account_report_search"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_horizontal_groups" model="ir.actions.act_window">
|
||||
<field name="name">Horizontal Groups</field>
|
||||
<field name="res_model">account.report.horizontal.group</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="account_report_horizontal_group_tree"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_bank_reconciliation" model="ir.actions.client">
|
||||
<field name="name">Bank Reconciliation</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.bank_reconciliation_report')}"/>
|
||||
</record>
|
||||
|
||||
<record id="action_account_report_budget_tree" model="ir.actions.act_window">
|
||||
<field name="name">Financial Budgets</field>
|
||||
<field name="res_model">account.report.budget</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="view_id" ref="account_report_budget_tree"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
13
addons/at_accounting/data/account_report_actions_depr.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="action_account_report_assets" model="ir.actions.client">
|
||||
<field name="name">Depreciation Schedule</field>
|
||||
<field name="tag">account_report</field>
|
||||
<field name="context" eval="{'report_id': ref('at_accounting.assets_report')}"/>
|
||||
</record>
|
||||
<menuitem id="menu_action_account_report_assets"
|
||||
name="Depreciation Schedule"
|
||||
action="action_account_report_assets"
|
||||
parent="account.account_reports_management_menu"
|
||||
groups="account.group_account_readonly"/>
|
||||
</odoo>
|
||||
326
addons/at_accounting/data/aged_partner_balance.xml
Normal file
@@ -0,0 +1,326 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="aged_receivable_report" model="account.report">
|
||||
<field name="name">Aged Receivable</field>
|
||||
<field name="filter_date_range" eval="False"/>
|
||||
<field name="filter_unfold_all" eval="True"/>
|
||||
<field name="filter_partner" eval="True"/>
|
||||
<field name="filter_period_comparison" eval="False"/>
|
||||
<field name="filter_account_type">receivable</field>
|
||||
<field name="filter_hierarchy">never</field>
|
||||
<field name="filter_show_draft" eval="False"/>
|
||||
<field name="filter_multi_company">selector</field>
|
||||
<field name="default_opening_date_filter">today</field>
|
||||
<field name="custom_handler_model_id" ref="model_account_aged_receivable_report_handler"/>
|
||||
<field name="column_ids">
|
||||
<record id="aged_receivable_report_invoice_date" model="account.report.column">
|
||||
<field name="name">Invoice Date</field>
|
||||
<field name="expression_label">invoice_date</field>
|
||||
<field name="figure_type">date</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_report_amount_currency" model="account.report.column">
|
||||
<field name="name">Amount Currency</field>
|
||||
<field name="expression_label">amount_currency</field>
|
||||
</record>
|
||||
<record id="aged_receivable_report_currency" model="account.report.column">
|
||||
<field name="name">Currency</field>
|
||||
<field name="expression_label">currency</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="aged_receivable_report_account_name" model="account.report.column">
|
||||
<field name="name">Account</field>
|
||||
<field name="expression_label">account_name</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="aged_receivable_report_period0" model="account.report.column">
|
||||
<field name="name">At Date</field>
|
||||
<field name="expression_label">period0</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_report_period1" model="account.report.column">
|
||||
<field name="name">Period 1</field>
|
||||
<field name="expression_label">period1</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_report_period2" model="account.report.column">
|
||||
<field name="name">Period 2</field>
|
||||
<field name="expression_label">period2</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_report_period3" model="account.report.column">
|
||||
<field name="name">Period 3</field>
|
||||
<field name="expression_label">period3</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_report_period4" model="account.report.column">
|
||||
<field name="name">Period 4</field>
|
||||
<field name="expression_label">period4</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_report_period5" model="account.report.column">
|
||||
<field name="name">Older</field>
|
||||
<field name="expression_label">period5</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_report_total" model="account.report.column">
|
||||
<field name="name">Total</field>
|
||||
<field name="expression_label">total</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
</field>
|
||||
<field name="line_ids">
|
||||
<record id="aged_receivable_line" model="account.report.line">
|
||||
<field name="name">Aged Receivable</field>
|
||||
<field name="groupby">partner_id, id</field>
|
||||
<field name="expression_ids">
|
||||
<record id="aged_receivable_line_invoice_date" model="account.report.expression">
|
||||
<field name="label">invoice_date</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">invoice_date</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_amount_currency" model="account.report.expression">
|
||||
<field name="label">amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">amount_currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_amount_currency_forced_currency" model="account.report.expression">
|
||||
<field name="label">_currency_amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">currency_id</field>
|
||||
</record>
|
||||
<record id="aged_receivable_line_currency" model="account.report.expression">
|
||||
<field name="label">currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_account_name" model="account.report.expression">
|
||||
<field name="label">account_name</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">account_name</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_period0" model="account.report.expression">
|
||||
<field name="label">period0</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">period0</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_period1" model="account.report.expression">
|
||||
<field name="label">period1</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">period1</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_period2" model="account.report.expression">
|
||||
<field name="label">period2</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">period2</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_period3" model="account.report.expression">
|
||||
<field name="label">period3</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">period3</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_period4" model="account.report.expression">
|
||||
<field name="label">period4</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">period4</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_period5" model="account.report.expression">
|
||||
<field name="label">period5</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">period5</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_receivable_line_total" model="account.report.expression">
|
||||
<field name="label">total</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_receivable</field>
|
||||
<field name="subformula">total</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="aged_payable_report" model="account.report">
|
||||
<field name="name">Aged Payable</field>
|
||||
<field name="filter_date_range" eval="False"/>
|
||||
<field name="filter_unfold_all" eval="True"/>
|
||||
<field name="filter_partner" eval="True"/>
|
||||
<field name="filter_period_comparison" eval="False"/>
|
||||
<field name="filter_account_type">payable</field>
|
||||
<field name="filter_hierarchy">never</field>
|
||||
<field name="filter_show_draft" eval="False"/>
|
||||
<field name="filter_multi_company">selector</field>
|
||||
<field name="default_opening_date_filter">today</field>
|
||||
<field name="custom_handler_model_id" ref="model_account_aged_payable_report_handler"/>
|
||||
<field name="column_ids">
|
||||
<record id="aged_payable_report_invoice_date" model="account.report.column">
|
||||
<field name="name">Invoice Date</field>
|
||||
<field name="expression_label">invoice_date</field>
|
||||
<field name="figure_type">date</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_report_amount_currency" model="account.report.column">
|
||||
<field name="name">Amount Currency</field>
|
||||
<field name="expression_label">amount_currency</field>
|
||||
</record>
|
||||
<record id="aged_payable_report_currency" model="account.report.column">
|
||||
<field name="name">Currency</field>
|
||||
<field name="expression_label">currency</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="aged_payable_report_account_name" model="account.report.column">
|
||||
<field name="name">Account</field>
|
||||
<field name="expression_label">account_name</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="aged_payable_report_period0" model="account.report.column">
|
||||
<field name="name">At Date</field>
|
||||
<field name="expression_label">period0</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_report_period1" model="account.report.column">
|
||||
<field name="name">Period 1</field>
|
||||
<field name="expression_label">period1</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_report_period2" model="account.report.column">
|
||||
<field name="name">Period 2</field>
|
||||
<field name="expression_label">period2</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_report_period3" model="account.report.column">
|
||||
<field name="name">Period 3</field>
|
||||
<field name="expression_label">period3</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_report_period4" model="account.report.column">
|
||||
<field name="name">Period 4</field>
|
||||
<field name="expression_label">period4</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_report_period5" model="account.report.column">
|
||||
<field name="name">Older</field>
|
||||
<field name="expression_label">period5</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_report_total" model="account.report.column">
|
||||
<field name="name">Total</field>
|
||||
<field name="expression_label">total</field>
|
||||
<field name="sortable" eval="True"/>
|
||||
</record>
|
||||
</field>
|
||||
<field name="line_ids">
|
||||
<record id="aged_payable_line" model="account.report.line">
|
||||
<field name="name">Aged Payable</field>
|
||||
<field name="groupby">partner_id, id</field>
|
||||
<field name="expression_ids">
|
||||
<record id="aged_payable_line_invoice_date" model="account.report.expression">
|
||||
<field name="label">invoice_date</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">invoice_date</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_amount_currency" model="account.report.expression">
|
||||
<field name="label">amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">amount_currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_amount_currency_forced_currency" model="account.report.expression">
|
||||
<field name="label">_currency_amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">currency_id</field>
|
||||
</record>
|
||||
<record id="aged_payable_line_currency" model="account.report.expression">
|
||||
<field name="label">currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_account_name" model="account.report.expression">
|
||||
<field name="label">account_name</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">account_name</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_period0" model="account.report.expression">
|
||||
<field name="label">period0</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">period0</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_period1" model="account.report.expression">
|
||||
<field name="label">period1</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">period1</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_period2" model="account.report.expression">
|
||||
<field name="label">period2</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">period2</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_period3" model="account.report.expression">
|
||||
<field name="label">period3</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">period3</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_period4" model="account.report.expression">
|
||||
<field name="label">period4</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">period4</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_period5" model="account.report.expression">
|
||||
<field name="label">period5</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">period5</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="aged_payable_line_total" model="account.report.expression">
|
||||
<field name="label">total</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_aged_payable</field>
|
||||
<field name="subformula">total</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
70
addons/at_accounting/data/assets_reports.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="assets_report" model="account.report">
|
||||
<field name="name">Depreciation Schedule</field>
|
||||
<field name="filter_hierarchy">optional</field>
|
||||
<field name="filter_unfold_all" eval="True"/>
|
||||
<field name="filter_period_comparison" eval="False"/>
|
||||
<field name="filter_journals" eval="True"/>
|
||||
<field name="custom_handler_model_id" ref="model_account_asset_report_handler"/>
|
||||
<field name="load_more_limit" eval="80"/>
|
||||
<field name="column_ids">
|
||||
<record id="assets_report_acquisition_date" model="account.report.column">
|
||||
<field name="name">Acquisition Date</field>
|
||||
<field name="expression_label">acquisition_date</field>
|
||||
<field name="figure_type">date</field>
|
||||
</record>
|
||||
<record id="assets_report_first_depreciation" model="account.report.column">
|
||||
<field name="name">First Depreciation</field>
|
||||
<field name="expression_label">first_depreciation</field>
|
||||
<field name="figure_type">date</field>
|
||||
</record>
|
||||
<record id="assets_report_first_method" model="account.report.column">
|
||||
<field name="name">Method</field>
|
||||
<field name="expression_label">method</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="assets_report_duration_rate" model="account.report.column">
|
||||
<field name="name">Duration / Rate</field>
|
||||
<field name="expression_label">duration_rate</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="assets_report_date_from" model="account.report.column">
|
||||
<field name="name">date from</field>
|
||||
<field name="expression_label">assets_date_from</field>
|
||||
</record>
|
||||
<record id="assets_report_assets_plus" model="account.report.column">
|
||||
<field name="name">+</field>
|
||||
<field name="expression_label">assets_plus</field>
|
||||
</record>
|
||||
<record id="assets_report_assets_minus" model="account.report.column">
|
||||
<field name="name">-</field>
|
||||
<field name="expression_label">assets_minus</field>
|
||||
</record>
|
||||
<record id="assets_report_assets_date_to" model="account.report.column">
|
||||
<field name="name">date to</field>
|
||||
<field name="expression_label">assets_date_to</field>
|
||||
</record>
|
||||
<record id="assets_report_depre_date_from" model="account.report.column">
|
||||
<field name="name">date from</field>
|
||||
<field name="expression_label">depre_date_from</field>
|
||||
</record>
|
||||
<record id="assets_report_depre_plus" model="account.report.column">
|
||||
<field name="name">+</field>
|
||||
<field name="expression_label">depre_plus</field>
|
||||
</record>
|
||||
<record id="assets_report_depre_minus" model="account.report.column">
|
||||
<field name="name">-</field>
|
||||
<field name="expression_label">depre_minus</field>
|
||||
</record>
|
||||
<record id="assets_report_depre_date_to" model="account.report.column">
|
||||
<field name="name">date to</field>
|
||||
<field name="expression_label">depre_date_to</field>
|
||||
</record>
|
||||
<record id="assets_report_balance" model="account.report.column">
|
||||
<field name="name">book_value</field>
|
||||
<field name="expression_label">balance</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
32
addons/at_accounting/data/at_accounting_data.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- Switch root menu "Invoicing" to "Accounting" -->
|
||||
<!-- Top menu item -->
|
||||
<menuitem name="Accounting"
|
||||
id="menu_accounting"
|
||||
groups="account.group_account_readonly,account.group_account_invoice"
|
||||
web_icon="at_accounting,static/description/icon.png"
|
||||
sequence="60"/>
|
||||
<!-- move existing submenus to point to the new parent -->
|
||||
<record id="account.menu_finance_receivables" model="ir.ui.menu">
|
||||
<field name="parent_id" ref="menu_accounting"/>
|
||||
</record>
|
||||
<record id="account.menu_finance_payables" model="ir.ui.menu">
|
||||
<field name="parent_id" ref="menu_accounting"/>
|
||||
</record>
|
||||
<record id="account.menu_finance_entries" model="ir.ui.menu">
|
||||
<field name="parent_id" ref="menu_accounting"/>
|
||||
</record>
|
||||
<record id="account.menu_finance_reports" model="ir.ui.menu">
|
||||
<field name="parent_id" ref="menu_accounting"/>
|
||||
</record>
|
||||
<record id="account.menu_finance_configuration" model="ir.ui.menu">
|
||||
<field name="parent_id" ref="menu_accounting"/>
|
||||
</record>
|
||||
<record id="account.menu_board_journal_1" model="ir.ui.menu">
|
||||
<field name="parent_id" ref="menu_accounting"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="account.menu_account_config" name="Settings" parent="account.menu_finance_configuration" sequence="0" groups="base.group_system"/>
|
||||
|
||||
</odoo>
|
||||
11
addons/at_accounting/data/at_accounting_tour.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="account_accountant_tour" model="web_tour.tour">
|
||||
<field name="name">account_accountant_tour</field>
|
||||
<field name="sequence">50</field>
|
||||
<field name="rainbow_man_message"><![CDATA[
|
||||
<strong><b>Good job!</b> You went through all steps of this tour.</strong>
|
||||
<br>See how to manage your customer invoices in the <b>Customers/Invoices</b> menu
|
||||
]]></field>
|
||||
</record>
|
||||
</odoo>
|
||||
285
addons/at_accounting/data/balance_sheet.xml
Normal file
@@ -0,0 +1,285 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="balance_sheet" model="account.report">
|
||||
<field name="name">Balance Sheet</field>
|
||||
<field name="filter_date_range" eval="False"/>
|
||||
<field name="filter_analytic_groupby" eval="True"/>
|
||||
<field name="filter_unfold_all" eval="True"/>
|
||||
<field name="filter_journals" eval="True"/>
|
||||
<field name="filter_multi_company">selector</field>
|
||||
<field name="default_opening_date_filter">today</field>
|
||||
<field name="custom_handler_model_id" ref="model_account_balance_sheet_report_handler"/>
|
||||
<field name="column_ids">
|
||||
<record id="balance_sheet_balance" model="account.report.column">
|
||||
<field name="name">Balance</field>
|
||||
<field name="expression_label">balance</field>
|
||||
</record>
|
||||
</field>
|
||||
<field name="line_ids">
|
||||
<record id="account_financial_report_total_assets0" model="account.report.line">
|
||||
<field name="name">ASSETS</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="code">TA</field>
|
||||
<field name="horizontal_split_side">left</field>
|
||||
<field name="aggregation_formula">CA.balance + FA.balance + PNCA.balance</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_report_current_assets_view0" model="account.report.line">
|
||||
<field name="name">Current Assets</field>
|
||||
<field name="code">CA</field>
|
||||
<field name="aggregation_formula">BA.balance + REC.balance + CAS.balance + PRE.balance</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_report_bank_view0" model="account.report.line">
|
||||
<field name="name">Bank and Cash Accounts</field>
|
||||
<field name="code">BA</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="domain_formula">sum([('account_id.account_type', '=', 'asset_cash')])</field>
|
||||
</record>
|
||||
<record id="account_financial_report_receivable0" model="account.report.line">
|
||||
<field name="name">Receivables</field>
|
||||
<field name="code">REC</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="domain_formula">sum([('account_id.account_type', '=', 'asset_receivable'), ('account_id.non_trade', '=', False)])</field>
|
||||
</record>
|
||||
<record id="account_financial_report_current_assets0" model="account.report.line">
|
||||
<field name="name">Current Assets</field>
|
||||
<field name="code">CAS</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="domain_formula">sum(['|', ('account_id.account_type', '=', 'asset_current'), '&', ('account_id.account_type', '=', 'asset_receivable'), ('account_id.non_trade', '=', True)])</field>
|
||||
</record>
|
||||
<record id="account_financial_report_prepayements0" model="account.report.line">
|
||||
<field name="name">Prepayments</field>
|
||||
<field name="code">PRE</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="domain_formula">sum([('account_id.account_type', '=', 'asset_prepayments')])</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_fixed_assets_view0" model="account.report.line">
|
||||
<field name="name">Plus Fixed Assets</field>
|
||||
<field name="code">FA</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="domain_formula">sum([('account_id.account_type', '=', 'asset_fixed')])</field>
|
||||
</record>
|
||||
<record id="account_financial_report_non_current_assets_view0" model="account.report.line">
|
||||
<field name="name">Plus Non-current Assets</field>
|
||||
<field name="code">PNCA</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="domain_formula">sum([('account_id.account_type', '=', 'asset_non_current')])</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_liabilities_view0" model="account.report.line">
|
||||
<field name="name">LIABILITIES</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="code">L</field>
|
||||
<field name="horizontal_split_side">right</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_liabilities_view0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">CL.balance + NL.balance</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_report_current_liabilities0" model="account.report.line">
|
||||
<field name="name">Current Liabilities</field>
|
||||
<field name="code">CL</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_current_liabilities0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">CL1.balance + CL2.balance</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_report_current_liabilities1" model="account.report.line">
|
||||
<field name="name">Current Liabilities</field>
|
||||
<field name="code">CL1</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_current_liabilities1_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="['|', ('account_id.account_type', 'in', ('liability_current', 'liability_credit_card')), '&', ('account_id.account_type', '=', 'liability_payable'), ('account_id.non_trade', '=', True)]"/>
|
||||
<field name="subformula">-sum</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_current_liabilities_payable" model="account.report.line">
|
||||
<field name="name">Payables</field>
|
||||
<field name="code">CL2</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_current_liabilities_payable_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', '=', 'liability_payable'), ('account_id.non_trade', '=', False)]"/>
|
||||
<field name="subformula">-sum</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_non_current_liabilities0" model="account.report.line">
|
||||
<field name="name">Plus Non-current Liabilities</field>
|
||||
<field name="code">NL</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_non_current_liabilities0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', '=', 'liability_non_current')]"/>
|
||||
<field name="subformula">-sum</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_equity0" model="account.report.line">
|
||||
<field name="name">EQUITY</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="code">EQ</field>
|
||||
<field name="horizontal_split_side">right</field>
|
||||
<field name="aggregation_formula">UNAFFECTED_EARNINGS.balance + RETAINED_EARNINGS.balance</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_unaffected_earnings0" model="account.report.line">
|
||||
<field name="name">Unallocated Earnings</field>
|
||||
<field name="code">UNAFFECTED_EARNINGS</field>
|
||||
<field name="aggregation_formula">CURR_YEAR_EARNINGS.balance + PREV_YEAR_EARNINGS.balance</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_current_year_earnings0" model="account.report.line">
|
||||
<field name="name">Current Year Unallocated Earnings</field>
|
||||
<field name="code">CURR_YEAR_EARNINGS</field>
|
||||
<field name="aggregation_formula"/>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_current_year_earnings_pnl" model="account.report.expression">
|
||||
<field name="label">pnl</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">NEP.balance</field>
|
||||
<field name="date_scope">from_fiscalyear</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
<record id="account_financial_current_year_earnings_alloc" model="account.report.expression">
|
||||
<field name="label">alloc</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', '=', 'equity_unaffected')]"/>
|
||||
<field name="date_scope">from_fiscalyear</field>
|
||||
<field name="subformula">-sum</field>
|
||||
</record>
|
||||
<record id="account_financial_current_year_earnings_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">CURR_YEAR_EARNINGS.pnl + CURR_YEAR_EARNINGS.alloc</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_previous_year_earnings0" model="account.report.line">
|
||||
<field name="name">Previous Years Unallocated Earnings</field>
|
||||
<field name="code">PREV_YEAR_EARNINGS</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_previous_year_earnings0_allocated_earnings" model="account.report.expression">
|
||||
<field name="label">allocated_earnings</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', '=', 'equity_unaffected')]"/>
|
||||
<field name="subformula">-sum</field>
|
||||
<field name="date_scope">from_beginning</field>
|
||||
</record>
|
||||
<record id="account_financial_previous_year_earnings0_balance_domain" model="account.report.expression">
|
||||
<field name="label">balance_domain</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', 'in', ('income', 'income_other', 'expense_direct_cost', 'expense', 'expense_depreciation'))]"/>
|
||||
<field name="subformula">-sum</field>
|
||||
<field name="date_scope">from_beginning</field>
|
||||
</record>
|
||||
<record id="account_financial_previous_year_earnings0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">PREV_YEAR_EARNINGS.balance_domain + PREV_YEAR_EARNINGS.allocated_earnings - CURR_YEAR_EARNINGS.balance</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_retained_earnings0" model="account.report.line">
|
||||
<field name="name">Retained Earnings</field>
|
||||
<field name="code">RETAINED_EARNINGS</field>
|
||||
<field name="aggregation_formula">CURR_RETAINED_EARNINGS.balance + PREV_RETAINED_EARNINGS.balance</field>
|
||||
<field name="groupby" eval="False"/>
|
||||
<field name="foldable" eval="False"/>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_retained_earnings_line_1" model="account.report.line">
|
||||
<field name="name">Current Year Retained Earnings</field>
|
||||
<field name="code">CURR_RETAINED_EARNINGS</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_retained_earnings_current" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', '=', 'equity')]"/>
|
||||
<field name="subformula">-sum</field>
|
||||
<field name="date_scope">from_fiscalyear</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_retained_earnings_line_2" model="account.report.line">
|
||||
<field name="name">Previous Years Retained Earnings</field>
|
||||
<field name="code">PREV_RETAINED_EARNINGS</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_retained_earnings_total" model="account.report.expression">
|
||||
<field name="label">total</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', '=', 'equity')]"/>
|
||||
<field name="subformula">-sum</field>
|
||||
</record>
|
||||
<record id="account_financial_retained_earnings_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">PREV_RETAINED_EARNINGS.total - CURR_RETAINED_EARNINGS.balance</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_liabilities_and_equity_view0" model="account.report.line">
|
||||
<field name="name">LIABILITIES + EQUITY</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="code">LE</field>
|
||||
<field name="horizontal_split_side">right</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_liabilities_and_equity_view0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">L.balance + EQ.balance</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_off_sheet" model="account.report.line">
|
||||
<field name="name">OFF BALANCE SHEET ACCOUNTS</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="code">OS</field>
|
||||
<field name="groupby">account_id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="hide_if_zero" eval="1"/>
|
||||
<field name="domain_formula">-sum([('account_id.account_type', '=', 'off_balance')])</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
474
addons/at_accounting/data/bank_reconciliation_report.xml
Normal file
@@ -0,0 +1,474 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="bank_reconciliation_report" model="account.report">
|
||||
<field name="name">Bank Reconciliation Report</field>
|
||||
<field name="filter_show_draft" eval="True"/>
|
||||
<field name="filter_date_range" eval="False"/>
|
||||
<field name="filter_period_comparison" eval="False"/>
|
||||
<field name="filter_hide_0_lines">by_default</field>
|
||||
<field name="search_bar" eval="True"/>
|
||||
<field name="default_opening_date_filter">today</field>
|
||||
<field name="custom_handler_model_id" ref="model_account_bank_reconciliation_report_handler"/>
|
||||
<field name="column_ids">
|
||||
<record id="bank_reconciliation_report_date" model="account.report.column">
|
||||
<field name="name">Date</field>
|
||||
<field name="expression_label">date</field>
|
||||
<field name="figure_type">date</field>
|
||||
</record>
|
||||
<record id="bank_reconciliation_report_label" model="account.report.column">
|
||||
<field name="name">Label</field>
|
||||
<field name="expression_label">label</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="bank_reconciliation_report_amount_currency" model="account.report.column">
|
||||
<field name="name">Amount Currency</field>
|
||||
<field name="expression_label">amount_currency</field>
|
||||
<field name="figure_type">monetary</field>
|
||||
</record>
|
||||
<record id="bank_reconciliation_report_currency" model="account.report.column">
|
||||
<field name="name">Currency</field>
|
||||
<field name="expression_label">currency</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="bank_reconciliation_report_amount" model="account.report.column">
|
||||
<field name="name">Amount</field>
|
||||
<field name="expression_label">amount</field>
|
||||
<field name="figure_type">monetary</field>
|
||||
</record>
|
||||
</field>
|
||||
<field name="line_ids">
|
||||
<record id="balance_bank" model="account.report.line">
|
||||
<field name="name">Balance of Bank</field>
|
||||
<field name="code">balance_bank</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="expression_ids">
|
||||
<record id="balance_bank_expr" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">last_statement_balance.amount + transaction_without_statement.amount + misc_operations.amount</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="balance_bank_expr_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_forced_currency_amount</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
<field name="children_ids">
|
||||
<record id="last_statement_balance" model="account.report.line">
|
||||
<field name="name">Last statement balance</field>
|
||||
<field name="code">last_statement_balance</field>
|
||||
<field name="expression_ids">
|
||||
<record id="last_statement_balance_amount" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_last_statement_balance_amount</field>
|
||||
<field name="subformula">amount</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="last_statement_balance_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_last_statement_balance_amount</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
<field name="children_ids">
|
||||
<record id="unreconciled_last_statement_receipts" model="account.report.line">
|
||||
<field name="name">Including Unreconciled Receipts</field>
|
||||
<field name="code">last_statement_receipts</field>
|
||||
<field name="groupby">id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="unreconciled_last_statement_receipts_date" model="account.report.expression">
|
||||
<field name="label">date</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_receipts</field>
|
||||
<field name="subformula">date</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_receipts_label" model="account.report.expression">
|
||||
<field name="label">label</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_receipts</field>
|
||||
<field name="subformula">label</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_receipts_amount_currency" model="account.report.expression">
|
||||
<field name="label">amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_receipts</field>
|
||||
<field name="subformula">amount_currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_receipts_forced_currency_amount_currency" model="account.report.expression">
|
||||
<field name="label">_currency_amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_receipts</field>
|
||||
<field name="subformula">amount_currency_currency_id</field>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_receipts_currency" model="account.report.expression">
|
||||
<field name="label">currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_receipts</field>
|
||||
<field name="subformula">currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_receipts_amount" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_receipts</field>
|
||||
<field name="subformula">amount</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_receipts_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_receipts</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_payments" model="account.report.line">
|
||||
<field name="name">Including Unreconciled Payments</field>
|
||||
<field name="code">last_statement_payments</field>
|
||||
<field name="groupby">id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="unreconciled_last_statement_payments_date" model="account.report.expression">
|
||||
<field name="label">date</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_payments</field>
|
||||
<field name="subformula">date</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_payments_label" model="account.report.expression">
|
||||
<field name="label">label</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_payments</field>
|
||||
<field name="subformula">label</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_payments_amount_currency" model="account.report.expression">
|
||||
<field name="label">amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_payments</field>
|
||||
<field name="subformula">amount_currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_payments_forced_currency_amount_currency" model="account.report.expression">
|
||||
<field name="label">_currency_amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_payments</field>
|
||||
<field name="subformula">amount_currency_currency_id</field>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_payments_currency" model="account.report.expression">
|
||||
<field name="label">currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_payments</field>
|
||||
<field name="subformula">currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_payments_amount" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_payments</field>
|
||||
<field name="subformula">amount</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="unreconciled_last_statement_payments_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_last_statement_payments</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="transaction_without_statement" model="account.report.line">
|
||||
<field name="name">Transactions without statement</field>
|
||||
<field name="code">transaction_without_statement</field>
|
||||
<field name="expression_ids">
|
||||
<record id="transaction_without_statement_expr" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_transaction_without_statement_amount</field>
|
||||
<field name="subformula">amount</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="transaction_without_statement_expr_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_transaction_without_statement_amount</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
<field name="children_ids">
|
||||
<record id="no_statement_unreconciled_receipt" model="account.report.line">
|
||||
<field name="name">Including Unreconciled Receipts</field>
|
||||
<field name="code">unreconciled_receipt</field>
|
||||
<field name="groupby">id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="no_statement_unreconciled_receipt_date" model="account.report.expression">
|
||||
<field name="label">date</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_receipts</field>
|
||||
<field name="subformula">date</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_receipt_label" model="account.report.expression">
|
||||
<field name="label">label</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_receipts</field>
|
||||
<field name="subformula">label</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_receipt_amount_currency" model="account.report.expression">
|
||||
<field name="label">amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_receipts</field>
|
||||
<field name="subformula">amount_currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_receipt_forced_currency_amount_currency" model="account.report.expression">
|
||||
<field name="label">_currency_amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_receipts</field>
|
||||
<field name="subformula">amount_currency_currency_id</field>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_receipt_currency" model="account.report.expression">
|
||||
<field name="label">currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_receipts</field>
|
||||
<field name="subformula">currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_receipt_amount" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_receipts</field>
|
||||
<field name="subformula">amount</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_receipt_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_receipts</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_payments" model="account.report.line">
|
||||
<field name="name">Including Unreconciled Payments</field>
|
||||
<field name="code">unreconciled_payments</field>
|
||||
<field name="groupby">id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="no_statement_unreconciled_payments_date" model="account.report.expression">
|
||||
<field name="label">date</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_payments</field>
|
||||
<field name="subformula">date</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_payments_label" model="account.report.expression">
|
||||
<field name="label">label</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_payments</field>
|
||||
<field name="subformula">label</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_payments_amount_currency" model="account.report.expression">
|
||||
<field name="label">amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_payments</field>
|
||||
<field name="subformula">amount_currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_payments_forced_currency_amount_currency" model="account.report.expression">
|
||||
<field name="label">_currency_amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_payments</field>
|
||||
<field name="subformula">amount_currency_currency_id</field>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_payments_currency" model="account.report.expression">
|
||||
<field name="label">currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_payments</field>
|
||||
<field name="subformula">currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_payments_amount" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_payments</field>
|
||||
<field name="subformula">amount</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="no_statement_unreconciled_payments_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_unreconciled_payments</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="misc_operations" model="account.report.line">
|
||||
<field name="name">Misc. operations</field>
|
||||
<field name="code">misc_operations</field>
|
||||
<field name="expression_ids">
|
||||
<record id="misc_operations_amount" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_misc_operations</field>
|
||||
<field name="subformula">amount</field>
|
||||
<field name="auditable" eval="True"/>
|
||||
</record>
|
||||
<record id="misc_operations_amount_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_misc_operations</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="outstanding" model="account.report.line">
|
||||
<field name="name">Outstanding Receipts/Payments</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="expression_ids">
|
||||
<record id="outstanding_expr" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">outstanding_receipts.amount + outstanding_payments.amount</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_expr_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_forced_currency_amount</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
<field name="children_ids">
|
||||
<record id="outstanding_receipts" model="account.report.line">
|
||||
<field name="name">(+) Outstanding Receipts</field>
|
||||
<field name="code">outstanding_receipts</field>
|
||||
<field name="groupby">id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="outstanding_receipts_date" model="account.report.expression">
|
||||
<field name="label">date</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_receipts</field>
|
||||
<field name="subformula">date</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_receipts_label" model="account.report.expression">
|
||||
<field name="label">label</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_receipts</field>
|
||||
<field name="subformula">label</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_receipts_amount_currency" model="account.report.expression">
|
||||
<field name="label">amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_receipts</field>
|
||||
<field name="subformula">amount_currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_receipts_forced_currency_amount_currency" model="account.report.expression">
|
||||
<field name="label">_currency_amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_receipts</field>
|
||||
<field name="subformula">amount_currency_currency_id</field>
|
||||
</record>
|
||||
<record id="outstanding_receipts_currency" model="account.report.expression">
|
||||
<field name="label">currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_receipts</field>
|
||||
<field name="subformula">currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_receipts_amount" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_receipts</field>
|
||||
<field name="subformula">amount</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_receipts_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_receipts</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="outstanding_payments" model="account.report.line">
|
||||
<field name="name">(-) Outstanding Payments</field>
|
||||
<field name="code">outstanding_payments</field>
|
||||
<field name="groupby">id</field>
|
||||
<field name="foldable" eval="True"/>
|
||||
<field name="expression_ids">
|
||||
<record id="outstanding_payments_date" model="account.report.expression">
|
||||
<field name="label">date</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_payments</field>
|
||||
<field name="subformula">date</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_payments_label" model="account.report.expression">
|
||||
<field name="label">label</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_payments</field>
|
||||
<field name="subformula">label</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_payments_amount_currency" model="account.report.expression">
|
||||
<field name="label">amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_payments</field>
|
||||
<field name="subformula">amount_currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_payments_forced_currency_amount_currency" model="account.report.expression">
|
||||
<field name="label">_currency_amount_currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_payments</field>
|
||||
<field name="subformula">amount_currency_currency_id</field>
|
||||
</record>
|
||||
<record id="outstanding_payments_currency" model="account.report.expression">
|
||||
<field name="label">currency</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_payments</field>
|
||||
<field name="subformula">currency</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_payments_amount" model="account.report.expression">
|
||||
<field name="label">amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_payments</field>
|
||||
<field name="subformula">amount</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="outstanding_payments_forced_currency_amount" model="account.report.expression">
|
||||
<field name="label">_currency_amount</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_outstanding_payments</field>
|
||||
<field name="subformula">amount_currency_id</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
19
addons/at_accounting/data/cash_flow_report.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="cash_flow_report" model="account.report">
|
||||
<field name="name">Cash Flow Statement</field>
|
||||
<field name="filter_unfold_all" eval="True"/>
|
||||
<field name="filter_date_range" eval="True"/>
|
||||
<field name="filter_journals" eval="True"/>
|
||||
<field name="filter_period_comparison" eval="False"/>
|
||||
<field name="filter_multi_company">selector</field>
|
||||
<field name="currency_translation">current</field>
|
||||
<field name="custom_handler_model_id" ref="model_account_cash_flow_report_handler"/>
|
||||
<field name="column_ids">
|
||||
<record id="cash_flow_report_balance" model="account.report.column">
|
||||
<field name="name">Balance</field>
|
||||
<field name="expression_label">balance</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
43
addons/at_accounting/data/deferred_reports.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="deferred_expense_report" model="account.report">
|
||||
<field name="name">Deferred Expense Report</field>
|
||||
<field name="filter_journals" eval="True"/>
|
||||
<field name="filter_analytic" eval="True"/>
|
||||
<field name="filter_period_comparison" eval="True"/>
|
||||
<field name="filter_growth_comparison" eval="False"/>
|
||||
<field name="filter_multi_company">selector</field>
|
||||
<field name="filter_unfold_all" eval="True"/>
|
||||
<field name="filter_hierarchy">by_default</field>
|
||||
<field name="default_opening_date_filter">previous_month</field>
|
||||
<field name="search_bar" eval="True"/>
|
||||
<field name="custom_handler_model_id" ref="model_account_deferred_expense_report_handler"/>
|
||||
<field name="column_ids">
|
||||
<record id="deferred_expense_current" model="account.report.column">
|
||||
<field name="name">Current</field>
|
||||
<field name="expression_label">current</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="deferred_revenue_report" model="account.report">
|
||||
<field name="name">Deferred Revenue Report</field>
|
||||
<field name="filter_journals" eval="True"/>
|
||||
<field name="filter_analytic" eval="True"/>
|
||||
<field name="filter_period_comparison" eval="True"/>
|
||||
<field name="filter_growth_comparison" eval="False"/>
|
||||
<field name="filter_multi_company">selector</field>
|
||||
<field name="filter_unfold_all" eval="True"/>
|
||||
<field name="filter_hierarchy">by_default</field>
|
||||
<field name="default_opening_date_filter">previous_month</field>
|
||||
<field name="search_bar" eval="True"/>
|
||||
<field name="custom_handler_model_id" ref="model_account_deferred_revenue_report_handler"/>
|
||||
<field name="column_ids">
|
||||
<record id="deferred_revenue_current" model="account.report.column">
|
||||
<field name="name">Current</field>
|
||||
<field name="expression_label">current</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
37
addons/at_accounting/data/digest_data.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record id="digest.digest_digest_default" model="digest.digest">
|
||||
<field name="kpi_account_bank_cash">True</field>
|
||||
</record>
|
||||
</data>
|
||||
<data noupdate="0">
|
||||
<record id="digest_tip_account_accountant_0" model="digest.tip">
|
||||
<field name="name">Tip: Bulk update journal items</field>
|
||||
<field name="sequence">900</field>
|
||||
<field name="group_id" ref="account.group_account_user" />
|
||||
<field name="tip_description" type="html">
|
||||
<div>
|
||||
<b class="tip_title">Tip: Bulk update journal items</b>
|
||||
<p class="tip_content">From any list view, select multiple records and the list becomes editable. If you update a cell, selected records are updated all at once. Use this feature to update multiple journal entries from the General Ledger, or any Journal view.</p>
|
||||
<img src="https://download.odoocdn.com/digests/at_accounting/static/src/img/milk-accounting-bulk.gif" width="540" class="illustration_border" />
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
<record id="digest_tip_account_accountant_1" model="digest.tip">
|
||||
<field name="name">Tip: Find an Accountant or register your Accounting Firm</field>
|
||||
<field name="sequence">1000</field>
|
||||
<field name="group_id" ref="account.group_account_user" />
|
||||
<field name="tip_description" type="html">
|
||||
<div>
|
||||
<b class="tip_title">Tip: Find an Accountant or register your Accounting Firm</b>
|
||||
<p class="tip_content">Click here to find an accountant or if you want to list out your accounting services on Odoo</p>
|
||||
<p class="mt-3">
|
||||
<a class="tip_button" href="https://odoo.com/accounting-firms" target="_blank"><span class="tip_button_text">Find an Accountant</span></a>
|
||||
<a class="tip_button" href="https://odoo.com/accounting-firms/register" target="_blank"><span class="tip_button_text">Register your Accounting Firm</span></a>
|
||||
</p>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
395
addons/at_accounting/data/executive_summary.xml
Normal file
@@ -0,0 +1,395 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="executive_summary" model="account.report">
|
||||
<field name="name">Executive Summary</field>
|
||||
<field name="filter_multi_company">selector</field>
|
||||
<field name="default_opening_date_filter">this_year</field>
|
||||
<field name="column_ids">
|
||||
<record id="executive_summary_column" model="account.report.column">
|
||||
<field name="name">Balance</field>
|
||||
<field name="expression_label">balance</field>
|
||||
</record>
|
||||
</field>
|
||||
<field name="line_ids">
|
||||
<record id="account_financial_report_executivesummary_cash0" model="account.report.line">
|
||||
<field name="name">Cash</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_report_executivesummary_cash_received0" model="account.report.line">
|
||||
<field name="name">Cash received</field>
|
||||
<field name="code">CR</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_cash_received0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', 'in', ('asset_cash', 'liability_credit_card')), ('debit', '>', 0.0)]"/>
|
||||
<field name="subformula">sum</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_cash_spent0" model="account.report.line">
|
||||
<field name="name">Cash spent</field>
|
||||
<field name="code">CS</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_cash_spent0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', 'in', ('asset_cash', 'liability_credit_card')), ('credit', '>', 0.0)]"/>
|
||||
<field name="subformula">sum</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_cash_surplus0" model="account.report.line">
|
||||
<field name="name">Cash surplus</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_cash_surplus0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">CR.balance + CS.balance</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_closing_bank_balance0" model="account.report.line">
|
||||
<field name="name">Closing bank balance</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_closing_bank_balance0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', 'in', ('asset_cash', 'liability_credit_card'))]"/>
|
||||
<field name="date_scope">from_beginning</field>
|
||||
<field name="subformula">sum</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_profitability0" model="account.report.line">
|
||||
<field name="name">Profitability</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_report_executivesummary_income0" model="account.report.line">
|
||||
<field name="name">Revenue</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_income0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">REV.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_direct_costs0" model="account.report.line">
|
||||
<field name="name">Cost of Revenue</field>
|
||||
<field name="code">EXEC_COS</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_direct_costs0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">COS.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_gross_profit0" model="account.report.line">
|
||||
<field name="name">Gross profit</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_gross_profit0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">GRP.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_expenses0" model="account.report.line">
|
||||
<field name="name">Expenses</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_expenses0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">EXP.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_profit0" model="account.report.line">
|
||||
<field name="name">Net Profit</field>
|
||||
<field name="code">EXEC_NEP</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_profit0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">NEP.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_balancesheet0" model="account.report.line">
|
||||
<field name="name">Balance Sheet</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_report_executivesummary_debtors0" model="account.report.line">
|
||||
<field name="name">Receivables</field>
|
||||
<field name="code">DEB</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_debtors0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', '=', 'asset_receivable')]"/>
|
||||
<field name="date_scope">from_beginning</field>
|
||||
<field name="subformula">sum</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_creditors0" model="account.report.line">
|
||||
<field name="name">Payables</field>
|
||||
<field name="code">CRE</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_creditors0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">domain</field>
|
||||
<field name="formula" eval="[('account_id.account_type', '=', 'liability_payable')]"/>
|
||||
<field name="date_scope">from_beginning</field>
|
||||
<field name="subformula">sum</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_net_assets0" model="account.report.line">
|
||||
<field name="name">Net assets</field>
|
||||
<field name="code">EXEC_SUMMARY_NA</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_net_assets0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">TA.balance - L.balance</field>
|
||||
<field name="date_scope">from_beginning</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_performance0" model="account.report.line">
|
||||
<field name="name">Performance</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_report_executivesummary_gpmargin0" model="account.report.line">
|
||||
<field name="name">Gross profit margin (gross profit / operating income)</field>
|
||||
<field name="code">GPMARGIN0</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_gpmargin0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">GPMARGIN0.grp / GPMARGIN0.opinc * 100</field>
|
||||
<field name="subformula">ignore_zero_division</field>
|
||||
<field name="figure_type">percentage</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_gpmargin0_grp" model="account.report.expression">
|
||||
<field name="label">grp</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">GRP.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_gpmargin0_opinc" model="account.report.expression">
|
||||
<field name="label">opinc</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">REV.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_npmargin0" model="account.report.line">
|
||||
<field name="name">Net profit margin (net profit / income)</field>
|
||||
<field name="code">NPMARGIN0</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_npmargin0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">NPMARGIN0.nep / NPMARGIN0.inc * 100</field>
|
||||
<field name="subformula">ignore_zero_division</field>
|
||||
<field name="figure_type">percentage</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_npmargin0_nep" model="account.report.expression">
|
||||
<field name="label">nep</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">NEP.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_npmargin0_inc" model="account.report.expression">
|
||||
<field name="label">inc</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">INC.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_return_investment0" model="account.report.line">
|
||||
<field name="name">Return on investments (net profit / assets)</field>
|
||||
<field name="code">ROI</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_return_investment0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">ROI.nep / ROI.ta * 100</field>
|
||||
<field name="subformula">ignore_zero_division</field>
|
||||
<field name="figure_type">percentage</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_return_investment0_nep" model="account.report.expression">
|
||||
<field name="label">nep</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">NEP.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_return_investment0_ta" model="account.report.expression">
|
||||
<field name="label">ta</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">TA.balance</field>
|
||||
<field name="date_scope">from_beginning</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_position0" model="account.report.line">
|
||||
<field name="name">Position</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="children_ids">
|
||||
<record id="account_financial_report_executivesummary_avdebt0" model="account.report.line">
|
||||
<field name="name">Average debtors days</field>
|
||||
<field name="code">AVG_DEBT_DAYS</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_avdebt0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">DEB.balance / AVG_DEBT_DAYS.opinc * AVG_DEBT_DAYS.NDays</field>
|
||||
<field name="subformula">ignore_zero_division</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
<field name="figure_type">float</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_avdebt0_opinc" model="account.report.expression">
|
||||
<field name="label">opinc</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">REV.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_avdebt0_ndays" model="account.report.expression">
|
||||
<field name="label">NDays</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_executive_summary_ndays</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_avgcre0" model="account.report.line">
|
||||
<field name="name">Average creditors days</field>
|
||||
<field name="code">AVG_CRED_DAYS</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_avgcre0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">-CRE.balance / (AVG_CRED_DAYS.cos + AVG_CRED_DAYS.exp) * AVG_CRED_DAYS.NDays</field>
|
||||
<field name="subformula">ignore_zero_division</field>
|
||||
<field name="green_on_positive" eval="False"/>
|
||||
<field name="figure_type">float</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_avgcre0_cos" model="account.report.expression">
|
||||
<field name="label">cos</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">COS.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_avgcre0_exp" model="account.report.expression">
|
||||
<field name="label">exp</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">EXP.balance</field>
|
||||
<field name="date_scope">strict_range</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_avgcre0_ndays" model="account.report.expression">
|
||||
<field name="label">NDays</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_executive_summary_ndays</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_st_cash_forecast0" model="account.report.line">
|
||||
<field name="name">Short term cash forecast</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_st_cash_forecast0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">DEB.balance + CRE.balance</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_ca_to_l0" model="account.report.line">
|
||||
<field name="name">Current assets to liabilities</field>
|
||||
<field name="code">CATL</field>
|
||||
<field name="expression_ids">
|
||||
<record id="account_financial_report_executivesummary_ca_to_l0_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">CATL.ca / CATL.cl</field>
|
||||
<field name="subformula">ignore_zero_division</field>
|
||||
<field name="figure_type">float</field>
|
||||
<field name="auditable" eval="False"/>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_ca_to_l0_ca" model="account.report.expression">
|
||||
<field name="label">ca</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">CA.balance</field>
|
||||
<field name="date_scope">from_beginning</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
<record id="account_financial_report_executivesummary_ca_to_l0_cl" model="account.report.expression">
|
||||
<field name="label">cl</field>
|
||||
<field name="engine">aggregation</field>
|
||||
<field name="formula">CL.balance</field>
|
||||
<field name="date_scope">from_beginning</field>
|
||||
<field name="subformula">cross_report</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
49
addons/at_accounting/data/general_ledger.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="general_ledger_report" model="account.report">
|
||||
<field name="name">General Ledger</field>
|
||||
<field name="filter_journals" eval="True"/>
|
||||
<field name="filter_analytic" eval="True"/>
|
||||
<field name="filter_period_comparison" eval="False"/>
|
||||
<field name="filter_multi_company">selector</field>
|
||||
<field name="filter_unfold_all" eval="True"/>
|
||||
<field name="filter_hide_0_lines">never</field>
|
||||
<field name="default_opening_date_filter">this_month</field>
|
||||
<field name="search_bar" eval="True"/>
|
||||
<field name="load_more_limit" eval="80"/>
|
||||
<field name="custom_handler_model_id" ref="model_account_general_ledger_report_handler"/>
|
||||
<field name="column_ids">
|
||||
<record id="general_ledger_report_date" model="account.report.column">
|
||||
<field name="name">Date</field>
|
||||
<field name="expression_label">date</field>
|
||||
<field name="figure_type">date</field>
|
||||
</record>
|
||||
<record id="general_ledger_report_communication" model="account.report.column">
|
||||
<field name="name">Communication</field>
|
||||
<field name="expression_label">communication</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="general_ledger_report_partner_name" model="account.report.column">
|
||||
<field name="name">Partner</field>
|
||||
<field name="expression_label">partner_name</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="general_ledger_report_amount_currency" model="account.report.column">
|
||||
<field name="name">Currency</field>
|
||||
<field name="expression_label">amount_currency</field>
|
||||
</record>
|
||||
<record id="general_ledger_report_debit" model="account.report.column">
|
||||
<field name="name">Debit</field>
|
||||
<field name="expression_label">debit</field>
|
||||
</record>
|
||||
<record id="general_ledger_report_credit" model="account.report.column">
|
||||
<field name="name">Credit</field>
|
||||
<field name="expression_label">credit</field>
|
||||
</record>
|
||||
<record id="general_ledger_report_balance" model="account.report.column">
|
||||
<field name="name">Balance</field>
|
||||
<field name="expression_label">balance</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
14
addons/at_accounting/data/generic_tax_report.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="account.generic_tax_report" model="account.report">
|
||||
<field name="custom_handler_model_id" ref="model_account_generic_tax_report_handler"/>
|
||||
</record>
|
||||
|
||||
<record id="account.generic_tax_report_account_tax" model="account.report">
|
||||
<field name="custom_handler_model_id" ref="model_account_generic_tax_report_handler_account_tax"/>
|
||||
</record>
|
||||
|
||||
<record id="account.generic_tax_report_tax_account" model="account.report">
|
||||
<field name="custom_handler_model_id" ref="model_account_generic_tax_report_handler_tax_account"/>
|
||||
</record>
|
||||
</odoo>
|
||||
11
addons/at_accounting/data/ir_cron.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="auto_reconcile_bank_statement_line" model="ir.cron">
|
||||
<field name="name">Try to reconcile automatically your statement lines</field>
|
||||
<field name="model_id" ref="model_account_bank_statement_line"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">model._cron_try_auto_reconcile_statement_lines(batch_size=100)</field>
|
||||
<field name='interval_number'>1</field>
|
||||
<field name='interval_type'>days</field>
|
||||
</record>
|
||||
</odoo>
|
||||
235
addons/at_accounting/data/journal_report.xml
Normal file
@@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="journal_report" model="account.report">
|
||||
<field name="name">Journal Report</field>
|
||||
<field name="filter_journals" eval="True"/>
|
||||
<field name="filter_show_draft" eval="True"/>
|
||||
<field name="filter_unfold_all" eval="True"/>
|
||||
<field name="filter_hierarchy">never</field>
|
||||
<field name="filter_period_comparison" eval="False"/>
|
||||
<field name="filter_unreconciled" eval="False"/>
|
||||
<field name="filter_hide_0_lines">never</field>
|
||||
<field name="default_opening_date_filter">this_year</field>
|
||||
<field name="custom_handler_model_id" ref="model_account_journal_report_handler"/>
|
||||
<field name="column_ids">
|
||||
<record id="journal_report_code" model="account.report.column">
|
||||
<field name="name">Code</field>
|
||||
<field name="expression_label">code</field>
|
||||
<field name="figure_type">string</field>
|
||||
</record>
|
||||
<record id="journal_report_debit" model="account.report.column">
|
||||
<field name="name">Debit</field>
|
||||
<field name="expression_label">debit</field>
|
||||
</record>
|
||||
<record id="journal_report_credit" model="account.report.column">
|
||||
<field name="name">Credit</field>
|
||||
<field name="expression_label">credit</field>
|
||||
</record>
|
||||
<record id="journal_report_balance" model="account.report.column">
|
||||
<field name="name">Balance</field>
|
||||
<field name="expression_label">balance</field>
|
||||
</record>
|
||||
</field>
|
||||
<field name="line_ids">
|
||||
<record id="journal_report_line" model="account.report.line">
|
||||
<field name="name">Name</field>
|
||||
<field name="groupby">journal_id, account_id</field>
|
||||
<field name="hierarchy_level">0</field>
|
||||
<field name="expression_ids">
|
||||
<record id="journal_report_line_code" model="account.report.expression">
|
||||
<field name="label">code</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_journal_report</field>
|
||||
<field name="subformula">code</field>
|
||||
</record>
|
||||
<record id="journal_report_line_debit" model="account.report.expression">
|
||||
<field name="label">debit</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_journal_report</field>
|
||||
<field name="subformula">debit</field>
|
||||
</record>
|
||||
<record id="journal_report_line_credit" model="account.report.expression">
|
||||
<field name="label">credit</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_journal_report</field>
|
||||
<field name="subformula">credit</field>
|
||||
</record>
|
||||
<record id="journal_report_line_balance" model="account.report.expression">
|
||||
<field name="label">balance</field>
|
||||
<field name="engine">custom</field>
|
||||
<field name="formula">_report_custom_engine_journal_report</field>
|
||||
<field name="subformula">balance</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<template id="journal_report_pdf_export_main">
|
||||
<html>
|
||||
<head>
|
||||
<base t-att-href="base_url"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
<t t-call-assets="at_accounting.assets_pdf_export" t-js="False"/>
|
||||
</head>
|
||||
<body t-att-dir="env['res.lang']._get_data(code=lang or env.user.lang).direction or 'ltr'">
|
||||
<div t-att-class="options['css_custom_class']">
|
||||
<header>
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4 o_header_font">
|
||||
<t t-call="at_accounting.company_information"/>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="o_title">
|
||||
<t t-if="report.filter_show_draft and options['all_entries']">[Draft]</t>
|
||||
<t t-out="report.name"/>
|
||||
</div>
|
||||
<div class="o_subtitle">
|
||||
<t t-out="options['date']['date_from']"/> - <t t-out="options['date']['date_to']"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Journal entries -->
|
||||
<t t-foreach="document_data['journals_vals']" t-as="journal_vals">
|
||||
<section style="page-break-after: always;">
|
||||
<div class="o_section_title">
|
||||
<t t-out="journal_vals.get('name')"/>
|
||||
</div>
|
||||
<div class="d-flex align-items-start">
|
||||
<t t-call="at_accounting.journal_report_pdf_body_default"/>
|
||||
</div>
|
||||
|
||||
<t t-if="journal_vals.get('tax_summary')">
|
||||
<t t-call="at_accounting.pdf_journal_report_taxes_summary">
|
||||
<t t-set="tax_summary" t-value="journal_vals['tax_summary']"/>
|
||||
</t>
|
||||
</t>
|
||||
</section>
|
||||
</t>
|
||||
|
||||
<section t-if="document_data.get('global_tax_summary')">
|
||||
<div class="o_section_title">
|
||||
Global Tax Summary
|
||||
</div>
|
||||
<t t-call="at_accounting.pdf_journal_report_taxes_summary">
|
||||
<t t-set="tax_summary" t-value="document_data['global_tax_summary']"/>
|
||||
</t>
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</template>
|
||||
|
||||
<template id="journal_report_pdf_body_default">
|
||||
<table class="o_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<t t-foreach="journal_vals['columns']" t-as="column">
|
||||
<th t-att-class="column.get('class', '')">
|
||||
<t t-out="column.get('name', '')"/>
|
||||
</th>
|
||||
</t>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<t t-foreach="journal_vals['lines']" t-as="line">
|
||||
<tr t-att-class="line.get('line_class', '')">
|
||||
<t t-foreach="journal_vals['columns']" t-as="column">
|
||||
<t t-if="line.get(column['label'])">
|
||||
<t t-set="cell_style" t-value="line[column['label']].get('class', '')"/>
|
||||
<t t-set="column_style" t-value="column.get('class', '')"/>
|
||||
<td t-att-class="cell_style + column_style">
|
||||
<t t-out="line[column['label']]['data']"/>
|
||||
</td>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<td/>
|
||||
</t>
|
||||
</t>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
|
||||
<template id="pdf_journal_report_taxes_summary">
|
||||
<div class="container tax_summary" style="page-break-inside: avoid;">
|
||||
<t t-set="taxes" t-value="tax_summary.get('tax_report_lines')"/>
|
||||
<t t-if="taxes">
|
||||
<div class="row o_section_subtitle">
|
||||
<p>Tax Applied</p>
|
||||
</div>
|
||||
<div class="row taxes">
|
||||
<t t-set="extra_columns" t-value="tax_summary.get('extra_columns')"/>
|
||||
<table class="o_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th t-if="len(taxes) > 1">Country</th>
|
||||
<th>Name</th>
|
||||
<th class="o_right_alignment">Base Amount</th>
|
||||
<th class="o_right_alignment">Tax Amount</th>
|
||||
<th t-if="tax_summary.get('tax_non_deductible_column')" class="o_right_alignment">Non-Deductible</th>
|
||||
<th t-if="tax_summary.get('tax_deductible_column')" class="o_right_alignment">Deductible</th>
|
||||
<th t-if="tax_summary.get('tax_due_column')" class="o_right_alignment">Due</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="taxes" t-as="country_name">
|
||||
<tr t-foreach="taxes[country_name]" t-as="tax">
|
||||
<t t-if="country_name_size > 1">
|
||||
<td>
|
||||
<t t-if="tax_index == 0" t-out="country_name"/>
|
||||
</td>
|
||||
</t>
|
||||
<td t-out="tax['name']"/>
|
||||
<td class="o_right_alignment" t-out="tax['base_amount']"/>
|
||||
<td class="o_right_alignment" t-out="tax['tax_amount']"/>
|
||||
<td t-if="tax_summary.get('tax_non_deductible_column')" class="o_right_alignment" t-out="tax['tax_non_deductible']"/>
|
||||
<td t-if="tax_summary.get('tax_deductible_column')" class="o_right_alignment" t-out="tax['tax_deductible']"/>
|
||||
<td t-if="tax_summary.get('tax_due_column')" class="o_right_alignment" t-out="tax['tax_due']"/>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
<t t-set="grids" t-value="tax_summary.get('tax_grid_summary_lines')"/>
|
||||
<t t-if="grids">
|
||||
<div class="row o_section_subtitle">
|
||||
<p>Impacted Tax Grids</p>
|
||||
</div>
|
||||
<div class="row tax_grid">
|
||||
<table class="o_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th t-if="len(grids) > 1">Country</th>
|
||||
<th>Grid</th>
|
||||
<th class="o_right_alignment">+</th>
|
||||
<th class="o_right_alignment">-</th>
|
||||
<th class="o_right_alignment">Impact On Grid</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="grids" t-as="country_name">
|
||||
<tr t-foreach="grids[country_name]" t-as="grid_name">
|
||||
<t t-if="country_name_size > 1">
|
||||
<td>
|
||||
<t t-if="grid_name_index == 0" t-out="country_name"/>
|
||||
</td>
|
||||
</t>
|
||||
<td t-out="grid_name"/>
|
||||
<td class="o_right_alignment" t-out="grids[country_name][grid_name].get('+', 0)"/>
|
||||
<td class="o_right_alignment" t-out="grids[country_name][grid_name].get('-', 0)"/>
|
||||
<td class="o_right_alignment" t-out="grids[country_name][grid_name]['impact']"/>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</template>
|
||||
</odoo>
|
||||
34
addons/at_accounting/data/mail_activity_type_data.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="tax_closing_activity_type" model="mail.activity.type">
|
||||
<field name="name">Tax Report</field>
|
||||
<field name="summary">Tax Report</field>
|
||||
<field name="category">tax_report</field>
|
||||
<field name="res_model">account.journal</field>
|
||||
<field name="chaining_type">suggest</field>
|
||||
</record>
|
||||
|
||||
<record id="mail_activity_type_tax_report_to_pay" model="mail.activity.type">
|
||||
<field name="name">Pay Tax</field>
|
||||
<field name="summary">Tax is ready to be paid</field>
|
||||
<field name="category">tax_report</field>
|
||||
<field name="delay_count">0</field>
|
||||
<field name="delay_unit">days</field>
|
||||
<field name="delay_from">previous_activity</field>
|
||||
<field name="res_model">account.move</field>
|
||||
<field name="chaining_type">suggest</field>
|
||||
</record>
|
||||
|
||||
<record id="mail_activity_type_tax_report_to_be_sent" model="mail.activity.type">
|
||||
<field name="name">Tax Report Ready</field>
|
||||
<field name="summary">Tax report is ready to be sent to the administration</field>
|
||||
<field name="category">tax_report</field>
|
||||
<field name="delay_count">0</field>
|
||||
<field name="delay_unit">days</field>
|
||||
<field name="delay_from">current_date</field>
|
||||
<field name="res_model">account.move</field>
|
||||
<field name="chaining_type">suggest</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
26
addons/at_accounting/data/mail_templates.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<odoo>
|
||||
<record id="email_template_customer_statement" model="mail.template">
|
||||
<field name="name">Customer Statement</field>
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="email_from">{{ object._get_followup_responsible().email_formatted }}</field>
|
||||
<field name="subject">{{ (object.company_id or object._get_followup_responsible().company_id).name }} Statement - {{ object.commercial_company_name }}</field>
|
||||
<field name="body_html" type="html">
|
||||
<div style="margin: 0px; padding: 0px;">
|
||||
<p style="margin: 0px; padding: 0px;">
|
||||
<t t-if="object.id != object.commercial_partner_id.id">Dear <t t-out="object.name or ''"/> (<t t-out="object.commercial_partner_id.name or ''"/>),</t>
|
||||
<t t-else="">Dear <t t-out="object.name or ''"/>,</t>
|
||||
<br/>
|
||||
Please find enclosed the statement of your account.
|
||||
<br/>
|
||||
Do not hesitate to contact us if you have any questions.
|
||||
<br/>
|
||||
Sincerely,
|
||||
<br/>
|
||||
<t t-out="object._get_followup_responsible().name if is_html_empty(object._get_followup_responsible().signature) else object._get_followup_responsible().signature"/>
|
||||
</p>
|
||||
</div>
|
||||
</field>
|
||||
<field name="lang">{{ object.lang }}</field>
|
||||
<field name="auto_delete" eval="False"/>
|
||||
</record>
|
||||
</odoo>
|
||||
53
addons/at_accounting/data/menuitems.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<menuitem id="menu_action_account_report_partner_ledger" name="Partner Ledger"
|
||||
action="action_account_report_partner_ledger" groups="account.group_account_readonly"
|
||||
parent="account.account_reports_partners_reports_menu"/>
|
||||
<menuitem id="menu_action_account_report_aged_receivable" name="Aged Receivable" action="action_account_report_ar"
|
||||
groups="account.group_account_readonly" parent="account.account_reports_partners_reports_menu"/>
|
||||
<menuitem id="menu_action_account_report_aged_payable" name="Aged Payable" action="action_account_report_ap"
|
||||
groups="account.group_account_readonly" parent="account.account_reports_partners_reports_menu"/>
|
||||
<menuitem id="account_reports_audit_reports_menu" name="Audit Reports" parent="account.menu_finance_reports"
|
||||
sequence="2">
|
||||
<menuitem id="menu_action_account_report_general_ledger" name="General Ledger"
|
||||
action="action_account_report_general_ledger" groups="account.group_account_readonly"/>
|
||||
<menuitem id="menu_action_account_report_coa" name="Trial Balance" action="action_account_report_coa"
|
||||
groups="account.group_account_readonly"/>
|
||||
<menuitem id="menu_action_account_report_ja" name="Journal Audit" action="action_account_report_ja"
|
||||
groups="account.group_account_readonly"/>
|
||||
</menuitem>
|
||||
|
||||
<menuitem id="menu_action_account_report_gt" name="Tax Return" action="action_account_report_gt"
|
||||
parent="account.account_reports_legal_statements_menu" sequence="50"
|
||||
groups="account.group_account_readonly,account.group_account_basic"/>
|
||||
<menuitem id="menu_action_account_report_sales" action="action_account_report_sales"
|
||||
parent="account.account_reports_legal_statements_menu" sequence="60"
|
||||
groups="account.group_account_readonly" active="False"/>
|
||||
|
||||
<menuitem id="menu_action_account_report_multicurrency_revaluation" name="Unrealized Currency Gains/Losses"
|
||||
action="action_account_report_multicurrency_revaluation" parent="account.account_reports_management_menu"
|
||||
groups="base.group_multi_currency"/>
|
||||
<menuitem id="menu_action_account_report_balance_sheet" name="Balance Sheet" action="action_account_report_bs"
|
||||
parent="account.account_reports_legal_statements_menu" groups="account.group_account_readonly"/>
|
||||
<menuitem id="menu_action_account_report_profit_and_loss" name="Profit and Loss" action="action_account_report_pl"
|
||||
parent="account.account_reports_legal_statements_menu" groups="account.group_account_readonly"/>
|
||||
<menuitem id="menu_action_account_report_cash_flow" name="Cash Flow Statement" action="action_account_report_cs"
|
||||
parent="account.account_reports_legal_statements_menu" groups="account.group_account_readonly"/>
|
||||
<menuitem id="menu_action_account_report_exec_summary" name="Executive Summary"
|
||||
action="action_account_report_exec_summary" parent="account.account_reports_legal_statements_menu"
|
||||
groups="account.group_account_readonly"/>
|
||||
<menuitem id="menu_action_account_report_deferred_expense" name="Deferred Expense"
|
||||
action="action_account_report_deferred_expense" parent="account.account_reports_management_menu"
|
||||
groups="account.group_account_readonly"/>
|
||||
<menuitem id="menu_action_account_report_deferred_revenue" name="Deferred Revenue"
|
||||
action="action_account_report_deferred_revenue" parent="account.account_reports_management_menu"
|
||||
groups="account.group_account_readonly"/>
|
||||
<menuitem id="menu_action_account_report_tree" name="Accounting Reports" sequence="6"
|
||||
parent="account.account_management_menu" action="action_account_report_tree" groups="base.group_no_one"/>
|
||||
<menuitem id="menu_action_account_report_horizontal_groups" name="Horizontal Groups"
|
||||
action="action_account_report_horizontal_groups" parent="account.account_account_menu" sequence="10"
|
||||
groups="base.group_no_one"/>
|
||||
<menuitem id="menu_action_account_report_budget_tree" name="Financial Budgets"
|
||||
action="action_account_report_budget_tree" parent="account.account_account_menu" sequence="11"/>
|
||||
|
||||
</odoo>
|
||||
8
addons/at_accounting/data/menuitems_asset.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<menuitem id="menu_action_account_report_assets"
|
||||
name="Depreciation Schedule"
|
||||
action="action_account_report_assets"
|
||||
parent="account.account_reports_management_menu"
|
||||
groups="account.group_account_readonly"/>
|
||||
</odoo>
|
||||