Skip to content

Commit

Permalink
[MIG] Migrate account_import_helper to version 18
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-dacosta committed Nov 28, 2024
1 parent eb5886c commit d9b9708
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
18 changes: 10 additions & 8 deletions account_import_helper/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ Then, in the future production database, after the installation of the official
UPDATE FROM pos_payment_method SET outstanding_account_id=null, receivable_account_id=null WHERE company_id=X;
UPDATE ir_property SET value_reference=null WHERE value_reference like 'account.account,%' WHERE company_id=X;
UPDATE ir_default SET json_value = false FROM ir_model_fields f WHERE f.id = ir_default.field_id AND f.relation = 'account.account' AND ir_default.company_id = X
DELETE FROM account_fiscal_position_account WHERE company_id=X;
* Delete all accounts:

.. code::
DELETE FROM account_account WHERE company_id=X;
DELETE FROM account_account_res_company_rel WHERE res_company_id=X
DELETE FROM account_account WHERE id in (SELECT a.id FROM account_account a LEFT JOIN account_account_res_company_rel rel ON rel.account_account_id = a.id WHERE rel.account_account_id IS NULL)
* In the menu *Invoicing > Configuration > Accounting > Chart of accounts*, import the file *account.account.csv* with *Encoding* set to **utf-8** and *Use first row as header* enabled.

Expand All @@ -36,14 +38,14 @@ Then, in the future production database, after the installation of the official

* On the page *Invoicing > Configuration > Settings*, update the section *Default Accounts*

* In the menu *Settings > Technical > Parameters > Company Properties*, edit the 4 properties
* In the menu *Settings > Technical > Actions > User-defined Defaults*, edit the default having a 0 value including :

- property_account_receivable_id
- property_account_payable_id
- property_account_expense_categ_id
- property_account_income_categ_id
- Account Receivable
- Account Payable
- Expense Account
- Income Account

and set the field *value* with **account.account,67** where 67 is the ID of the account you want to have as default for that property.
and set the field *Default Value (JSON format)* with **67** where 67 is the ID of the account you want to have as default for that property.


Contributors
Expand Down
4 changes: 2 additions & 2 deletions account_import_helper/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Account Import Helper",
"version": "16.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Partner",
"license": "AGPL-3",
"summary": "Helper methods to import accounting-related data",
Expand All @@ -16,5 +16,5 @@
"security/ir.model.access.csv",
"wizard/account_chart_generate_view.xml",
],
"installable": False,
"installable": True,
}
2 changes: 1 addition & 1 deletion account_import_helper/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def generate_custom_chart(
logger.info("taxtemplate2xmlid = %s", taxtemplate2xmlid)
# pre-load odoo's chart of account
odoo_chart = {}
accounts = self.env['account.account'].search([("company_id", "=", self.id)])
accounts = self.env['account.account'].search([("company_ids", "in", [self.id])])
odoo_code_size = False
for account in accounts:
taxes_xmlids = [taxtemplate2xmlid[tax.id] for tax in account.tax_ids]
Expand Down

0 comments on commit d9b9708

Please sign in to comment.