Update links in report, add account group file, update trial balance with hierarchy.
Update indentation, remove empty lines from header.
Update test.
Update pylint.
Remove company_id on computing accounts, since account.group is not a company based model, filtering accounts is done on trial balance report.
Update account variables.
Improve condition in padding on accounts.
Add option to print hierarchy based on defined accounts/computed accounts.
Add VAT report, hierarchy from tax tags ans taxes.
Fix pylint, xlsx report generation header.
Update code to select code_prefix or name.
Update code to select code_prefix or name.
Update code to select code_prefix or name.
Fix domain in base amounts in vat report.
Change trial balance code_prefix or name.
Update trail balance, add tests for vat report.
Update pylint, amounts as monetary, many2one option on generation excels.
Update pulint.
Add VAT Report in readme.
Add VAT Report in readme.
Update array_agg.
Update array_agg.
Update array_agg.
Add option in VAT Report to be printed on Tax Tags - Tax Groups.
Add widget to hierarchy_on on trial balance.
7 years ago Update links in report, add account group file, update trial balance with hierarchy.
Update indentation, remove empty lines from header.
Update test.
Update pylint.
Remove company_id on computing accounts, since account.group is not a company based model, filtering accounts is done on trial balance report.
Update account variables.
Improve condition in padding on accounts.
Add option to print hierarchy based on defined accounts/computed accounts.
Add VAT report, hierarchy from tax tags ans taxes.
Fix pylint, xlsx report generation header.
Update code to select code_prefix or name.
Update code to select code_prefix or name.
Update code to select code_prefix or name.
Fix domain in base amounts in vat report.
Change trial balance code_prefix or name.
Update trail balance, add tests for vat report.
Update pylint, amounts as monetary, many2one option on generation excels.
Update pulint.
Add VAT Report in readme.
Add VAT Report in readme.
Update array_agg.
Update array_agg.
Update array_agg.
Add option in VAT Report to be printed on Tax Tags - Tax Groups.
Add widget to hierarchy_on on trial balance.
7 years ago Update links in report, add account group file, update trial balance with hierarchy.
Update indentation, remove empty lines from header.
Update test.
Update pylint.
Remove company_id on computing accounts, since account.group is not a company based model, filtering accounts is done on trial balance report.
Update account variables.
Improve condition in padding on accounts.
Add option to print hierarchy based on defined accounts/computed accounts.
Add VAT report, hierarchy from tax tags ans taxes.
Fix pylint, xlsx report generation header.
Update code to select code_prefix or name.
Update code to select code_prefix or name.
Update code to select code_prefix or name.
Fix domain in base amounts in vat report.
Change trial balance code_prefix or name.
Update trail balance, add tests for vat report.
Update pylint, amounts as monetary, many2one option on generation excels.
Update pulint.
Add VAT Report in readme.
Add VAT Report in readme.
Update array_agg.
Update array_agg.
Update array_agg.
Add option in VAT Report to be printed on Tax Tags - Tax Groups.
Add widget to hierarchy_on on trial balance.
7 years ago Update links in report, add account group file, update trial balance with hierarchy.
Update indentation, remove empty lines from header.
Update test.
Update pylint.
Remove company_id on computing accounts, since account.group is not a company based model, filtering accounts is done on trial balance report.
Update account variables.
Improve condition in padding on accounts.
Add option to print hierarchy based on defined accounts/computed accounts.
Add VAT report, hierarchy from tax tags ans taxes.
Fix pylint, xlsx report generation header.
Update code to select code_prefix or name.
Update code to select code_prefix or name.
Update code to select code_prefix or name.
Fix domain in base amounts in vat report.
Change trial balance code_prefix or name.
Update trail balance, add tests for vat report.
Update pylint, amounts as monetary, many2one option on generation excels.
Update pulint.
Add VAT Report in readme.
Add VAT Report in readme.
Update array_agg.
Update array_agg.
Update array_agg.
Add option in VAT Report to be printed on Tax Tags - Tax Groups.
Add widget to hierarchy_on on trial balance.
7 years ago |
|
# © 2018 Forest and Biomass Romania SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class AccountGroup(models.Model): _inherit = 'account.group'
group_child_ids = fields.One2many( comodel_name='account.group', inverse_name='parent_id', string='Child Groups') level = fields.Integer( string='Level', compute='_compute_level', store=True) account_ids = fields.One2many( comodel_name='account.account', inverse_name='group_id', string="Accounts") compute_account_ids = fields.Many2many( 'account.account', compute='_compute_group_accounts', string="Compute accounts", store=True) complete_name = fields.Char("Full Name", compute='_compute_complete_name') complete_code = fields.Char("Full Code", compute='_compute_complete_code')
@api.depends('name', 'parent_id.complete_name') def _compute_complete_name(self): """ Forms complete name of location from parent location to child location. """ if self.parent_id.complete_name: self.complete_name = '%s/%s' % (self.parent_id.complete_name, self.name) else: self.complete_name = self.name
@api.depends('code_prefix', 'parent_id.complete_code') def _compute_complete_code(self): """ Forms complete code of location from parent location to child location. """ if self.parent_id.complete_code: self.complete_code = '%s/%s' % (self.parent_id.complete_code, self.code_prefix) else: self.complete_code = self.code_prefix
@api.multi @api.depends('parent_id', 'parent_id.level') def _compute_level(self): for group in self: if not group.parent_id: group.level = 0 else: group.level = group.parent_id.level + 1
@api.multi @api.depends('code_prefix', 'account_ids', 'account_ids.code', 'group_child_ids', 'group_child_ids.account_ids.code') def _compute_group_accounts(self): account_obj = self.env['account.account'] accounts = account_obj.search([]) for group in self: prefix = group.code_prefix if group.code_prefix else group.name gr_acc = accounts.filtered( lambda a: a.code.startswith(prefix)).ids group.compute_account_ids = [(6, 0, gr_acc)]
|