From 98b9c145e2c22c9df6f618439b6e20c95f93cf1c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 21 Mar 2014 02:01:05 +0100 Subject: [PATCH] [FIX] account_chart_update: Selection of operations to do now is working. [FIX] account_chart_update: Adapted to work with inherited account chart templates. [FIX] account_chart_update: Remove required=True for chart_template_id on DB and put on screen to avoid error when removing chart templates. [FIX] account_chart_update: Change method to compare taxes of fiscal positions to match with the one comparing taxes. [FIX] account_chart_update: Change method to compare accounts of fiscal positions to match with the one comparing accounts. [IMP] account_chart_update: Wizard now shows in tree view modification notes. [IMP] account_chart_update: For new data to be created, it is marked on notes the reason for the creation (just for clarity). [IMP] account_chart_update: Tabs for operations that are not going to be performed are hidden. [IMP] account_chart_update: Some PEP8 here and there. [IMP] account_chart_update: Enhance a little the mapping searches (there's more room to improve). [IMP] account_chart_update: Now it takes into account name and description for mapping taxes. --- .../i18n/account_chart_update.pot | 158 ++--- account_chart_update/i18n/es.po | 280 ++++---- .../wizard/wizard_chart_update.py | 636 ++++++++++-------- .../wizard/wizard_chart_update_view.xml | 51 +- 4 files changed, 555 insertions(+), 570 deletions(-) diff --git a/account_chart_update/i18n/account_chart_update.pot b/account_chart_update/i18n/account_chart_update.pot index 09d3596b7..f977ae4e9 100644 --- a/account_chart_update/i18n/account_chart_update.pot +++ b/account_chart_update/i18n/account_chart_update.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-15 14:01+0000\n" -"PO-Revision-Date: 2013-10-15 14:01+0000\n" +"POT-Creation-Date: 2014-03-21 00:56+0000\n" +"PO-Revision-Date: 2014-03-21 00:56+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -26,17 +26,12 @@ msgid "Account to update" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:368 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:382 #, python-format msgid "The code field is different.\n" "" msgstr "" -#. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "Fiscal position" -msgstr "" - #. module: account_chart_update #: field:wizard.update.charts.accounts,update_children_accounts_parent:0 msgid "Update children accounts parent" @@ -48,22 +43,22 @@ msgid "Fiscal position to update" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:716 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:769 #, python-format msgid "Created tax code %s.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1012 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1038 #, python-format msgid "Tax %s: The collected account can not be set.\n" "" msgstr "" #. module: account_chart_update -#: field:wizard.update.charts.accounts,new_accounts:0 -msgid "New accounts" +#: view:wizard.update.charts.accounts:0 +msgid "or" msgstr "" #. module: account_chart_update @@ -80,14 +75,14 @@ msgid "Company" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1076 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1102 #, python-format msgid "Fiscal position %s: The destination tax %s can not be set.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:839 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:881 #, python-format msgid "Tax %s: The tax code for the tax refund %s can not be set.\n" "" @@ -104,7 +99,7 @@ msgid "Updated tax codes" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:617 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:651 #, python-format msgid "The template has taxes the fiscal position instance does not.\n" "" @@ -115,11 +110,6 @@ msgstr "" msgid "Update accounts" msgstr "" -#. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "Account" -msgstr "" - #. module: account_chart_update #: field:wizard.update.charts.accounts.account,notes:0 #: field:wizard.update.charts.accounts.fiscal.position,notes:0 @@ -135,7 +125,7 @@ msgid "Taxes" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:371 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:385 #, python-format msgid "The info field is different.\n" "" @@ -147,7 +137,7 @@ msgid "New taxes" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:723 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:776 #, python-format msgid "Updated tax code %s.\n" "" @@ -164,21 +154,21 @@ msgid "Tax to update" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:806 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:851 #, python-format msgid "Created tax %s.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:459 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:477 #, python-format msgid "The base sign field is different.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:441 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:459 #, python-format msgid "The type field is different.\n" "" @@ -196,14 +186,14 @@ msgid "Accounts" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:835 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:877 #, python-format msgid "Tax %s: The tax code for the tax %s can not be set.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:612 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:646 #, python-format msgid "Tax mapping not found on the fiscal position instance: %s -> %s.\n" "" @@ -219,11 +209,6 @@ msgstr "" msgid "Previous" msgstr "" -#. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "Tax" -msgstr "" - #. module: account_chart_update #: view:wizard.update.charts.accounts:0 msgid "Next" @@ -243,7 +228,7 @@ msgid "No. of digits to use for account code. Make sure it is the same number as msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:435 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:453 #, python-format msgid "The sequence field is different.\n" "" @@ -255,7 +240,7 @@ msgid "Updated accounts" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:630 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:671 #, python-format msgid "Account mapping not found on the fiscal position instance: %s -> %s.\n" "" @@ -280,7 +265,7 @@ msgid "Updated taxes" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:465 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:483 #, python-format msgid "The include base amount field is different.\n" "" @@ -292,7 +277,7 @@ msgid "Chart of Accounts" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:633 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:674 #, python-format msgid "The template has accounts the fiscal position instance does not.\n" "" @@ -309,7 +294,7 @@ msgid "Step 2" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1014 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1040 #, python-format msgid "Tax %s: The paid account can not be set.\n" "" @@ -322,7 +307,7 @@ msgid "Update chart of accounts" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:941 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:972 #, python-format msgid "Exception creating account %s: %s - %s.\n" "" @@ -334,38 +319,50 @@ msgid "Continue on errors" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:453 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:471 #, python-format msgid "The python compute field is different.\n" "" msgstr "" +#. module: account_chart_update +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:648 +#, python-format +msgid "None" +msgstr "" + #. module: account_chart_update #: model:ir.model,name:account_chart_update.model_wizard_update_charts_accounts_tax_code msgid "wizard.update.charts.accounts.tax.code" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1092 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1124 #, python-format msgid "Fiscal position %s: The source account %s can not be set.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:833 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:875 #, python-format msgid "Tax %s: The tax code for the base %s can not be set.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:952 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:983 #, python-format msgid "Exception writing account %s: %s - %s.\n" "" msgstr "" +#. module: account_chart_update +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:543 +#, python-format +msgid "Code not found." +msgstr "" + #. module: account_chart_update #: view:wizard.update.charts.accounts:0 msgid "Note: Not all the fields are tested for changes, just the main ones" @@ -377,18 +374,13 @@ msgid "Update fiscal positions" msgstr "" #. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "or" -msgstr "" - -#. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:250 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:441 #, python-format -msgid "Update Chart of Accounts from a Chart Template " +msgid "Name or description not found." msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:531 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:551 #, python-format msgid "The name is different.\n" "" @@ -400,28 +392,28 @@ msgid "Log" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:736 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:787 #, python-format msgid "Tax code %s: The parent tax code %s can not be set.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:438 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:456 #, python-format msgid "The amount field is different.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:450 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:468 #, python-format msgid "The child depend field is different.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:948 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:979 #, python-format msgid "Updated account %s.\n" "" @@ -438,7 +430,7 @@ msgid "Messages and Errors" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:468 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:486 #, python-format msgid "The type tax use field is different.\n" "" @@ -450,14 +442,14 @@ msgid "Wizard completed" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:963 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:992 #, python-format msgid "Account %s: The parent account %s can not be set.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:831 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:873 #, python-format msgid "Tax %s: The parent tax %s can not be set.\n" "" @@ -485,21 +477,21 @@ msgid "Summary of updated objects" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:374 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:388 #, python-format msgid "The sign field is different.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:813 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:858 #, python-format msgid "Updated tax %s.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:874 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:914 #, python-format msgid "Exception setting the parent of account %s children: %s - %s.\n" "" @@ -531,7 +523,7 @@ msgid "Account template" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1127 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1173 #, python-format msgid "Error" msgstr "" @@ -542,7 +534,7 @@ msgid "Summary of created objects" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:534 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:554 #, python-format msgid "The type is different.\n" "" @@ -564,6 +556,11 @@ msgstr "" msgid "Cancel" msgstr "" +#. module: account_chart_update +#: view:wizard.update.charts.accounts:0 +msgid "Close" +msgstr "" + #. module: account_chart_update #: help:wizard.update.charts.accounts,update_tax:0 msgid "Existing taxes are updated. Taxes are searched by name." @@ -575,7 +572,7 @@ msgid "Create/Update" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:837 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:879 #, python-format msgid "Tax %s: The tax code for the base refund %s can not be set.\n" "" @@ -592,14 +589,14 @@ msgid "Chart Template" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:462 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:480 #, python-format msgid "The tax sign field is different.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1127 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1173 #, python-format msgid "One or more errors detected!\n" "\n" @@ -607,7 +604,7 @@ msgid "One or more errors detected!\n" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1094 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1126 #, python-format msgid "Fiscal position %s: The destination account %s can not be set.\n" "" @@ -619,15 +616,15 @@ msgid "New fiscal positions" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:444 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:462 #, python-format msgid "The applicable type field is different.\n" "" msgstr "" #. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "Tax code" +#: field:wizard.update.charts.accounts,new_accounts:0 +msgid "New accounts" msgstr "" #. module: account_chart_update @@ -636,10 +633,9 @@ msgid "Tax template" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:614 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:373 #, python-format -msgid "Tax mapping not found on the fiscal position instance: %s -> None.\n" -"" +msgid "Name or code not found." msgstr "" #. module: account_chart_update @@ -653,7 +649,7 @@ msgid "Existing fiscal positions are updated. Fiscal positions are searched by n msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:537 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:557 #, python-format msgid "The user type is different.\n" "" @@ -673,14 +669,14 @@ msgid "This wizard will update your accounts, taxes and fiscal positions accordi msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:540 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:560 #, python-format msgid "The reconcile is different.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:447 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:465 #, python-format msgid "The domain field is different.\n" "" @@ -702,14 +698,14 @@ msgid "Records to create/update" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1096 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1128 #, python-format msgid "Created or updated fiscal position %s.\n" "" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1074 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1100 #, python-format msgid "Fiscal position %s: The source tax %s can not be set.\n" "" @@ -726,7 +722,7 @@ msgid "For records searched by name (taxes, tax codes, fiscal positions), the te msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:937 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:968 #, python-format msgid "Created account %s.\n" "" @@ -737,6 +733,12 @@ msgstr "" msgid "Update the parent of accounts that seem (based on the code) to be children of the newly created ones. If you had an account 430 with a child 4300000, and a 4300 account is created, the 4300000 parent will be set to 4300." msgstr "" +#. module: account_chart_update +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:616 +#, python-format +msgid "Name not found." +msgstr "" + #. module: account_chart_update #: help:wizard.update.charts.accounts,continue_on_errors:0 msgid "If set, the wizard will continue to the next step even if there are minor errors (for example the parent account of a new account couldn't be set)." diff --git a/account_chart_update/i18n/es.po b/account_chart_update/i18n/es.po index 1d7f9ca15..e093a6fa3 100644 --- a/account_chart_update/i18n/es.po +++ b/account_chart_update/i18n/es.po @@ -6,15 +6,14 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-15 14:01+0000\n" -"PO-Revision-Date: 2013-10-29 14:13+0000\n" -"Last-Translator: Pedro Manuel Baeza \n" +"POT-Creation-Date: 2014-03-21 00:57+0000\n" +"PO-Revision-Date: 2014-03-21 01:59+0100\n" +"Last-Translator: Pedro Manuel Baeza \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-03-08 06:52+0000\n" -"X-Generator: Launchpad (build 16948)\n" +"Plural-Forms: \n" #. module: account_chart_update #: view:wizard.update.charts.accounts:0 @@ -27,16 +26,11 @@ msgid "Account to update" msgstr "Cuenta a actualizar" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:368 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:382 #, python-format msgid "The code field is different.\n" msgstr "El campo código es diferente.\n" -#. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "Fiscal position" -msgstr "Posición fiscal" - #. module: account_chart_update #: field:wizard.update.charts.accounts,update_children_accounts_parent:0 msgid "Update children accounts parent" @@ -48,21 +42,21 @@ msgid "Fiscal position to update" msgstr "Posición fiscal a actualizar" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:716 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:769 #, python-format msgid "Created tax code %s.\n" msgstr "Creado código de impuesto %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1012 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1038 #, python-format msgid "Tax %s: The collected account can not be set.\n" msgstr "Impuesto %s: No se pudo establecer la cuenta a recibir.\n" #. module: account_chart_update -#: field:wizard.update.charts.accounts,new_accounts:0 -msgid "New accounts" -msgstr "Nuevas cuentas" +#: view:wizard.update.charts.accounts:0 +msgid "or" +msgstr "o" #. module: account_chart_update #: selection:wizard.update.charts.accounts.account,type:0 @@ -78,28 +72,21 @@ msgid "Company" msgstr "Compañía" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1076 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1102 #, python-format msgid "Fiscal position %s: The destination tax %s can not be set.\n" msgstr "Posición fiscal %s: No se pudo establecer la cuenta destino %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:839 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:881 #, python-format msgid "Tax %s: The tax code for the tax refund %s can not be set.\n" -msgstr "" -"Impuesto %s: No se pudo establecer el código de impuesto para la devolución " -"de impuesto %s.\n" +msgstr "Impuesto %s: No se pudo establecer el código de impuesto para la devolución de impuesto %s.\n" #. module: account_chart_update #: view:wizard.update.charts.accounts:0 -msgid "" -"If you leave these options set, the wizard will not just create new records, " -"but also update records with changes (i.e. different tax amount)" -msgstr "" -"Si deja esta opción marcada, el asistente creará no sólo nuevos registros, " -"si no que también actualizará aquellos con cambios (por ejemplo, diferente " -"porcentaje de impuesto)" +msgid "If you leave these options set, the wizard will not just create new records, but also update records with changes (i.e. different tax amount)" +msgstr "Si deja esta opción marcada, el asistente creará no sólo nuevos registros, si no que también actualizará aquellos con cambios (por ejemplo, diferente porcentaje de impuesto)" #. module: account_chart_update #: field:wizard.update.charts.accounts,updated_tax_codes:0 @@ -107,22 +94,16 @@ msgid "Updated tax codes" msgstr "Códigos de impuesto actualizados" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:617 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:651 #, python-format msgid "The template has taxes the fiscal position instance does not.\n" -msgstr "" -"La plantilla tiene impuestos que la instancia de posición fiscal no.\n" +msgstr "La plantilla tiene impuestos que la instancia de posición fiscal no.\n" #. module: account_chart_update #: field:wizard.update.charts.accounts,update_account:0 msgid "Update accounts" msgstr "Actualizar cuentas" -#. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "Account" -msgstr "Cuenta" - #. module: account_chart_update #: field:wizard.update.charts.accounts.account,notes:0 #: field:wizard.update.charts.accounts.fiscal.position,notes:0 @@ -138,7 +119,7 @@ msgid "Taxes" msgstr "Impuestos" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:371 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:385 #, python-format msgid "The info field is different.\n" msgstr "El campo info es diferente.\n" @@ -149,7 +130,7 @@ msgid "New taxes" msgstr "Nuevos impuestos" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:723 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:776 #, python-format msgid "Updated tax code %s.\n" msgstr "Actualizado código de impuesto %s.\n" @@ -165,19 +146,19 @@ msgid "Tax to update" msgstr "Impuesto a actualizar" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:806 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:851 #, python-format msgid "Created tax %s.\n" msgstr "Creado impuesto %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:459 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:477 #, python-format msgid "The base sign field is different.\n" msgstr "El campo signo base es diferente.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:441 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:459 #, python-format msgid "The type field is different.\n" msgstr "El campo tipo es diferente.\n" @@ -194,38 +175,27 @@ msgid "Accounts" msgstr "Cuentas" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:835 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:877 #, python-format msgid "Tax %s: The tax code for the tax %s can not be set.\n" -msgstr "" -"Impuesto %s: No se pudo establecer el código de impuesto para el impuesto " -"%s.\n" +msgstr "Impuesto %s: No se pudo establecer el código de impuesto para el impuesto %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:612 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:646 #, python-format msgid "Tax mapping not found on the fiscal position instance: %s -> %s.\n" -msgstr "" -"Mapeo de cuenta no encontrado en la instancia de la posición fiscal: %s -> " -"%s.\n" +msgstr "Mapeo de cuenta no encontrado en la instancia de la posición fiscal: %s -> %s.\n" #. module: account_chart_update #: help:wizard.update.charts.accounts,update_tax_code:0 msgid "Existing tax codes are updated. Tax codes are searched by name." -msgstr "" -"Los códigos de impuestos existentes serán actualizados. Los códigos de " -"impuestos se buscarán por nombre." +msgstr "Los códigos de impuestos existentes serán actualizados. Los códigos de impuestos se buscarán por nombre." #. module: account_chart_update #: view:wizard.update.charts.accounts:0 msgid "Previous" msgstr "Anterior" -#. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "Tax" -msgstr "Impuesto" - #. module: account_chart_update #: view:wizard.update.charts.accounts:0 msgid "Next" @@ -241,15 +211,11 @@ msgstr "Nueva plantilla" #. module: account_chart_update #: help:wizard.update.charts.accounts,code_digits:0 -msgid "" -"No. of digits to use for account code. Make sure it is the same number as " -"existing accounts." -msgstr "" -"Nº de dígitos a usar para el código de cuenta. Asegúrese que este número es " -"el mismo que el de las cuentas existentes." +msgid "No. of digits to use for account code. Make sure it is the same number as existing accounts." +msgstr "Nº de dígitos a usar para el código de cuenta. Asegúrese que este número es el mismo que el de las cuentas existentes." #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:435 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:453 #, python-format msgid "The sequence field is different.\n" msgstr "El campo secuencia es diferente.\n" @@ -260,12 +226,10 @@ msgid "Updated accounts" msgstr "Cuentas actualizadas" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:630 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:671 #, python-format -msgid "" -"Account mapping not found on the fiscal position instance: %s -> %s.\n" -msgstr "" -"Mapeo de cuenta no encontrado en la instancia de posición fiscal: %s -> %s.\n" +msgid "Account mapping not found on the fiscal position instance: %s -> %s.\n" +msgstr "Mapeo de cuenta no encontrado en la instancia de posición fiscal: %s -> %s.\n" #. module: account_chart_update #: model:ir.model,name:account_chart_update.model_wizard_update_charts_accounts_tax @@ -286,7 +250,7 @@ msgid "Updated taxes" msgstr "Impuestos actualizados" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:465 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:483 #, python-format msgid "The include base amount field is different.\n" msgstr "El campo incluir en importe base es diferente.\n" @@ -297,7 +261,7 @@ msgid "Chart of Accounts" msgstr "Plan contable" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:633 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:674 #, python-format msgid "The template has accounts the fiscal position instance does not.\n" msgstr "La plantilla tiene cuentas que la instancia de posición fiscal no.\n" @@ -313,7 +277,7 @@ msgid "Step 2" msgstr "Paso 2" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1014 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1040 #, python-format msgid "Tax %s: The paid account can not be set.\n" msgstr "Impuesto %s: No se pudo establecer la cuenta a pagar.\n" @@ -325,7 +289,7 @@ msgid "Update chart of accounts" msgstr "Actualizar plan de cuentas" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:941 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:972 #, python-format msgid "Exception creating account %s: %s - %s.\n" msgstr "Excepción creando cuenta %s: %s - %s.\n" @@ -336,35 +300,46 @@ msgid "Continue on errors" msgstr "Continuar tras errores" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:453 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:471 #, python-format msgid "The python compute field is different.\n" msgstr "El campo cálculo python es diferente.\n" +#. module: account_chart_update +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:648 +#, python-format +msgid "None" +msgstr "Ninguno" + #. module: account_chart_update #: model:ir.model,name:account_chart_update.model_wizard_update_charts_accounts_tax_code msgid "wizard.update.charts.accounts.tax.code" msgstr "wizard.update.charts.accounts.tax.code" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1092 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1124 #, python-format msgid "Fiscal position %s: The source account %s can not be set.\n" msgstr "Posición fiscal %s: No se pudo establecer la cuenta de origen %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:833 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:875 #, python-format msgid "Tax %s: The tax code for the base %s can not be set.\n" -msgstr "" -"Impuesto %s: No se pudo establecer el código de impuesto para la base %s.\n" +msgstr "Impuesto %s: No se pudo establecer el código de impuesto para la base %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:952 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:983 #, python-format msgid "Exception writing account %s: %s - %s.\n" msgstr "Excepción escribiendo cuenta %s: %s - %s.\n" +#. module: account_chart_update +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:543 +#, python-format +msgid "Code not found." +msgstr "Código no encontrado." + #. module: account_chart_update #: view:wizard.update.charts.accounts:0 msgid "Note: Not all the fields are tested for changes, just the main ones" @@ -376,18 +351,13 @@ msgid "Update fiscal positions" msgstr "Actualizar posiciones fiscales" #. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "or" -msgstr "o" - -#. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:250 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:441 #, python-format -msgid "Update Chart of Accounts from a Chart Template " -msgstr "Actualizar plan contable a partir de una plantilla de plan contable " +msgid "Name or description not found." +msgstr "Nombre o descripción no encontrada." #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:531 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:551 #, python-format msgid "The name is different.\n" msgstr "El nombre es diferente.\n" @@ -398,27 +368,25 @@ msgid "Log" msgstr "Registro" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:736 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:787 #, python-format msgid "Tax code %s: The parent tax code %s can not be set.\n" -msgstr "" -"Código de impuesto %s: No se pudo establecer el código de impuesto padre " -"%s.\n" +msgstr "Código de impuesto %s: No se pudo establecer el código de impuesto padre %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:438 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:456 #, python-format msgid "The amount field is different.\n" msgstr "El campo importe es diferente.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:450 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:468 #, python-format msgid "The child depend field is different.\n" msgstr "El campo impuesto en hijos es diferente.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:948 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:979 #, python-format msgid "Updated account %s.\n" msgstr "Actualizada cuenta %s.\n" @@ -434,7 +402,7 @@ msgid "Messages and Errors" msgstr "Mensajes y errores" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:468 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:486 #, python-format msgid "The type tax use field is different.\n" msgstr "El campo aplicación impuesto es diferente.\n" @@ -445,13 +413,13 @@ msgid "Wizard completed" msgstr "Asistente completado" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:963 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:992 #, python-format msgid "Account %s: The parent account %s can not be set.\n" msgstr "Cuenta %s: No se pudo establecer la cuenta padre %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:831 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:873 #, python-format msgid "Tax %s: The parent tax %s can not be set.\n" msgstr "Impuesto %s: No se pudo establecer el impuesto padre %s.\n" @@ -478,30 +446,27 @@ msgid "Summary of updated objects" msgstr "Resumen de objetos actualizados" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:374 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:388 #, python-format msgid "The sign field is different.\n" msgstr "El campo signo es diferente.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:813 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:858 #, python-format msgid "Updated tax %s.\n" msgstr "Actualizado impuesto %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:874 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:914 #, python-format msgid "Exception setting the parent of account %s children: %s - %s.\n" -msgstr "" -"Excepción estableciendo el padre de los hijos de la cuenta %s: %s - %s.\n" +msgstr "Excepción estableciendo el padre de los hijos de la cuenta %s: %s - %s.\n" #. module: account_chart_update #: help:wizard.update.charts.accounts,update_account:0 msgid "Existing accounts are updated. Accounts are searched by code." -msgstr "" -"Las cuentas contables existentes serán actualizadas. Las cuentas se buscarán " -"por código." +msgstr "Las cuentas contables existentes serán actualizadas. Las cuentas se buscarán por código." #. module: account_chart_update #: field:wizard.update.charts.accounts,code_digits:0 @@ -524,7 +489,7 @@ msgid "Account template" msgstr "Plantilla de cuenta" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1127 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1173 #, python-format msgid "Error" msgstr "Error" @@ -535,7 +500,7 @@ msgid "Summary of created objects" msgstr "Resumen de objetos creados" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:534 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:554 #, python-format msgid "The type is different.\n" msgstr "El tipo es diferente.\n" @@ -556,12 +521,15 @@ msgstr "Actualizar impuestos" msgid "Cancel" msgstr "Cancelar" +#. module: account_chart_update +#: view:wizard.update.charts.accounts:0 +msgid "Close" +msgstr "Cerrar" + #. module: account_chart_update #: help:wizard.update.charts.accounts,update_tax:0 msgid "Existing taxes are updated. Taxes are searched by name." -msgstr "" -"Los impuestos existentes serán actualizados. Los impuestos se buscarán por " -"nombre." +msgstr "Los impuestos existentes serán actualizados. Los impuestos se buscarán por nombre." #. module: account_chart_update #: view:wizard.update.charts.accounts:0 @@ -569,12 +537,10 @@ msgid "Create/Update" msgstr "Crear/Actualizar" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:837 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:879 #, python-format msgid "Tax %s: The tax code for the base refund %s can not be set.\n" -msgstr "" -"Impuesto %s: No se pudo establecer el código de impuesto para la base de " -"devolución %s.\n" +msgstr "Impuesto %s: No se pudo establecer el código de impuesto para la base de devolución %s.\n" #. module: account_chart_update #: model:ir.model,name:account_chart_update.model_wizard_update_charts_accounts @@ -587,13 +553,13 @@ msgid "Chart Template" msgstr "Plantilla plan contable" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:462 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:480 #, python-format msgid "The tax sign field is different.\n" msgstr "El campo signo de impuesto es diferente.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1127 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1173 #, python-format msgid "" "One or more errors detected!\n" @@ -605,7 +571,7 @@ msgstr "" "%s" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1094 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1126 #, python-format msgid "Fiscal position %s: The destination account %s can not be set.\n" msgstr "Posición fiscal %s: No se pudo establecer la cuenta de destino %s.\n" @@ -616,15 +582,15 @@ msgid "New fiscal positions" msgstr "Nuevas posiciones fiscales" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:444 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:462 #, python-format msgid "The applicable type field is different.\n" msgstr "El campo tipo aplicable es diferente.\n" #. module: account_chart_update -#: view:wizard.update.charts.accounts:0 -msgid "Tax code" -msgstr "Código de impuesto" +#: field:wizard.update.charts.accounts,new_accounts:0 +msgid "New accounts" +msgstr "Nuevas cuentas" #. module: account_chart_update #: field:wizard.update.charts.accounts.tax,tax_id:0 @@ -632,12 +598,10 @@ msgid "Tax template" msgstr "Plantilla de impuesto" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:614 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:373 #, python-format -msgid "Tax mapping not found on the fiscal position instance: %s -> None.\n" -msgstr "" -"Mapeo de cuentas no encontrado en la instancia de posición fiscal: %s -> " -"Ninguno.\n" +msgid "Name or code not found." +msgstr "Name or code not found." #. module: account_chart_update #: view:wizard.update.charts.accounts:0 @@ -646,14 +610,11 @@ msgstr "¿Actualizar registros?" #. module: account_chart_update #: help:wizard.update.charts.accounts,update_fiscal_position:0 -msgid "" -"Existing fiscal positions are updated. Fiscal positions are searched by name." -msgstr "" -"Las posiciones fiscales existentes serán actualizadas. Las posiciones " -"fiscales se buscarán por nombre." +msgid "Existing fiscal positions are updated. Fiscal positions are searched by name." +msgstr "Las posiciones fiscales existentes serán actualizadas. Las posiciones fiscales se buscarán por nombre." #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:537 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:557 #, python-format msgid "The user type is different.\n" msgstr "El tipo de usuario es diferente.\n" @@ -668,21 +629,17 @@ msgstr "Asistente para actualizar el plan contable" #. module: account_chart_update #: view:wizard.update.charts.accounts:0 -msgid "" -"This wizard will update your accounts, taxes and fiscal positions according " -"to the selected chart template" -msgstr "" -"Este asistente actualizará sus cuentas, impuestos y posiciones fiscales de " -"acuerdo a la plantilla de plan contable seleccionada" +msgid "This wizard will update your accounts, taxes and fiscal positions according to the selected chart template" +msgstr "Este asistente actualizará sus cuentas, impuestos y posiciones fiscales de acuerdo a la plantilla de plan contable seleccionada" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:540 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:560 #, python-format msgid "The reconcile is different.\n" msgstr "El campo reconciliar es diferente.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:447 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:465 #, python-format msgid "The domain field is different.\n" msgstr "El campo dominio es diferente.\n" @@ -703,13 +660,13 @@ msgid "Records to create/update" msgstr "Registros a crear/actualizar" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1096 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1128 #, python-format msgid "Created or updated fiscal position %s.\n" msgstr "Creada o actualizada posición fiscal %s.\n" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1074 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:1100 #, python-format msgid "Fiscal position %s: The source tax %s can not be set.\n" msgstr "Posición fiscal %s: No se pudo establecer el impuesto origen %s.\n" @@ -721,42 +678,33 @@ msgstr "Posiciones fiscales actualizadas" #. module: account_chart_update #: help:wizard.update.charts.accounts,lang:0 -msgid "" -"For records searched by name (taxes, tax codes, fiscal positions), the " -"template name will be matched against the record name on this language." -msgstr "" -"Para los registros de impuestos, códigos de impuestos y posiciones " -"fiscales, sus nombres se comparan con los de la plantilla seleccionada." +msgid "For records searched by name (taxes, tax codes, fiscal positions), the template name will be matched against the record name on this language." +msgstr "Para los registros de impuestos, códigos de impuestos y posiciones fiscales, sus nombres se comparan con los de la plantilla seleccionada." #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:937 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:968 #, python-format msgid "Created account %s.\n" msgstr "Creada cuenta %s.\n" #. module: account_chart_update #: help:wizard.update.charts.accounts,update_children_accounts_parent:0 -msgid "" -"Update the parent of accounts that seem (based on the code) to be children " -"of the newly created ones. If you had an account 430 with a child 4300000, " -"and a 4300 account is created, the 4300000 parent will be set to 4300." -msgstr "" -"Actualizar el padre de las cuentas que parecen (basándose en el código) ser " -"hijas de las cuentas recién creadas. Si tiene una cuenta 430 con una hija " -"4300000, y se crea una cuenta 4300, se establecerá la cuenta 4300 como padre " -"de la cuenta 4300000." +msgid "Update the parent of accounts that seem (based on the code) to be children of the newly created ones. If you had an account 430 with a child 4300000, and a 4300 account is created, the 4300000 parent will be set to 4300." +msgstr "Actualizar el padre de las cuentas que parecen (basándose en el código) ser hijas de las cuentas recién creadas. Si tiene una cuenta 430 con una hija 4300000, y se crea una cuenta 4300, se establecerá la cuenta 4300 como padre de la cuenta 4300000." + +#. module: account_chart_update +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:616 +#, python-format +msgid "Name not found." +msgstr "Nombre no encontrado." #. module: account_chart_update #: help:wizard.update.charts.accounts,continue_on_errors:0 -msgid "" -"If set, the wizard will continue to the next step even if there are minor " -"errors (for example the parent account of a new account couldn't be set)." -msgstr "" -"Si está marcado, el asistente continuará al paso siguiente incluso si hay " -"errores menores (por ejemplo, no se pudo establecer la cuenta padre de una " -"nueva cuenta)." +msgid "If set, the wizard will continue to the next step even if there are minor errors (for example the parent account of a new account couldn't be set)." +msgstr "Si está marcado, el asistente continuará al paso siguiente incluso si hay errores menores (por ejemplo, no se pudo establecer la cuenta padre de una nueva cuenta)." #. module: account_chart_update #: field:wizard.update.charts.accounts.tax.code,tax_code_id:0 msgid "Tax code template" msgstr "Plantilla de código de impuesto" + diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 357e8be81..c0f98c312 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -97,7 +97,9 @@ class wizard_update_charts_accounts(orm.TransientModel): ('done', 'Wizard completed') ], 'Status', readonly=True), 'company_id': fields.many2one('res.company', 'Company', required=True, ondelete='set null'), - 'chart_template_id': fields.many2one('account.chart.template', 'Chart Template', required=True, ondelete='set null'), + 'chart_template_id': fields.many2one('account.chart.template', + 'Chart Template', + ondelete='set null'), 'code_digits': fields.integer('# of digits', required=True, help="No. of digits to use for account code. Make sure it is the same number as existing accounts."), 'lang': fields.selection(_get_lang_selection_options, 'Language', size=5, help="For records searched by name (taxes, tax codes, fiscal positions), the template name will be matched against the record name on this language."), 'update_tax_code': fields.boolean('Update tax codes', help="Existing tax codes are updated. Tax codes are searched by name."), @@ -242,115 +244,140 @@ class wizard_update_charts_accounts(orm.TransientModel): # Helper methods ########################################################################## - def _map_tax_template(self, cr, uid, wizard, tax_template_mapping, tax_template, context=None): + def _map_tax_template(self, cr, uid, wizard, tax_templ_mapping, + tax_templ, context=None): """ Adds a tax template -> tax id to the mapping. """ - if tax_template and not tax_template_mapping.get(tax_template.id): - taxes = self.pool.get('account.tax') - tax_ids = taxes.search(cr, uid, [ - ('name', '=', tax_template.name), - ('company_id', '=', wizard.company_id.id) - ], context=context) - if tax_ids: - tax_template_mapping[tax_template.id] = tax_ids[0] + if not tax_templ: + return False + if tax_templ_mapping.get(tax_templ.id): + return tax_templ_mapping[tax_templ.id] + # In other case + tax_obj = self.pool['account.tax'] + criteria = ['|', + ('name', '=', tax_templ.name), + ('description', '=', tax_templ.name)] + if tax_templ.description: + criteria = (['|', '|'] + criteria + + [('description', '=', tax_templ.description), + ('name', '=', tax_templ.description)]) + tax_ids = tax_obj.search(cr, uid, criteria, context=context) + tax_templ_mapping[tax_templ.id] = tax_ids and tax_ids[0] or False + return tax_templ_mapping[tax_templ.id] - def _map_tax_code_template(self, cr, uid, wizard, tax_code_template_mapping, tax_code_template, context=None): + def _map_tax_code_template(self, cr, uid, wizard, + tax_code_templ_mapping, tax_code_template, + context=None): """ Adds a tax code template -> tax code id to the mapping. """ - if tax_code_template and not tax_code_template_mapping.get(tax_code_template.id): - tax_codes = self.pool.get('account.tax.code') - root_tax_code_id = wizard.chart_template_id.tax_code_root_id.id - tax_code_name = (tax_code_template.id == root_tax_code_id) and wizard.company_id.name or tax_code_template.name - tax_code_ids = tax_codes.search(cr, uid, [ - ('name', '=', tax_code_name), - ('company_id', '=', wizard.company_id.id) - ]) - if not tax_code_ids: - # if we could not match no tax code template name, - # try to match on tax code template code, if any - tax_code_code = tax_code_template.code - if tax_code_code: - tax_code_ids = tax_codes.search(cr, uid, [ - ('code', '=', tax_code_code), - ('company_id', '=', wizard.company_id.id) - ]) - if tax_code_ids: - tax_code_template_mapping[ - tax_code_template.id] = tax_code_ids[0] + if not tax_code_template: + return False + if tax_code_templ_mapping.get(tax_code_template.id): + return tax_code_templ_mapping[tax_code_template.id] + # In other case + tax_code_obj = self.pool['account.tax.code'] + root_tax_code_id = wizard.chart_template_id.tax_code_root_id.id + tax_code_name = ((tax_code_template.id == root_tax_code_id) and + wizard.company_id.name or tax_code_template.name) + tax_code_ids = tax_code_obj.search(cr, uid, [ + ('name', '=', tax_code_name), + ('company_id', '=', wizard.company_id.id) + ]) + if not tax_code_ids: + # if we could not match no tax code template name, + # try to match on tax code template code, if any + tax_code_code = tax_code_template.code + if tax_code_code: + tax_code_ids = tax_code_obj.search(cr, uid, [ + ('code', '=', tax_code_code), + ('company_id', '=', wizard.company_id.id) + ]) + tax_code_templ_mapping[tax_code_template.id] = (tax_code_ids and + tax_code_ids[0] or + False) + return tax_code_templ_mapping[tax_code_template.id] - def _map_account_template(self, cr, uid, wizard, account_template_mapping, account_template, context=None): + def _map_account_template(self, cr, uid, wizard,acc_templ_mapping, + acc_templ, context=None): """ Adds an account template -> account id to the mapping """ - if account_template and not account_template_mapping.get(account_template.id): - accounts = self.pool.get('account.account') - code = account_template.code or '' - if account_template.type != 'view': - if len(code) > 0 and len(code) <= wizard.code_digits: - code = '%s%s' % ( - code, '0' * (wizard.code_digits - len(code))) - account_ids = accounts.search(cr, uid, [ - ('code', '=', code), - ('company_id', '=', wizard.company_id.id) - ], context=context) - if account_ids: - account_template_mapping[account_template.id] = account_ids[0] + if not acc_templ: + return False + if acc_templ_mapping.get(acc_templ.id): + return acc_templ_mapping[acc_templ.id] + # In other case + acc_obj = self.pool['account.account'] + code = acc_templ.code or '' + if acc_templ.type != 'view': + if code and len(code) <= wizard.code_digits: + code = '%s%s' % (code, '0' * (wizard.code_digits - len(code))) + acc_ids = acc_obj.search(cr, uid, [ + ('code', '=', code), + ('company_id', '=', wizard.company_id.id) + ], context=context) + acc_templ_mapping[acc_templ.id] = acc_ids and acc_ids[0] or False + return acc_templ_mapping[acc_templ.id] - def _map_fp_template(self, cr, uid, wizard, fp_template_mapping, fp_template, context=None): + def _map_fp_template(self, cr, uid, wizard, fp_templ_mapping, fp_template, context=None): """ Adds a fiscal position template -> fiscal position id to the mapping. """ - if fp_template and not fp_template_mapping.get(fp_template.id): - fiscalpositions = self.pool.get('account.fiscal.position') - fp_ids = fiscalpositions.search(cr, uid, [ - ('name', '=', fp_template.name), - ('company_id', '=', wizard.company_id.id) - ], context=context) - if fp_ids: - fp_template_mapping[fp_template.id] = fp_ids[0] + if not fp_template: + return False + if fp_templ_mapping.get(fp_template.id): + return fp_templ_mapping[fp_template.id] + # In other case + fp_obj = self.pool['account.fiscal.position'] + fp_ids = fp_obj.search(cr, uid, + [('name', '=', fp_template.name), + ('company_id', '=', wizard.company_id.id)], + context=context) + fp_templ_mapping[fp_template.id] = fp_ids and fp_ids[0] or False + return fp_templ_mapping[fp_template.id] - def _find_tax_codes(self, cr, uid, wizard, context=None): + def _find_tax_codes(self, cr, uid, wizard, chart_template_ids, + context=None): """ Search for, and load, tax code templates to create/update. + + @param chart_template_ids: IDs of the chart templates to look on, + calculated once in the calling method. """ new_tax_codes = 0 updated_tax_codes = 0 tax_code_template_mapping = {} - - taxes_codes_templates = self.pool.get('account.tax.code.template') - taxcodes = self.pool.get('account.tax.code') - wiz_taxcodes = self.pool.get('wizard.update.charts.accounts.tax.code') - + tax_code_templ_obj = self.pool['account.tax.code.template'] + tax_code_obj = self.pool['account.tax.code'] + wiz_tax_code_obj = self.pool['wizard.update.charts.accounts.tax.code'] # Remove previous tax codes - wiz_taxcodes.unlink( - cr, uid, wiz_taxcodes.search(cr, uid, [])) - + wiz_tax_code_obj.unlink(cr, uid, wiz_tax_code_obj.search(cr, uid, [])) # Search for new / updated tax codes root_tax_code_id = wizard.chart_template_id.tax_code_root_id.id - children_tax_code_template = taxes_codes_templates.search(cr, uid, [( + children_tax_code_template = tax_code_templ_obj.search(cr, uid, [( 'parent_id', 'child_of', [root_tax_code_id])], order='id') - for tax_code_template in taxes_codes_templates.browse(cr, uid, children_tax_code_template): + for tax_code_template in tax_code_templ_obj.browse(cr, uid, children_tax_code_template): # Ensure the tax code template is on the map (search for the mapped # tax code id). - self._map_tax_code_template(cr, uid, wizard, tax_code_template_mapping, tax_code_template, context) - - tax_code_id = tax_code_template_mapping.get(tax_code_template.id) + tax_code_id = self._map_tax_code_template(cr, uid, wizard, + tax_code_template_mapping, + tax_code_template, context=context) if not tax_code_id: new_tax_codes += 1 - wiz_taxcodes.create(cr, uid, { + wiz_tax_code_obj.create(cr, uid, { 'tax_code_id': tax_code_template.id, 'update_chart_wizard_id': wizard.id, 'type': 'new', + 'notes': _('Name or code not found.'), }, context) elif wizard.update_tax_code: # Check the tax code for changes. modified = False notes = "" - tax_code = taxcodes.browse( + tax_code = tax_code_obj.browse( cr, uid, tax_code_id, context=context) - if tax_code.code != tax_code_template.code: notes += _("The code field is different.\n") modified = True @@ -360,117 +387,119 @@ class wizard_update_charts_accounts(orm.TransientModel): if tax_code.sign != tax_code_template.sign: notes += _("The sign field is different.\n") modified = True - # TODO: We could check other account fields for changes... - if modified: # Tax code to update. updated_tax_codes += 1 - wiz_taxcodes.create(cr, uid, { + wiz_tax_code_obj.create(cr, uid, { 'tax_code_id': tax_code_template.id, 'update_chart_wizard_id': wizard.id, 'type': 'updated', 'update_tax_code_id': tax_code_id, 'notes': notes, }, context) - return { 'new': new_tax_codes, 'updated': updated_tax_codes, 'mapping': tax_code_template_mapping } - def _find_taxes(self, cr, uid, wizard, context=None): + def _find_taxes(self, cr, uid, wizard, chart_template_ids, context=None): """ Search for, and load, tax templates to create/update. + + @param chart_template_ids: IDs of the chart templates to look on, + calculated once in the calling method. """ new_taxes = 0 updated_taxes = 0 - tax_template_mapping = {} - - taxes = self.pool.get('account.tax') - wiz_taxes = self.pool.get('wizard.update.charts.accounts.tax') - + tax_templ_mapping = {} + tax_obj = self.pool['account.tax'] + tax_templ_obj = self.pool['account.tax.template'] + wiz_taxes_obj = self.pool['wizard.update.charts.accounts.tax'] delay_wiz_tax = [] # Remove previous taxes - wiz_taxes.unlink(cr, uid, wiz_taxes.search(cr, uid, [])) + wiz_taxes_obj.unlink(cr, uid, wiz_taxes_obj.search(cr, uid, [])) # Search for new / updated taxes - for tax_template in wizard.chart_template_id.tax_template_ids: - # Ensure the tax template is on the map (search for the mapped tax - # id). - self._map_tax_template( - cr, uid, wizard, tax_template_mapping, tax_template, context) - - tax_id = tax_template_mapping.get(tax_template.id) + tax_templ_ids = tax_templ_obj.search(cr, uid, + [('chart_template_id', + 'in', + chart_template_ids)], + context=context) + for tax_templ in tax_templ_obj.browse(cr, uid, tax_templ_ids, + context=context): + # Ensure tax template is on the map (search for the mapped tax id) + tax_id = self._map_tax_template(cr, uid, wizard, + tax_templ_mapping, + tax_templ, context=context) if not tax_id: new_taxes += 1 vals_wiz = { - 'tax_id': tax_template.id, + 'tax_id': tax_templ.id, 'update_chart_wizard_id': wizard.id, 'type': 'new', + 'notes': _('Name or description not found.'), } - if not tax_template.parent_id: - wiz_taxes.create(cr, uid, vals_wiz, context) + if not tax_templ.parent_id: + wiz_taxes_obj.create(cr, uid, vals_wiz, context) else: delay_wiz_tax.append(vals_wiz) elif wizard.update_tax: # Check the tax for changes. modified = False notes = "" - tax = taxes.browse(cr, uid, tax_id, context=context) - if tax.sequence != tax_template.sequence: + tax = tax_obj.browse(cr, uid, tax_id, context=context) + if tax.sequence != tax_templ.sequence: notes += _("The sequence field is different.\n") modified = True - if tax.amount != tax_template.amount: + if tax.amount != tax_templ.amount: notes += _("The amount field is different.\n") modified = True - if tax.type != tax_template.type: + if tax.type != tax_templ.type: notes += _("The type field is different.\n") modified = True - if tax.applicable_type != tax_template.applicable_type: + if tax.applicable_type != tax_templ.applicable_type: notes += _("The applicable type field is different.\n") modified = True - if tax.domain != tax_template.domain: + if tax.domain != tax_templ.domain: notes += _("The domain field is different.\n") modified = True - if tax.child_depend != tax_template.child_depend: + if tax.child_depend != tax_templ.child_depend: notes += _("The child depend field is different.\n") modified = True - if tax.python_compute != tax_template.python_compute: + if tax.python_compute != tax_templ.python_compute: notes += _("The python compute field is different.\n") modified = True - # if tax.tax_group != tax_template.tax_group: + # if tax.tax_group != tax_templ.tax_group: # notes += _("The tax group field is different.\n") # modified = True - if tax.base_sign != tax_template.base_sign: + if tax.base_sign != tax_templ.base_sign: notes += _("The base sign field is different.\n") modified = True - if tax.tax_sign != tax_template.tax_sign: + if tax.tax_sign != tax_templ.tax_sign: notes += _("The tax sign field is different.\n") modified = True - if tax.include_base_amount != tax_template.include_base_amount: + if tax.include_base_amount != tax_templ.include_base_amount: notes += _("The include base amount field is different.\n") modified = True - if tax.type_tax_use != tax_template.type_tax_use: + if tax.type_tax_use != tax_templ.type_tax_use: notes += _("The type tax use field is different.\n") modified = True # TODO: We could check other tax fields for changes... - if modified: # Tax code to update. updated_taxes += 1 - wiz_taxes.create(cr, uid, { - 'tax_id': tax_template.id, + wiz_taxes_obj.create(cr, uid, { + 'tax_id': tax_templ.id, 'update_chart_wizard_id': wizard.id, 'type': 'updated', 'update_tax_id': tax_id, 'notes': notes, }, context) - for delay_vals_wiz in delay_wiz_tax: - wiz_taxes.create(cr, uid, delay_vals_wiz, context) + wiz_taxes_obj.create(cr, uid, delay_vals_wiz, context) - return {'new': new_taxes, 'updated': updated_taxes, 'mapping': tax_template_mapping} + return {'new': new_taxes, 'updated': updated_taxes, 'mapping': tax_templ_mapping} def _find_accounts(self, cr, uid, wizard, context=None): """ @@ -478,160 +507,183 @@ class wizard_update_charts_accounts(orm.TransientModel): """ new_accounts = 0 updated_accounts = 0 - account_template_mapping = {} - - accounts = self.pool.get('account.account') - accounts_template = self.pool.get('account.account.template') - wiz_accounts = self.pool.get( - 'wizard.update.charts.accounts.account') - + acc_templ_mapping = {} + acc_obj = self.pool['account.account'] + acc_templ_obj = self.pool['account.account.template'] + wiz_accounts = self.pool['wizard.update.charts.accounts.account'] # Remove previous accounts wiz_accounts.unlink( cr, uid, wiz_accounts.search(cr, uid, [])) - # Search for new / updated accounts root_account_id = wizard.chart_template_id.account_root_id.id - children_acc_template = accounts_template.search(cr, uid, [( - 'parent_id', 'child_of', [root_account_id])], context=context) - children_acc_template.sort() - for account_template in accounts_template.browse(cr, uid, children_acc_template, context=context): + acc_templ_criteria = [('chart_template_id', + '=', + wizard.chart_template_id.id)] + if root_account_id: + acc_templ_criteria = (['|'] + acc_templ_criteria + + ['&', ('parent_id', 'child_of', [root_account_id]), + ('chart_template_id', '=', False)]) + acc_ids = acc_templ_obj.search(cr, uid, acc_templ_criteria, + context=context) + acc_ids.sort() + for acc_templ in acc_templ_obj.browse(cr, uid, acc_ids, + context=context): # Ensure the account template is on the map (search for the mapped # account id). - self._map_account_template(cr, uid, wizard, account_template_mapping, account_template, context) - - account_id = account_template_mapping.get(account_template.id) + account_id = self._map_account_template(cr, uid, wizard, + acc_templ_mapping, + acc_templ, + context=context) if not account_id: new_accounts += 1 wiz_accounts.create(cr, uid, { - 'account_id': account_template.id, + 'account_id': acc_templ.id, 'update_chart_wizard_id': wizard.id, 'type': 'new', + 'notes': _('Code not found.'), }, context) elif wizard.update_account: # Check the account for changes. modified = False notes = "" - account = accounts.browse( - cr, uid, account_id, context=context) - - if account.name != account_template.name and account.name != wizard.company_id.name: + account = acc_obj.browse(cr, uid, account_id, context=context) + if account.name != acc_templ.name and account.name != wizard.company_id.name: notes += _("The name is different.\n") modified = True - if account.type != account_template.type: + if account.type != acc_templ.type: notes += _("The type is different.\n") modified = True - if account.user_type != account_template.user_type: + if account.user_type != acc_templ.user_type: notes += _("The user type is different.\n") modified = True - if account.reconcile != account_template.reconcile: + if account.reconcile != acc_templ.reconcile: notes += _("The reconcile is different.\n") modified = True - # TODO: We could check other account fields for changes... - if modified: # Account to update. updated_accounts += 1 wiz_accounts.create(cr, uid, { - 'account_id': account_template.id, + 'account_id': acc_templ.id, 'update_chart_wizard_id': wizard.id, 'type': 'updated', 'update_account_id': account_id, 'notes': notes, }, context) + return { + 'new': new_accounts, + 'updated': updated_accounts, + 'mapping': acc_templ_mapping + } - return {'new': new_accounts, 'updated': updated_accounts, 'mapping': account_template_mapping} - - def _find_fiscal_positions(self, cr, uid, wizard, context=None): + def _find_fiscal_positions(self, cr, uid, wizard, chart_template_ids, + context=None): """ Search for, and load, fiscal position templates to create/update. + + @param chart_template_ids: IDs of the chart templates to look on, + calculated once in the calling method. """ new_fps = 0 updated_fps = 0 - fp_template_mapping = {} - - fiscalpostitions_template = self.pool.get('account.fiscal.position.template') - fiscalpositions = self.pool.get('account.fiscal.position') - wiz_fiscalpositions = self.pool.get( - 'wizard.update.charts.accounts.fiscal.position') - + fp_templ_mapping = {} + tax_templ_mapping = {} + acc_templ_mapping = {} + fp_templ_obj = self.pool['account.fiscal.position.template'] + fp_obj = self.pool['account.fiscal.position'] + wiz_fp = self.pool['wizard.update.charts.accounts.fiscal.position'] # Remove previous fiscal positions - wiz_fiscalpositions.unlink(cr, uid, wiz_fiscalpositions.search(cr, uid, [])) - + wiz_fp.unlink(cr, uid, wiz_fp.search(cr, uid, [])) # Search for new / updated fiscal positions - fp_template_ids = fiscalpostitions_template.search(cr, uid, [('chart_template_id', '=', wizard.chart_template_id.id)], context=context) - for fp_template in fiscalpostitions_template.browse(cr, uid, fp_template_ids, context=context): + fp_template_ids = fp_templ_obj.search(cr, uid, + [('chart_template_id', + 'in', + chart_template_ids)], + context=context) + for fp_templ in fp_templ_obj.browse(cr, uid, fp_template_ids, + context=context): # Ensure the fiscal position template is on the map (search for the # mapped fiscal position id). - self._map_fp_template( - cr, uid, wizard, fp_template_mapping, fp_template, context) - - fp_id = fp_template_mapping.get(fp_template.id) + fp_id = self._map_fp_template(cr, uid, wizard, fp_templ_mapping, + fp_templ, context=context) if not fp_id: # New fiscal position template. new_fps += 1 - wiz_fiscalpositions.create(cr, uid, { - 'fiscal_position_id': fp_template.id, + wiz_fp.create(cr, uid, { + 'fiscal_position_id': fp_templ.id, 'update_chart_wizard_id': wizard.id, 'type': 'new', - }, context) - elif wizard.update_fiscal_position: - # Check the fiscal position for changes. - modified = False - notes = "" - fp = fiscalpositions.browse(cr, uid, fp_id, context=context) - - # Check fiscal position taxes for changes. - if fp_template.tax_ids and fp.tax_ids: - for fp_tax_template in fp_template.tax_ids: - found = False - for fp_tax in fp.tax_ids: - if fp_tax.tax_src_id.name == fp_tax_template.tax_src_id.name: - if fp_tax_template.tax_dest_id and fp_tax.tax_dest_id: - if fp_tax.tax_dest_id.name == fp_tax_template.tax_dest_id.name: - found = True - break - elif not fp_tax_template.tax_dest_id and not fp_tax.tax_dest_id: + 'notes': _('Name not found.'), + }, context=context) + continue + # Check the fiscal position for changes + modified = False + notes = "" + fp = fp_obj.browse(cr, uid, fp_id, context=context) + # Check fiscal position taxes for changes. + if fp_templ.tax_ids and fp.tax_ids: + for fp_tax_templ in fp_templ.tax_ids: + found = False + tax_src_id = self._map_tax_template(cr, uid, wizard, + tax_templ_mapping, + fp_tax_templ.tax_src_id, + context=None) + tax_dest_id = self._map_tax_template(cr, uid, wizard, + tax_templ_mapping, + fp_tax_templ.tax_dest_id, + context=None) + for fp_tax in fp.tax_ids: + if fp_tax.tax_src_id.id == tax_src_id: + if not fp_tax.tax_dest_id: + if not tax_dest_id: found = True break - if not found: - if fp_tax_template.tax_dest_id: - notes += _("Tax mapping not found on the fiscal position instance: %s -> %s.\n") % (fp_tax_template.tax_src_id.name, fp_tax_template.tax_dest_id.name) else: - notes += _("Tax mapping not found on the fiscal position instance: %s -> None.\n") % fp_tax_template.tax_src_id.name - modified = True - elif fp_template.tax_ids and not fp.tax_ids: - notes += _("The template has taxes the fiscal position instance does not.\n") - modified = True - - # Check fiscal position accounts for changes. - if fp_template.account_ids and fp.account_ids: - for fp_account_template in fp_template.account_ids: - found = False - for fp_account in fp.account_ids: - if fp_account.account_src_id.name == fp_account_template.account_src_id.name: - if fp_account.account_dest_id.name == fp_account_template.account_dest_id.name: + if fp_tax.tax_dest_id.id == tax_dest_id: found = True break - if not found: - notes += _("Account mapping not found on the fiscal position instance: %s -> %s.\n") % (fp_account_template.account_src_id.name, fp_account_template.account_dest_id.name) - modified = True - elif fp_template.account_ids and not fp.account_ids: - notes += _("The template has accounts the fiscal position instance does not.\n") - modified = True - - if modified: - # Fiscal position template to update. - updated_fps += 1 - wiz_fiscalpositions.create(cr, uid, { - 'fiscal_position_id': fp_template.id, - 'update_chart_wizard_id': wizard.id, - 'type': 'updated', - 'update_fiscal_position_id': fp_id, - 'notes': notes, - }, context) - - return {'new': new_fps, 'updated': updated_fps, 'mapping': fp_template_mapping} + if not found: + notes += _("Tax mapping not found on the fiscal position instance: %s -> %s.\n") % ( + fp_tax_templ.tax_src_id.name, + fp_tax_templ.tax_dest_id and fp_tax_templ.tax_dest_id.name or _('None')) + modified = True + elif fp_templ.tax_ids and not fp.tax_ids: + notes += _("The template has taxes the fiscal position instance does not.\n") + modified = True + # Check fiscal position accounts for changes + if fp_templ.account_ids and fp.account_ids: + for fp_acc_templ in fp_templ.account_ids: + found = False + acc_src_id = self._map_account_template(cr, uid, wizard, + acc_templ_mapping, + fp_acc_templ.account_src_id, + context=context) + acc_dest_id = self._map_account_template(cr, uid, wizard, + acc_templ_mapping, + fp_acc_templ.account_dest_id, + context=context) + for fp_acc in fp.account_ids: + if (fp_acc.account_src_id.id == acc_src_id and + fp_acc.account_dest_id.id == acc_dest_id): + found = True + break + if not found: + notes += _("Account mapping not found on the fiscal position instance: %s -> %s.\n") % (fp_acc_templ.account_src_id.name, fp_acc_templ.account_dest_id.name) + modified = True + elif fp_templ.account_ids and not fp.account_ids: + notes += _("The template has accounts the fiscal position instance does not.\n") + modified = True + if modified: + # Fiscal position template to update + updated_fps += 1 + wiz_fp.create(cr, uid, { + 'fiscal_position_id': fp_templ.id, + 'update_chart_wizard_id': wizard.id, + 'type': 'updated', + 'update_fiscal_position_id': fp_id, + 'notes': notes, + }, context=context) + return {'new': new_fps, 'updated': updated_fps, 'mapping': fp_templ_mapping} def action_find_records(self, cr, uid, ids, context=None): """ @@ -640,18 +692,34 @@ class wizard_update_charts_accounts(orm.TransientModel): if context is None: context = {} wizard = self.browse(cr, uid, ids[0], context=context) - if wizard.lang: context['lang'] = wizard.lang elif context.get('lang'): del context['lang'] - + # Defaults when calculations are not done + tax_codes_res = {} + taxes_res = {} + accounts_res = {} + fps_res = {} + # Get all chart templates involved + wiz_obj = self.pool['wizard.multi.charts.accounts'] + chart_template_ids = wiz_obj._get_chart_parent_ids(cr, uid, + wizard.chart_template_id, context=context) # Search for, and load, the records to create/update. - tax_codes_res = self._find_tax_codes(cr, uid, wizard, context=context) - taxes_res = self._find_taxes(cr, uid, wizard, context=context) - accounts_res = self._find_accounts(cr, uid, wizard, context=context) - fps_res = self._find_fiscal_positions(cr, uid, wizard, context=context) - + if wizard.update_tax_code: + tax_codes_res = self._find_tax_codes(cr, uid, wizard, + chart_template_ids, + context=context) + if wizard.update_tax: + taxes_res = self._find_taxes(cr, uid, wizard, chart_template_ids, + context=context) + if wizard.update_account: + accounts_res = self._find_accounts(cr, uid, wizard, + context=context) + if wizard.update_fiscal_position: + fps_res = self._find_fiscal_positions(cr, uid, wizard, + chart_template_ids, + context=context) # Write the results, and go to the next step. self.write(cr, uid, [wizard.id], { 'state': 'ready', @@ -676,14 +744,14 @@ class wizard_update_charts_accounts(orm.TransientModel): new_tax_codes = 0 updated_tax_codes = 0 tax_code_template_mapping = {} - for wiz_tax_code in wizard.tax_code_ids: tax_code_template = wiz_tax_code.tax_code_id tax_code_name = (root_tax_code_id == tax_code_template.id) and wizard.company_id.name or tax_code_template.name - # Ensure the parent tax code template is on the map. - self._map_tax_code_template(cr, uid, wizard, tax_code_template_mapping, tax_code_template.parent_id, context) - + self._map_tax_code_template(cr, uid, wizard, + tax_code_template_mapping, + tax_code_template.parent_id, + context=context) # Values vals = { 'name': tax_code_name, @@ -693,10 +761,8 @@ class wizard_update_charts_accounts(orm.TransientModel): 'company_id': wizard.company_id.id, 'sign': tax_code_template.sign, } - tax_code_id = None modified = False - if wiz_tax_code.type == 'new': # Create the tax code tax_code_id = taxcodes.create(cr, uid, vals) @@ -713,15 +779,12 @@ class wizard_update_charts_accounts(orm.TransientModel): else: tax_code_id = wiz_tax_code.update_tax_code_id and wiz_tax_code.update_tax_code_id.id modified = False - # Store the tax codes on the map tax_code_template_mapping[tax_code_template.id] = tax_code_id - if modified: # Detect errors if tax_code_template.parent_id and not tax_code_template_mapping.get(tax_code_template.parent_id.id): log.add(_("Tax code %s: The parent tax code %s can not be set.\n") % (tax_code_name, tax_code_template.parent_id.name), True) - return { 'new': new_tax_codes, 'updated': updated_tax_codes, @@ -732,20 +795,16 @@ class wizard_update_charts_accounts(orm.TransientModel): """ Search for, and load, tax templates to create/update. """ - taxes = self.pool.get('account.tax') - + taxes = self.pool['account.tax'] new_taxes = 0 updated_taxes = 0 tax_template_mapping = {} taxes_pending_for_accounts = {} - for wiz_tax in wizard.tax_ids: tax_template = wiz_tax.tax_id - # Ensure the parent tax template is on the map. self._map_tax_template(cr, uid, wizard, tax_template_mapping, tax_template.parent_id, context) - # Ensure the referenced tax codes are on the map. tax_code_templates_to_find = [ tax_template.base_code_id, @@ -754,8 +813,9 @@ class wizard_update_charts_accounts(orm.TransientModel): tax_template.ref_tax_code_id ] for tax_code_template in [tmpl for tmpl in tax_code_templates_to_find if tmpl]: - self._map_tax_code_template(cr, uid, wizard, tax_code_template_mapping, tax_code_template) - + self._map_tax_code_template(cr, uid, wizard, + tax_code_template_mapping, + tax_code_template) # Values vals_tax = { 'name': tax_template.name, @@ -783,10 +843,8 @@ class wizard_update_charts_accounts(orm.TransientModel): 'company_id': wizard.company_id.id, 'type_tax_use': tax_template.type_tax_use } - tax_id = None modified = False - if wiz_tax.type == 'new': # Create a new tax. tax_id = taxes.create(cr, uid, vals_tax) @@ -802,17 +860,14 @@ class wizard_update_charts_accounts(orm.TransientModel): modified = True else: tax_id = wiz_tax.update_tax_id and wiz_tax.update_tax_id.id - # Update the tax template map tax_template_mapping[tax_template.id] = tax_id - if modified: # Add to the dict of taxes waiting for accounts. taxes_pending_for_accounts[tax_id] = { 'account_collected_id': tax_template.account_collected_id and tax_template.account_collected_id.id or False, 'account_paid_id': tax_template.account_paid_id and tax_template.account_paid_id.id or False, } - # Detect errors if tax_template.parent_id and not tax_template_mapping.get(tax_template.parent_id.id): log.add(_("Tax %s: The parent tax %s can not be set.\n") % (tax_template.name, tax_template.parent_id.name), True) @@ -824,7 +879,6 @@ class wizard_update_charts_accounts(orm.TransientModel): log.add(_("Tax %s: The tax code for the base refund %s can not be set.\n") % (tax_template.name, tax_template.ref_base_code_id.name), True) if tax_template.ref_tax_code_id and not tax_code_template_mapping.get(tax_template.ref_tax_code_id.id): log.add(_("Tax %s: The tax code for the tax refund %s can not be set.\n") % (tax_template.name, tax_template.ref_tax_code_id.name), True) - return { 'new': new_taxes, 'updated': updated_taxes, @@ -867,28 +921,22 @@ class wizard_update_charts_accounts(orm.TransientModel): """ accounts = self.pool.get('account.account') root_account_id = wizard.chart_template_id.account_root_id.id - # Disable the parent_store computing on account_account during the batch # processing, we will force _parent_store_compute afterwards. self.pool._init = True new_accounts = 0 updated_accounts = 0 account_template_mapping = {} - for wiz_account in wizard.account_ids: account_template = wiz_account.account_id - # Ensure the parent account template is on the map. self._map_account_template(cr, uid, wizard, account_template_mapping, account_template.parent_id, context) - # Ensure the related tax templates are on the map. for tax_template in account_template.tax_ids: self._map_tax_template(cr, uid, wizard, tax_template_mapping, tax_template, context) - # Get the tax ids tax_ids = [tax_template_mapping[tax_template.id] for tax_template in account_template.tax_ids if tax_template_mapping[tax_template.id]] - # Calculate the account code (we need to add zeros to non-view # account codes) code = account_template.code or '' @@ -896,7 +944,6 @@ class wizard_update_charts_accounts(orm.TransientModel): if len(code) > 0 and len(code) <= wizard.code_digits: code = '%s%s' % ( code, '0' * (wizard.code_digits - len(code))) - # Values vals = { 'name': (root_account_id == account_template.id) and wizard.company_id.name or account_template.name, @@ -912,10 +959,8 @@ class wizard_update_charts_accounts(orm.TransientModel): 'tax_ids': [(6, 0, tax_ids)], 'company_id': wizard.company_id.id, } - account_id = None modified = False - if wiz_account.type == 'new': # Create the account try: @@ -939,68 +984,63 @@ class wizard_update_charts_accounts(orm.TransientModel): % (code, ex.name, ex.value), True) else: account_id = wiz_account.update_account_id and wiz_account.update_account_id.id - # Store the account on the map account_template_mapping[account_template.id] = account_id - if modified: # Detect errors if account_template.parent_id and not account_template_mapping.get(account_template.parent_id.id): log.add(_("Account %s: The parent account %s can not be set.\n") % (code, account_template.parent_id.code), True) - # Set this account as the parent of the accounts that seem to # be its children (brothers starting with the same code). if wizard.update_children_accounts_parent: self._update_children_accounts_parent( cr, uid, wizard, log, account_id, context=context) - # Reenable the parent_store computing on account_account # and force the recomputation. self.pool._init = False self.pool.get('account.account')._parent_store_compute(cr) - return { 'new': new_accounts, 'updated': updated_accounts, 'mapping': account_template_mapping } - def _update_taxes_pending_for_accounts(self, cr, uid, wizard, log, taxes_pending_for_accounts, account_template_mapping, context=None): + def _update_taxes_pending_for_accounts(self, cr, uid, wizard, log, taxes_pending_for_accounts, acc_templ_mapping, context=None): """ Updates the taxes (created or updated on previous steps) to set the references to the accounts (the taxes where created/updated first, when the referenced accounts where still not available). """ - taxes = self.pool.get('account.tax') - accounts_template = self.pool.get('account.account.template') - + taxes = self.pool['account.tax'] + accounts_template = self.pool['account.account.template'] for key, value in taxes_pending_for_accounts.items(): # Ensure the related account templates are on the map. if value['account_collected_id']: - account_template = accounts_template.browse( + acc_templ = accounts_template.browse( cr, uid, value['account_collected_id'], context=context) - self._map_account_template(cr, uid, wizard, account_template_mapping, account_template, context) + self._map_account_template(cr, uid, wizard, acc_templ_mapping, + acc_templ, context=context) if value['account_paid_id']: - account_template = accounts_template.browse( + acc_templ = accounts_template.browse( cr, uid, value['account_paid_id'], context=context) - self._map_account_template(cr, uid, wizard, account_template_mapping, account_template, context) - + self._map_account_template(cr, uid, wizard, acc_templ_mapping, + acc_templ, context=context) if value['account_collected_id'] or value['account_paid_id']: - if account_template_mapping.get(value['account_collected_id']) and account_template_mapping.get(value['account_paid_id']): + if acc_templ_mapping.get(value['account_collected_id']) and acc_templ_mapping.get(value['account_paid_id']): vals = { - 'account_collected_id': account_template_mapping[value['account_collected_id']], - 'account_paid_id': account_template_mapping[value['account_paid_id']], + 'account_collected_id': acc_templ_mapping[value['account_collected_id']], + 'account_paid_id': acc_templ_mapping[value['account_paid_id']], } taxes.write(cr, uid, [key], vals) else: tax = taxes.browse(cr, uid, key) - if not account_template_mapping.get(value['account_collected_id']): + if not acc_templ_mapping.get(value['account_collected_id']): log.add(_("Tax %s: The collected account can not be set.\n") % (tax.name), True) - if not account_template_mapping.get(value['account_paid_id']): + if not acc_templ_mapping.get(value['account_paid_id']): log.add(_("Tax %s: The paid account can not be set.\n") % (tax.name), True) - def _update_fiscal_positions(self, cr, uid, wizard, log, tax_template_mapping, account_template_mapping, context=None): + def _update_fiscal_positions(self, cr, uid, wizard, log, tax_template_mapping, acc_templ_mapping, context=None): """ Search for, and load, fiscal position templates to create/update. """ @@ -1063,20 +1103,26 @@ class wizard_update_charts_accounts(orm.TransientModel): # (Re)create the account mappings for fp_account in fp_template.account_ids: # Ensure the related account templates are on the map. - self._map_account_template(cr, uid, wizard, account_template_mapping, fp_account.account_src_id, context) + self._map_account_template(cr, uid, wizard, + acc_templ_mapping, + fp_account.account_src_id, + context=context) if fp_account.account_dest_id: - self._map_account_template(cr, uid, wizard, account_template_mapping, fp_account.account_dest_id, context) + self._map_account_template(cr, uid, wizard, + acc_templ_mapping, + fp_account.account_dest_id, + context=context) # Create the fp account mapping vals_account = { - 'account_src_id': account_template_mapping.get(fp_account.account_src_id.id), - 'account_dest_id': fp_account.account_dest_id and account_template_mapping.get(fp_account.account_dest_id.id), + 'account_src_id': acc_templ_mapping.get(fp_account.account_src_id.id), + 'account_dest_id': fp_account.account_dest_id and acc_templ_mapping.get(fp_account.account_dest_id.id), 'position_id': fp_id, } fiscalpositions_account.create(cr, uid, vals_account) # Check for errors - if not account_template_mapping.get(fp_account.account_src_id.id): + if not acc_templ_mapping.get(fp_account.account_src_id.id): log.add(_("Fiscal position %s: The source account %s can not be set.\n") % (fp_template.name, fp_account.account_src_id.code), True) - if fp_account.account_dest_id and not account_template_mapping.get(fp_account.account_dest_id.id): + if fp_account.account_dest_id and not acc_templ_mapping.get(fp_account.account_dest_id.id): log.add(_("Fiscal position %s: The destination account %s can not be set.\n") % (fp_template.name, fp_account.account_dest_id.code), True) log.add(_("Created or updated fiscal position %s.\n") @@ -1090,29 +1136,42 @@ class wizard_update_charts_accounts(orm.TransientModel): if context is None: context = {} wizard = self.browse(cr, uid, ids[0], context=context) - if wizard.lang: context['lang'] = wizard.lang elif context.get('lang'): del context['lang'] - log = WizardLog() - + # Defaults when calculations are not done + tax_codes_res = {'mapping': {}} + taxes_res = {'mapping': {}, 'pending': {}} + accounts_res = {'mapping': {}} + fps_res = {} # Create or update the records. - tax_codes_res = self._update_tax_codes( - cr, uid, wizard, log, context=context) - taxes_res = self._update_taxes( - cr, uid, wizard, log, tax_codes_res['mapping'], context=context) - accounts_res = self._update_accounts( - cr, uid, wizard, log, taxes_res['mapping'], context=context) - self._update_taxes_pending_for_accounts(cr, uid, wizard, log, taxes_res['pending'], accounts_res['mapping'], context=context) - fps_res = self._update_fiscal_positions(cr, uid, wizard, log, taxes_res['mapping'], accounts_res['mapping'], context=context) - + if wizard.update_tax_code: + tax_codes_res = self._update_tax_codes(cr, uid, wizard, log, + context=context) + if wizard.update_tax: + taxes_res = self._update_taxes(cr, uid, wizard, log, + tax_codes_res['mapping'], + context=context) + if wizard.update_account: + accounts_res = self._update_accounts(cr, uid, wizard, log, + taxes_res['mapping'], + context=context) + if wizard.update_tax and wizard.update_account: + self._update_taxes_pending_for_accounts(cr, uid, wizard, log, + taxes_res['pending'], + accounts_res['mapping'], + context=context) + if wizard.update_fiscal_position: + fps_res = self._update_fiscal_positions(cr, uid, wizard, log, + taxes_res['mapping'], + accounts_res['mapping'], + context=context) # Check if errors where detected and wether we should stop. if log.has_errors() and not wizard.continue_on_errors: raise orm.except_orm(_('Error'), _( "One or more errors detected!\n\n%s") % log.get_errors_str()) - # Store the data and go to the next step. self.write(cr, uid, [wizard.id], { 'state': 'done', @@ -1125,8 +1184,7 @@ class wizard_update_charts_accounts(orm.TransientModel): 'updated_accounts': accounts_res.get('updated', 0), 'updated_fps': fps_res.get('updated', 0), 'log': log(), - }, context) - + }, context=context) return _reopen(self, wizard.id, 'wizard.update.chart.accounts') diff --git a/account_chart_update/wizard/wizard_chart_update_view.xml b/account_chart_update/wizard/wizard_chart_update_view.xml index f7e3d3106..91c7927d8 100644 --- a/account_chart_update/wizard/wizard_chart_update_view.xml +++ b/account_chart_update/wizard/wizard_chart_update_view.xml @@ -23,7 +23,9 @@ - + @@ -48,73 +50,45 @@ - + + -
- - - - - - -
- + + -
- - - - - - -
- + + -
- - - - - - -
- + + -
- - - - - - -
@@ -153,6 +127,9 @@ or