From f651f5ad1b60d2314b1f21d023ed0205fff65c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20=C4=90=E1=BA=A1i=20D=C6=B0=C6=A1ng?= Date: Wed, 29 May 2024 13:26:41 +0700 Subject: [PATCH] [MIG] account: migration --- .../scripts/account/17.0.1.2/end-migration.py | 13 + .../account/17.0.1.2/post-migration.py | 93 +++++ .../scripts/account/17.0.1.2/pre-migration.py | 324 ++++++++++++++++++ .../17.0.1.2/upgrade_analysis_work.txt | 104 +++++- 4 files changed, 521 insertions(+), 13 deletions(-) create mode 100644 openupgrade_scripts/scripts/account/17.0.1.2/end-migration.py diff --git a/openupgrade_scripts/scripts/account/17.0.1.2/end-migration.py b/openupgrade_scripts/scripts/account/17.0.1.2/end-migration.py new file mode 100644 index 000000000000..6bf5e52c90d0 --- /dev/null +++ b/openupgrade_scripts/scripts/account/17.0.1.2/end-migration.py @@ -0,0 +1,13 @@ +# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +def _res_partner_bank_computation(env): + partner_banks = env["res.partner.bank"].with_context(active_test=False).search([]) + partner_banks._compute_display_account_warning() + + +@openupgrade.migrate() +def migrate(env, version): + _res_partner_bank_computation(env) diff --git a/openupgrade_scripts/scripts/account/17.0.1.2/post-migration.py b/openupgrade_scripts/scripts/account/17.0.1.2/post-migration.py index f76b7371c68c..9287b7bc70e4 100644 --- a/openupgrade_scripts/scripts/account/17.0.1.2/post-migration.py +++ b/openupgrade_scripts/scripts/account/17.0.1.2/post-migration.py @@ -11,6 +11,96 @@ ] +def _aml_update_matching_number(env): + fulls = env["account.full.reconcile"].search([]) + env["account.partial.reconcile"]._update_matching_number(fulls.reconciled_line_ids) + + +def _am_update_invoice_pdf_report_file(env): + openupgrade.logged_query( + env.cr, + """ + UPDATE ir_attachment ia + SET res_field = 'invoice_pdf_report_file', + res_id = am.id + FROM account_move am + WHERE am.message_main_attachment_id = ia.id + """, + ) + + +def _onboarding_state_migration(env): + """ + Following pr: https://github.com/odoo/odoo/pull/104223/ + """ + env.cr.execute( + """ + SELECT id, account_onboarding_create_invoice_state_flag, + account_onboarding_invoice_layout_state, + account_onboarding_sale_tax_state, account_setup_bank_data_state, + account_setup_bill_state, account_setup_coa_state, account_setup_fy_data_state, + account_setup_taxes_state FROM res_company + """ + ) + for ( + company_id, + account_onboarding_create_invoice_state_flag, + account_onboarding_invoice_layout_state, + account_onboarding_sale_tax_state, + account_setup_bank_data_state, + account_setup_bill_state, + account_setup_coa_state, + account_setup_fy_data_state, + account_setup_taxes_state, + ) in env.cr.fetchall(): + OnboardingStep = env["onboarding.onboarding.step"].with_company(company_id) + if account_onboarding_create_invoice_state_flag: + step = env.ref( + "account.onboarding_onboarding_step_create_invoice", + raise_if_not_found=False, + ) + if step and step.current_step_state == "not_done": + if env["account.move"].search( + [ + ("company_id", "=", company_id), + ("move_type", "=", "out_invoice"), + ], + limit=1, + ): + step.action_set_just_done() + if account_onboarding_invoice_layout_state in ("just_done", "done"): + step = env.ref( + "account.onboarding_onboarding_step_base_document_layout", + raise_if_not_found=False, + ) + if step: + step.with_company(company_id).action_set_just_done() + if account_onboarding_sale_tax_state in ("just_done", "done"): + OnboardingStep.action_validate_step( + "account.onboarding_onboarding_step_sales_tax" + ) + if account_setup_bank_data_state in ("just_done", "done"): + OnboardingStep.action_validate_step( + "account.onboarding_onboarding_step_bank_account" + ) + if account_setup_bill_state in ("just_done", "done"): + OnboardingStep.action_validate_step( + "account.onboarding_onboarding_step_setup_bill" + ) + if account_setup_coa_state in ("just_done", "done"): + OnboardingStep.action_validate_step( + "account.onboarding_onboarding_step_chart_of_accounts" + ) + if account_setup_fy_data_state in ("just_done", "done"): + OnboardingStep.action_validate_step( + "account.onboarding_onboarding_step_fiscal_year" + ) + if account_setup_taxes_state in ("just_done", "done"): + OnboardingStep.action_validate_step( + "account.onboarding_onboarding_step_default_taxes" + ) + + @openupgrade.migrate() def migrate(env, version): openupgrade.load_data(env, "account", "17.0.1.2/noupdate_changes.xml") @@ -18,3 +108,6 @@ def migrate(env, version): env, _deleted_xml_records, ) + _aml_update_matching_number(env) + _am_update_invoice_pdf_report_file(env) + _onboarding_state_migration(env) diff --git a/openupgrade_scripts/scripts/account/17.0.1.2/pre-migration.py b/openupgrade_scripts/scripts/account/17.0.1.2/pre-migration.py index 02c221cf76d1..6e4e8c8b6033 100644 --- a/openupgrade_scripts/scripts/account/17.0.1.2/pre-migration.py +++ b/openupgrade_scripts/scripts/account/17.0.1.2/pre-migration.py @@ -8,6 +8,15 @@ _logger = logging.getLogger(__name__) +_fields_renames = [ + ( + "res.company", + "res_company", + "invoice_is_print", + "invoice_is_download", + ), +] + COA_MAPPING = { "l10n_ae.uae_chart_template_standard": "ae", "l10n_ar.l10nar_base_chart_template": "ar_base", @@ -188,6 +197,309 @@ def _map_chart_template_id_to_chart_template( ) +def _am_create_delivery_date_column(env): + """ + Create column then in module need them like l10n_sa and l10n_hu will fill value, + https://github.com/odoo/odoo/pull/116643 + """ + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE account_move + ADD COLUMN IF NOT EXISTS delivery_date DATE + """, + ) + + +def _am_create_incoterm_location_column(env): + """ + Create column then in Sale, Purchase will fill it in pre, + pr: https://github.com/odoo/odoo/pull/118954 + """ + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE account_move + ADD COLUMN IF NOT EXISTS incoterm_location CHARACTER VARYING + """, + ) + + +def _aml_update_invoice_date_like_amount_move(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE account_move_line + ADD COLUMN IF NOT EXISTS invoice_date DATE + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_move_line aml + SET invoice_date = am.invoice_date + FROM account_move am + WHERE aml.move_id = am.id + """, + ) + + +def _account_payment_term_migration(env): + """ + https://github.com/odoo/odoo/pull/110274 + """ + env.cr.execute("SELECT days FROM account_payment_term_line") + env.cr.fetchall() + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE account_payment_term + ADD COLUMN IF NOT EXISTS discount_days INTEGER, + ADD COLUMN IF NOT EXISTS discount_percentage FLOAT, + ADD COLUMN IF NOT EXISTS early_discount BOOLEAN, + ADD COLUMN IF NOT EXISTS early_pay_discount_computation VARCHAR; + """, + ) + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE account_payment_term_line + ADD COLUMN IF NOT EXISTS delay_type VARCHAR, + ADD COLUMN IF NOT EXISTS nb_days INTEGER; + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_payment_term_line + SET value = 'percent' + WHERE value = 'balance' + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_payment_term_line + SET delay_type = CASE + WHEN end_month = true AND months = 1 THEN 'days_after_end_of_next_month' + WHEN end_month = true AND months > 1 THEN 'days_end_of_month_on_the' + ELSE 'days_after' + END, + nb_days = CASE + WHEN months IS NOT NULL AND days_after IS NOT NULL AND end_month = true + THEN (months*30) + days + days_after + WHEN end_month IN (false, NULL) THEN (months*30) + days + END + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_payment_term term + SET early_pay_discount_computation = com.early_pay_discount_computation + FROM res_company com + WHERE term.company_id = com.id + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_payment_term term + SET early_discount = true + WHERE EXISTS ( + SELECT 1 + FROM account_payment_term_line t1 + WHERE t1.payment_id = term.id + AND t1.discount_days IS NOT NULL + AND t1.discount_percentage IS NOT NULL + AND t1.discount_percentage > 0.0 + ); + """, + ) + openupgrade.logged_query( + env.cr, + """ + WITH tmp as( + SELECT payment_id, MAX(discount_days) discount_days, + sum(discount_percentage) discount_percentage + FROM account_payment_term_line + WHERE discount_days IS NOT NULL AND discount_percentage IS NOT NULL + AND discount_percentage > 0.0 + GROUP BY payment_id + ) + UPDATE account_payment_term term + SET discount_days = tmp.discount_days, + discount_percentage = tmp.discount_percentage + FROM tmp + WHERE tmp.payment_id = term.id + """, + ) + + +def _force_install_account_payment_term_module_module(env): + """ + Force install account_payment_term because we need + key 'days_end_of_month_on_the' of it + it has already merged in odoo master + """ + account_payment_term_module = env["ir.module.module"].search( + [("name", "=", "account_payment_term")] + ) + if account_payment_term_module: + account_payment_term_module.button_install() + + +def _account_report_update_figure_type(env): + openupgrade.logged_query( + env.cr, + """ + UPDATE account_report_column + SET figure_type = 'string' + WHERE figure_type = 'none' + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_report_expression + SET figure_type = 'string' + WHERE figure_type = 'none' + """, + ) + + +def _account_tax_update_invoice_label(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE account_tax + ADD COLUMN IF NOT EXISTS invoice_label JSONB + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_tax + SET invoice_label = description + WHERE description IS NOT NULL + """, + ) + + +def _account_tax_group_update_from_property(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE account_tax_group + ADD COLUMN IF NOT EXISTS advance_tax_payment_account_id INTEGER, + ADD COLUMN IF NOT EXISTS tax_payable_account_id INTEGER, + ADD COLUMN IF NOT EXISTS tax_receivable_account_id INTEGER; + """, + ) + openupgrade.logged_query( + env.cr, + """ + WITH tmp AS ( + SELECT property.name, res_id, value_reference + FROM ir_property property + JOIN ir_model_fields field ON field.id = property.fields_id + JOIN ir_model model ON model.id = field.model_id + WHERE property.name IN ( + 'property_tax_payable_account_id', + 'property_tax_receivable_account_id', + 'property_advance_tax_payment_account_id' + ) + AND model.model = 'account.tax.group' + ) + UPDATE account_tax_group atg + SET advance_tax_payment_account_id = CASE + WHEN CAST(split_part(tmp.res_id, ',', 2) AS INTEGER) = atg.id AND + tmp.name = 'property_advance_tax_payment_account_id' + THEN CAST(split_part(tmp.value_reference, ',', 2) AS INTEGER) + WHEN tmp.name = 'property_advance_tax_payment_account_id' AND + tmp.res_id IS NULL + THEN CAST(split_part(tmp.value_reference, ',', 2) AS INTEGER) + ELSE NULL + END, + tax_payable_account_id = CASE + WHEN CAST(split_part(tmp.res_id, ',', 2) AS INTEGER) = atg.id AND + tmp.name = 'property_tax_payable_account_id' + THEN CAST(split_part(tmp.value_reference, ',', 2) AS INTEGER) + WHEN tmp.name = 'property_tax_payable_account_id' AND + tmp.res_id IS NULL + THEN CAST(split_part(tmp.value_reference, ',', 2) AS INTEGER) + ELSE NULL + END, + tax_receivable_account_id = CASE + WHEN CAST(split_part(tmp.res_id, ',', 2) AS INTEGER) = atg.id AND + tmp.name = 'property_tax_receivable_account_id' + THEN CAST(split_part(tmp.value_reference, ',', 2) AS INTEGER) + WHEN tmp.name = 'property_tax_receivable_account_id' AND + tmp.res_id IS NULL + THEN CAST(split_part(tmp.value_reference, ',', 2) AS INTEGER) + ELSE NULL + END + FROM tmp + WHERE TRUE; + """, + ) + + +def _account_tax_group_fill_company(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE account_tax_group + ADD COLUMN IF NOT EXISTS company_id INTEGER; + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_tax_group t1 + SET company_id = t2.company_id + FROM account_tax t2 + WHERE t1.id = t2.tax_group_id + """, + ) + + +def _account_tax_repartition_line_merge_repartition_lines_m2o(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE account_tax_repartition_line + ADD COLUMN IF NOT EXISTS document_type VARCHAR, + ADD COLUMN IF NOT EXISTS tax_id INTEGER; + """, + ) + openupgrade.logged_query( + env.cr, + """ + UPDATE account_tax_repartition_line + SET document_type = CASE + WHEN invoice_tax_id IS NOT NULL THEN 'invoice' + WHEN refund_tax_id IS NOT NULL THEN 'refund' + END, + tax_id = CASE + WHEN invoice_tax_id IS NOT NULL THEN invoice_tax_id + WHEN refund_tax_id IS NOT NULL THEN refund_tax_id + END + """, + ) + + +def _res_partner_bank_create_column(env): + openupgrade.logged_query( + env.cr, + """ + ALTER TABLE res_partner_bank + ADD COLUMN IF NOT EXISTS has_iban_warning BOOLEAN, + ADD COLUMN IF NOT EXISTS has_money_transfer_warning BOOLEAN; + """, + ) + + @openupgrade.migrate() def migrate(env, version): _map_account_report_filter_account_type(env) @@ -201,3 +513,15 @@ def migrate(env, version): DROP INDEX IF EXISTS account_account_name_index; """, ) + openupgrade.rename_fields(env, _fields_renames) + _am_create_delivery_date_column(env) + _am_create_incoterm_location_column(env) + _aml_update_invoice_date_like_amount_move(env) + _force_install_account_payment_term_module_module(env) + _account_payment_term_migration(env) + _account_report_update_figure_type(env) + _account_tax_update_invoice_label(env) + _account_tax_group_update_from_property(env) + _account_tax_group_fill_company(env) + _account_tax_repartition_line_merge_repartition_lines_m2o(env) + _res_partner_bank_create_column(env) diff --git a/openupgrade_scripts/scripts/account/17.0.1.2/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/account/17.0.1.2/upgrade_analysis_work.txt index db62a5395e72..06d542083549 100644 --- a/openupgrade_scripts/scripts/account/17.0.1.2/upgrade_analysis_work.txt +++ b/openupgrade_scripts/scripts/account/17.0.1.2/upgrade_analysis_work.txt @@ -4,17 +4,23 @@ obsolete model account.fiscal.position.account.template obsolete model account.fiscal.position.tax.template obsolete model account.fiscal.position.template obsolete model account.group.template -obsolete model account.invoice.send [transient] obsolete model account.reconcile.model.line.template obsolete model account.reconcile.model.template obsolete model account.tax.repartition.line.template obsolete model account.tax.template +# NOTHING TO DO: these models has been convert to csv definition + +obsolete model account.invoice.send [transient] new model account.move.send [transient] +# NOTHING TO DO + ---Fields in module 'account'--- account / account.account / _order : _order is now 'code, company_id' ('is_off_balance, code, company_id') account / account.account / is_off_balance (boolean) : DEL account / account.account / message_main_attachment_id (many2one): DEL relation: ir.attachment account / account.account / rating_ids (one2many) : NEW relation: rating.rating +# NOTHING TO DO + account / account.account.template / account_type (selection) : DEL selection_keys: ['asset_cash', 'asset_current', 'asset_fixed', 'asset_non_current', 'asset_prepayments', 'asset_receivable', 'equity', 'equity_unaffected', 'expense', 'expense_depreciation', 'expense_direct_cost', 'income', 'income_other', 'liability_credit_card', 'liability_current', 'liability_non_current', 'liability_payable', 'off_balance'] account / account.account.template / chart_template_id (many2one) : DEL relation: account.chart.template account / account.account.template / code (char) : DEL required @@ -86,12 +92,19 @@ account / account.fiscal.position.template / tax_ids (one2many) account / account.fiscal.position.template / vat_required (boolean) : DEL account / account.fiscal.position.template / zip_from (char) : DEL account / account.fiscal.position.template / zip_to (char) : DEL +# NOTHING TO DO + account / account.full.reconcile / name (char) : DEL required +account / account.move.line / matching_number (char) : not a function anymore +# DONE post-migration: update matching_number using '_update_matching_number' + account / account.group.template / chart_template_id (many2one) : DEL relation: account.chart.template, required account / account.group.template / code_prefix_end (char) : DEL account / account.group.template / code_prefix_start (char) : DEL account / account.group.template / name (char) : DEL required account / account.group.template / parent_id (many2one) : DEL relation: account.group.template +# NOTHING TO DO + account / account.journal / access_token (char) : NEW account / account.journal / activity_user_id (many2one) : not related anymore account / account.journal / activity_user_id (many2one) : now a function @@ -104,23 +117,46 @@ account / account.journal / rating_ids (one2many) : NEW re account / account.move / _order : _order is now 'date desc, name desc, invoice_date desc, id desc' ('date desc, name desc, id desc') account / account.move / activity_user_id (many2one) : not related anymore account / account.move / activity_user_id (many2one) : now a function +# NOTHING TO DO + account / account.move / amount_total_words (char) : previously in module l10n_dz +# NOTHING TO DO: compute no store + account / account.move / delivery_date (date) : NEW isfunction: function, stored +# DONE pre-migration: Create column then in module need them like l10n_sa and l10n_hu will fill value, https://github.com/odoo/odoo/pull/116643 + account / account.move / incoterm_location (char) : NEW hasdefault: compute +# DONE pre-migration: Create column then in Sale, Purchase will fill it in pre, pr: https://github.com/odoo/odoo/pull/118954 + account / account.move / invoice_pdf_report_file (binary): NEW attachment: True +# DONE post-migration: update message_main_attachment_id with res_field and res_id of each invoice, see '_link_invoice_documents' in 'account.move.send' + account / account.move / rating_ids (one2many) : NEW relation: rating.rating account / account.move / send_and_print_values (json) : NEW +# NOTHING TO DO + account / account.move.line / discount_percentage (float) : DEL account / account.move.line / display_type (selection) : selection_keys is now '['cogs', 'discount', 'epd', 'line_note', 'line_section', 'payment_term', 'product', 'rounding', 'tax']' ('['cogs', 'epd', 'line_note', 'line_section', 'payment_term', 'product', 'rounding', 'tax']') +# NOTHING TO DO: new feature https://github.com/odoo/odoo/pull/133286 + account / account.move.line / invoice_date (date) : NEW isrelated: related, stored -account / account.move.line / matching_number (char) : not a function anymore +# DONE pre-migration: create column and fill value + account / account.move.line / tax_audit (char) : DEL +# NOTHING TO DO: deprecated + account / account.partial.reconcile / company_id (many2one) : not related anymore +# NOTHING TO DO + account / account.payment / activity_user_id (many2one) : not related anymore account / account.payment / activity_user_id (many2one) : now a function account / account.payment / amount_total_words (char) : previously in module l10n_dz -account / account.payment / qr_code (char) : type is now 'html' ('char') account / account.payment / rating_ids (one2many) : NEW relation: rating.rating +# NOTHING TO DO + +account / account.payment / qr_code (char) : type is now 'html' ('char') +# NOTHING TO DO: no store field + account / account.payment.term / currency_id (many2one) : NEW relation: res.currency, hasdefault: default account / account.payment.term / discount_days (integer) : NEW hasdefault: default account / account.payment.term / discount_percentage (float) : NEW hasdefault: default @@ -135,6 +171,8 @@ account / account.payment.term.line / end_month (boolean) : DEL account / account.payment.term.line / months (integer) : DEL required account / account.payment.term.line / nb_days (integer) : NEW hasdefault: compute account / account.payment.term.line / value (selection) : selection_keys is now '['fixed', 'percent']' ('['balance', 'fixed', 'percent']') +# DONE pre-migration: update discount_percentage (sum of all line percentage), delay_type, value (replace balance with percentage) https://github.com/odoo/odoo/pull/110274/ + account / account.reconcile.model / message_main_attachment_id (many2one): DEL relation: ir.attachment account / account.reconcile.model / rating_ids (one2many) : NEW relation: rating.rating account / account.reconcile.model.line.template / account_id (many2one) : DEL relation: account.account.template @@ -177,14 +215,14 @@ account / account.reconcile.model.template / sequence (integer) account / account.reconcile.model.template / to_check (boolean) : DEL account / account.report / _order : _order is now 'sequence, id' ('id') account / account.report / active (boolean) : NEW hasdefault: default -# TODO +# NOTHING TO DO account / account.report / chart_template (selection) : NEW selection_keys: function account / account.report / chart_template_id (many2one) : DEL relation: account.chart.template # DONE: map chart_template_id > chart_template in pre-migration account / account.report / default_opening_date_filter (selection): selection_keys is now '['last_month', 'last_quarter', 'last_tax_period', 'last_year', 'this_month', 'this_quarter', 'this_tax_period', 'this_year', 'today']' ('['last_month', 'last_quarter', 'last_year', 'this_month', 'this_quarter', 'this_year', 'today']') -# TODO +# NOTHING TO DO: new feature account / account.report / filter_account_type (boolean) : selection_keys is now '['both', 'disabled', 'payable', 'receivable']' ('False') account / account.report / filter_account_type (boolean) : type is now 'selection' ('boolean') @@ -197,28 +235,48 @@ account / account.report / section_main_report_ids (many2many): N account / account.report / section_report_ids (many2many): NEW relation: account.report account / account.report / sequence (integer) : NEW account / account.report / use_sections (boolean) : NEW hasdefault: compute -account / account.report.column / figure_type (selection) : selection_keys is now '['boolean', 'date', 'datetime', 'float', 'integer', 'monetary', 'percentage', 'string']' ('['date', 'datetime', 'float', 'integer', 'monetary', 'none', 'percentage']') -account / account.report.expression / figure_type (selection) : selection_keys is now '['boolean', 'date', 'datetime', 'float', 'integer', 'monetary', 'percentage', 'string']' ('['date', 'datetime', 'float', 'integer', 'monetary', 'none', 'percentage']') account / account.report.external.value / text_value (char) : NEW account / account.report.line / external_formula (char) : NEW account / account.report.line / user_groupby (char) : NEW +# NOTHING TO DO: probably need to do in module that add Localization report + +account / account.report.column / figure_type (selection) : selection_keys is now '['boolean', 'date', 'datetime', 'float', 'integer', 'monetary', 'percentage', 'string']' ('['date', 'datetime', 'float', 'integer', 'monetary', 'none', 'percentage']') +account / account.report.expression / figure_type (selection) : selection_keys is now '['boolean', 'date', 'datetime', 'float', 'integer', 'monetary', 'percentage', 'string']' ('['date', 'datetime', 'float', 'integer', 'monetary', 'none', 'percentage']') +# DONE pre-migration: update none -> string + account / account.tax / invoice_label (char) : NEW +# DONE pre-migration: create jsonb column(because translate=True) and fill value with 'description' field https://github.com/odoo/odoo/pull/113236/commits + account / account.tax / message_follower_ids (one2many): NEW relation: mail.followers account / account.tax / message_ids (one2many) : NEW relation: mail.message account / account.tax / rating_ids (one2many) : NEW relation: rating.rating +# NOTHING TO DO + account / account.tax / real_amount (float) : DEL +# NOTHING TO DO + account / account.tax / repartition_line_ids (one2many): NEW relation: account.tax.repartition.line -account / account.tax / website_message_ids (one2many): NEW relation: mail.message +# NOTHING TO DO: https://github.com/odoo/odoo/pull/110016/commits/a4c1f62ebd2710b3810c2d01195d88e4a9f13a9f + +account / account.tax / website_message_ids (one2many): NEW relation: mail.messag +# NOTHING TO DO + account / account.tax.group / advance_tax_payment_account_id (many2one): NEW relation: account.account -account / account.tax.group / company_id (many2one) : NEW relation: res.company, required, hasdefault: default account / account.tax.group / property_advance_tax_payment_account_id (many2one): DEL relation: account.account account / account.tax.group / property_tax_payable_account_id (many2one): DEL relation: account.account account / account.tax.group / property_tax_receivable_account_id (many2one): DEL relation: account.account account / account.tax.group / tax_payable_account_id (many2one): NEW relation: account.account account / account.tax.group / tax_receivable_account_id (many2one): NEW relation: account.account +# DONE pre-migration: update value base ir.propertys - waiting test if ir.property deleted or not + +account / account.tax.group / company_id (many2one) : NEW relation: res.company, required, hasdefault: default +# DONE pre-migration: create column and fill value base on account.tax + account / account.tax.repartition.line / _order : _order is now 'document_type, repartition_type, sequence, id' ('sequence, repartition_type, id') account / account.tax.repartition.line / company_id (many2one) : not a function anymore account / account.tax.repartition.line / company_id (many2one) : now related +# NOTHING TO DO + account / account.tax.repartition.line / document_type (selection) : is now stored account / account.tax.repartition.line / document_type (selection) : not a function anymore account / account.tax.repartition.line / document_type (selection) : now required @@ -226,6 +284,8 @@ account / account.tax.repartition.line / invoice_tax_id (many2one) : DE account / account.tax.repartition.line / refund_tax_id (many2one) : DEL relation: account.tax account / account.tax.repartition.line / tax_id (many2one) : is now stored account / account.tax.repartition.line / tax_id (many2one) : not a function anymore +# TODO : fill document_type and tax_id base on invoice_tax_id and refund_tax_id https://github.com/odoo/odoo/pull/110016/commits/a4c1f62ebd2710b3810c2d01195d88e4a9f13a9f + account / account.tax.repartition.line.template / account_id (many2one) : DEL relation: account.account.template account / account.tax.repartition.line.template / factor_percent (float) : DEL required account / account.tax.repartition.line.template / invoice_tax_id (many2one) : DEL relation: account.tax.template @@ -254,9 +314,9 @@ account / account.tax.template / tax_exigibility (selection) : DEL se account / account.tax.template / tax_group_id (many2one) : DEL relation: account.tax.group account / account.tax.template / tax_scope (selection) : DEL selection_keys: ['consu', 'service'] account / account.tax.template / type_tax_use (selection) : DEL required, selection_keys: ['none', 'purchase', 'sale'] +# NOTHING TO DO + account / res.company / account_dashboard_onboarding_state (selection): DEL selection_keys: ['closed', 'done', 'just_done', 'not_done'] -account / res.company / account_discount_expense_allocation_id (many2one): NEW relation: account.account -account / res.company / account_discount_income_allocation_id (many2one): NEW relation: account.account account / res.company / account_invoice_onboarding_state (selection): DEL selection_keys: ['closed', 'done', 'just_done', 'not_done'] account / res.company / account_onboarding_create_invoice_state_flag (boolean): DEL account / res.company / account_onboarding_invoice_layout_state (selection): DEL selection_keys: ['done', 'just_done', 'not_done'] @@ -266,29 +326,47 @@ account / res.company / account_setup_bill_state (selection): account / res.company / account_setup_coa_state (selection): DEL selection_keys: ['done', 'just_done', 'not_done'] account / res.company / account_setup_fy_data_state (selection): DEL selection_keys: ['done', 'just_done', 'not_done'] account / res.company / account_setup_taxes_state (selection): DEL selection_keys: ['done', 'just_done', 'not_done'] -# TODO +# TODO post-migration: update base on onboarding module + +account / res.company / account_discount_expense_allocation_id (many2one): NEW relation: account.account +account / res.company / account_discount_income_allocation_id (many2one): NEW relation: account.account +# NOTHING TO DO: new feature account / res.company / chart_template (selection) : NEW selection_keys: function account / res.company / chart_template_id (many2one) : DEL relation: account.chart.template # DONE: map chart_template_id > chart_template in pre-migration account / res.company / display_invoice_amount_total_words (boolean): NEW +# NOTHING TO DO: new feature + account / res.company / early_pay_discount_computation (selection): DEL selection_keys: ['excluded', 'included', 'mixed'] +# DONE pre-migration: Update in all payment terms of every company + account / res.company / invoice_is_download (boolean) : NEW hasdefault: default account / res.company / invoice_is_print (boolean) : DEL +# DONE pre-migration: rename field https://github.com/odoo/odoo/pull/119397 + account / res.company / message_main_attachment_id (many2one): DEL relation: ir.attachment +# NOTHING TO DO + account / res.company / property_stock_account_input_categ_id (many2one): DEL relation: account.account account / res.company / property_stock_account_output_categ_id (many2one): DEL relation: account.account account / res.company / property_stock_valuation_account_id (many2one): DEL relation: account.account +# NOTHING TO DO + account / res.company / rating_ids (one2many) : NEW relation: rating.rating account / res.partner.bank / activity_user_id (many2one) : not related anymore account / res.partner.bank / activity_user_id (many2one) : now a function +# NOTHING TO DO + account / res.partner.bank / has_iban_warning (boolean) : NEW isfunction: function, stored account / res.partner.bank / has_money_transfer_warning (boolean): NEW isfunction: function, stored +# DONE create column in pre-migration and compute using orm in end-migration + account / res.partner.bank / message_main_attachment_id (many2one): DEL relation: ir.attachment account / res.partner.bank / rating_ids (one2many) : NEW relation: rating.rating account / res.partner.bank / related_moves (one2many) : NEW relation: account.move -# TODO +# NOTHING TO DO ---XML records in module 'account'--- DEL account.payment.term: account.account_payment_term_2months (noupdate)