Skip to content

Commit

Permalink
14 balance a 3 (#342)
Browse files Browse the repository at this point in the history
* Balance a 3

* Flake

* Flake

* Flake

* Flake

* Cambios 14.0

* Retoques

* Haciendo que cuadre

* Haciendo que cuadre
  • Loading branch information
Lopsanz authored Jun 11, 2024
1 parent 0885727 commit ec64aa8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mis_report_por_grupo/models/account_move_line_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def init(self):
acc.code AS original_code,
acc.name AS original_name,
aml.id AS move_line_id,
aml.id AS id,
aml.date AS date,
aml.debit AS debit,
aml.credit AS credit,
Expand All @@ -75,19 +76,25 @@ def init(self):
aa.group_id, aa.company_id, aa.id, aa.code, aa.name
) AS acc2 ON acc2.group_id = acc.group_id
AND acc2.company_id = aml.company_id
WHERE aml.parent_state != 'cancel'
)
""")
self.recreate_accounts()

def recreate_accounts(self):
accounts = self.env['account.account']
for acc in self.env['account.account'].search([
('user_type_id', '!=', 'Current Year Earnings'),
('group_id', '!=', False),]):
if not accounts.search([
('company_id', '=', acc.company_id.id),
('code', '=', acc.group_id.code_prefix_start)]):
acc.copy({
values = {
'company_id': acc.company_id.id,
'name': acc.group_id.name or '',
'code': acc.group_id.code_prefix_start,
'deprecated': True,
'asset_profile_id': False,
})
}
if 'asset_profile_id' in acc._fields:
values['asset_profile_id'] = False
acc.copy(values)

0 comments on commit ec64aa8

Please sign in to comment.