From c243195f7fd3d380cea07c400691604b679f8ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Mon, 9 Jul 2018 17:53:57 +0200 Subject: [PATCH 01/26] account_chart_update: copy inactive tax templates too In v10, tax templates have an active flag. It is useful to copy them too, letting the user select which one he wants to activate in it's instance. --- account_chart_update/wizard/wizard_chart_update.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 4c7b1896b..a4fbd2326 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -465,7 +465,8 @@ class WizardUpdateChartsAccounts(models.TransientModel): self.tax_ids.unlink() # Search for changes between template and real tax - for template in self.chart_template_ids.mapped("tax_template_ids"): + for template in self.chart_template_ids.\ + with_context(active_test=False).mapped("tax_template_ids"): # Check if the template matches a real tax tax = self.find_tax_by_templates(template) From 2340cf01df69be5f3397d60ace1878c438374db0 Mon Sep 17 00:00:00 2001 From: Gelu Date: Mon, 27 Aug 2018 10:08:55 +0200 Subject: [PATCH 02/26] [FIX] account_chart_update: Fix error when updating account templates with a currency defined (#683) --- account_chart_update/wizard/wizard_chart_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 4c7b1896b..3f9c00e7f 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -596,7 +596,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): def _create_account_from_template(self, account_template): return self.env["account.account"].create({ 'name': account_template.name, - 'currency_id': account_template.currency_id, + 'currency_id': account_template.currency_id.id, 'code': self.padded_code(account_template.code), 'user_type_id': account_template.user_type_id.id, 'reconcile': account_template.reconcile, From 328c5058926d2c9113ac3c2dab61b9f678b999ac Mon Sep 17 00:00:00 2001 From: dscherrer Date: Thu, 30 Aug 2018 09:12:27 +0000 Subject: [PATCH 03/26] Translated using Weblate (German) Currently translated at 17.0% (34 of 200 strings) Translation: account-financial-tools-10.0/account-financial-tools-10.0-account_credit_control Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-10-0/account-financial-tools-10-0-account_credit_control/de/ --- account_credit_control/i18n/de.po | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/account_credit_control/i18n/de.po b/account_credit_control/i18n/de.po index 390158990..b473f06f3 100644 --- a/account_credit_control/i18n/de.po +++ b/account_credit_control/i18n/de.po @@ -10,14 +10,15 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-02-01 03:44+0000\n" -"PO-Revision-Date: 2018-02-01 03:44+0000\n" -"Last-Translator: Rudolf Schnapka , 2017\n" +"PO-Revision-Date: 2018-08-30 09:15+0000\n" +"Last-Translator: dscherrer \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.1.1\n" #. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.3_time_3 @@ -417,7 +418,7 @@ msgstr "" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Date due" -msgstr "" +msgstr "Fälligkeit" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_credit_control_policy @@ -491,7 +492,7 @@ msgstr "" #. module: account_credit_control #: selection:credit.control.policy.level,computation_mode:0 msgid "Due Date" -msgstr "" +msgstr "Fälligkeit" #. module: account_credit_control #: selection:credit.control.policy.level,computation_mode:0 From e423ac5671d8955c8eeabff944a8e04b9f1feace Mon Sep 17 00:00:00 2001 From: dscherrer Date: Thu, 30 Aug 2018 13:06:25 +0000 Subject: [PATCH 04/26] Translated using Weblate (German) Currently translated at 65.0% (130 of 200 strings) Translation: account-financial-tools-10.0/account-financial-tools-10.0-account_credit_control Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-10-0/account-financial-tools-10-0-account_credit_control/de/ --- account_credit_control/i18n/de.po | 202 +++++++++++++++--------------- 1 file changed, 103 insertions(+), 99 deletions(-) diff --git a/account_credit_control/i18n/de.po b/account_credit_control/i18n/de.po index b473f06f3..14b782e31 100644 --- a/account_credit_control/i18n/de.po +++ b/account_credit_control/i18n/de.po @@ -1,16 +1,9 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_credit_control -# -# Translators: -# OCA Transbot , 2017 -# Rudolf Schnapka , 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-02-01 03:44+0000\n" -"PO-Revision-Date: 2018-08-30 09:15+0000\n" +"PO-Revision-Date: 2018-08-30 13:06+0000\n" "Last-Translator: dscherrer \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "Language: de\n" @@ -125,19 +118,21 @@ msgstr "Eine Mahnstufe" msgid "" "A credit control run is already running in background, please try later." msgstr "" +"Im Hintergrund wird gerade ein Mahnlauf erstellt, bitte warten Sie einen " +"Moment." #. module: account_credit_control #: code:addons/account_credit_control/models/credit_control_run.py:71 #, python-format msgid "A run has already been executed more recently than %s" -msgstr "" +msgstr "Ein Mahnlauf wurde soeben vor %s gestartet." #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_account_account #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_account_id #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Account" -msgstr "" +msgstr "Konto" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_account_ids @@ -148,23 +143,23 @@ msgstr "Konten" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_active msgid "Active" -msgstr "" +msgstr "Aktiv" #. module: account_credit_control #: model:ir.actions.act_window,help:account_credit_control.action_wizard_credit_policy_changer msgid "Allows to manually change credit level" -msgstr "" +msgstr "Möglichkeit, die Kreditstufe manuell zu ändern" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "An error has occured during the sending of the email." -msgstr "" +msgstr "Beim email-Versand sind Fehler aufgetreten." #. module: account_credit_control #: code:addons/account_credit_control/models/credit_control_policy.py:296 #, python-format msgid "Can not get function for computation mode: %s is not implemented" -msgstr "" +msgstr "Funktion zu Berechnungsregel nicht gefunden: %s ist nicht implementiert" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form @@ -179,35 +174,35 @@ msgstr "Abbrechen" #: model:ir.actions.act_window,name:account_credit_control.open_credit_line_marker_wizard_menu_action #: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form msgid "Change Lines' State" -msgstr "" +msgstr "Zeilenstatus anpassen" #. module: account_credit_control #: model:ir.actions.act_window,name:account_credit_control.action_wizard_credit_policy_changer #: model:ir.actions.act_window,name:account_credit_control.action_wizard_credit_policy_changer_menu_action msgid "Change current credit policy" -msgstr "" +msgstr "Aktuelles Mahnverfahren ändern" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form msgid "Change the overdue level of current invoice" -msgstr "" +msgstr "Mahnstufe der aktuellen Rechnung ändern" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form msgid "Change the state of the selected lines" -msgstr "" +msgstr "Status der selektierten Posten ändern" #. module: account_credit_control #: model:ir.actions.act_window,help:account_credit_control.open_credit_line_marker_wizard msgid "Change the state of the selected lines." -msgstr "" +msgstr "Status der selektierten Posten ändern." #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_channel #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_channel #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Channel" -msgstr "" +msgstr "Kanal" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_res_company @@ -224,17 +219,17 @@ msgstr "Unternehmen" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Compute Credit Control Lines" -msgstr "" +msgstr "Mahnzeilen aufbereiten" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_computation_mode msgid "Compute Mode" -msgstr "" +msgstr "Aufbereitungsmodus" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_contact_address msgid "Contact Address" -msgstr "" +msgstr "Kontaktadresse" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_form @@ -246,12 +241,12 @@ msgstr "" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_date msgid "Controlling Date" -msgstr "" +msgstr "Kontrolldatum" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_date msgid "Controlling date" -msgstr "" +msgstr "Kontrolldatum" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_create_uid @@ -285,7 +280,7 @@ msgstr "Erstellt am" #: model:ir.ui.menu,name:account_credit_control.base_credit_control_menu #: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view msgid "Credit Control" -msgstr "" +msgstr "Mahnungen" #. module: account_credit_control #: model:ir.actions.act_window,name:account_credit_control.credit_control_line_action @@ -297,13 +292,13 @@ msgstr "" #: model:ir.ui.menu,name:account_credit_control.credit_control_line_action_menu #: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view msgid "Credit Control Lines" -msgstr "" +msgstr "Mahnungsposten" #. module: account_credit_control #: model:ir.actions.act_window,name:account_credit_control.credit_policy_configuration_action #: model:ir.ui.menu,name:account_credit_control.credit_policy_configuration_action_menu msgid "Credit Control Policies" -msgstr "" +msgstr "Mahnverfahren" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_account_invoice_credit_policy_id @@ -311,23 +306,23 @@ msgstr "" #: model:ir.model.fields,field_description:account_credit_control.field_res_partner_credit_policy_id #: model:ir.model.fields,field_description:account_credit_control.field_res_users_credit_policy_id msgid "Credit Control Policy" -msgstr "" +msgstr "Mahnverfahren" #. module: account_credit_control #: model:ir.actions.act_window,name:account_credit_control.credit_control_run #: model:ir.ui.menu,name:account_credit_control.credit_control_run_menu msgid "Credit Control Run" -msgstr "" +msgstr "Mahnlauf" #. module: account_credit_control #: model:ir.actions.report.xml,name:account_credit_control.credit_control_summary msgid "Credit Control Summary" -msgstr "" +msgstr "Zusammenfassung Mahnung" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_res_company_credit_control_tolerance msgid "Credit Control Tolerance" -msgstr "" +msgstr "Toleranz Mahnung" #. module: account_credit_control #: model:mail.template,subject:account_credit_control.email_template_credit_control_base @@ -355,23 +350,23 @@ msgstr "Mahnpostenerzeuger" #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_tree msgid "Credit control policy" -msgstr "" +msgstr "Mahnverfahren" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form msgid "Credit control policy Level" -msgstr "" +msgstr "Level Mahnverfahren" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_level_tree msgid "Credit control policy level" -msgstr "" +msgstr "Level Mahnverfahren" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form #: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_tree msgid "Credit control run" -msgstr "" +msgstr "Mahnlauf" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search @@ -392,28 +387,28 @@ msgstr "Währung" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_custom_mail_text msgid "Custom Mail Message" -msgstr "" +msgstr "Individuelle Mailnachricht" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_custom_text msgid "Custom Message" -msgstr "" +msgstr "Individuelle Nachricht" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_custom_text_after_details msgid "Custom Message after details" -msgstr "" +msgstr "Individuelle Nachricht nach Details" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.customer_followup_tree msgid "Customer Followup" -msgstr "" +msgstr "Kundennachfrage" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_res_partner_payment_note #: model:ir.model.fields,field_description:account_credit_control.field_res_users_payment_note msgid "Customer Payment Promise" -msgstr "" +msgstr "Zahlungsversprechen Kunde" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document @@ -423,18 +418,18 @@ msgstr "Fälligkeit" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_credit_control_policy msgid "Define a reminder policy" -msgstr "" +msgstr "Legen Sie ein Mahnverfahren fest" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_delay_days msgid "Delay (in days)" -msgstr "" +msgstr "Zahlungsrückstand (in Tagen)" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form #: model:ir.ui.view,arch_db:account_credit_control.credit_mangement_policy_level_form msgid "Delay Setting" -msgstr "" +msgstr "Einstellung Zahlungsrückstand" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_display_name @@ -452,12 +447,12 @@ msgstr "Anzeigename" #. module: account_credit_control #: model:ir.ui.menu,name:account_credit_control.credit_control_manual_action_menu msgid "Do Manual Follow-Ups" -msgstr "" +msgstr "Manuelle Nachfragen machen" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_do_nothing msgid "Do nothing" -msgstr "" +msgstr "nichts unternehmen" #. module: account_credit_control #: selection:credit.control.line,state:0 @@ -474,7 +469,7 @@ msgstr "Entwurf" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Draft lines have to be triaged." -msgstr "" +msgstr "Entwurfszeilen zur Durchsicht" #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_credit_control_line_state @@ -483,11 +478,15 @@ msgid "" "Ignored lines are lines for which we do not want to send something.\n" "Draft and ignored lines will be generated again on the next run." msgstr "" +"Entwurfsposten zur Durchsicht\n" +"Ignorierte Mahnposten, keine Aktionen geplant.\n" +"Ignorierte Posten und Entwurfsposten werden beim nächsten Mahnlauf wieder " +"aufbereitet." #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_amount_due msgid "Due Amount Tax incl." -msgstr "" +msgstr "Fälliger Betrag inkl. Steuern" #. module: account_credit_control #: selection:credit.control.policy.level,computation_mode:0 @@ -497,70 +496,71 @@ msgstr "Fälligkeit" #. module: account_credit_control #: selection:credit.control.policy.level,computation_mode:0 msgid "Due Date, End Of Month" -msgstr "" +msgstr "Fälligkeitsdatum, Ende des Monats" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_balance_due msgid "Due balance" -msgstr "" +msgstr "Ausstehender Betrag" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_date_due msgid "Due date" -msgstr "" +msgstr "Fälligkeitsdatum" #. module: account_credit_control #: selection:credit.control.line,channel:0 #: selection:credit.control.policy.level,channel:0 msgid "Email" -msgstr "" +msgstr "Email" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_email_template_id msgid "Email Template" -msgstr "" +msgstr "Email Vorlage" #. module: account_credit_control #: selection:credit.control.line,state:0 msgid "Emailing Error" -msgstr "" +msgstr "Email Fehler" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_date_entry msgid "Entry date" -msgstr "" +msgstr "Eingangsdatum" #. module: account_credit_control #: selection:credit.control.line,state:0 #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Error" -msgstr "" +msgstr "Fehler" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Filters" -msgstr "" +msgstr "Filter" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.partner_followup_form_view msgid "Follow-up" -msgstr "" +msgstr "Nachfrage" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_res_partner_payment_responsible_id #: model:ir.model.fields,field_description:account_credit_control.field_res_users_payment_responsible_id msgid "Follow-up Responsible" -msgstr "" +msgstr "Zuständigkeit Nachfrage" #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_credit_control_policy_do_nothing msgid "For policies which should not generate lines or are obsolete" msgstr "" +"Für nicht verwendete oder solche Mahnverfahren, die keine Posten generieren" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_line_ids msgid "Generated lines" -msgstr "" +msgstr "Generierte Posten" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search @@ -592,12 +592,12 @@ msgstr "" #: selection:credit.control.marker,name:0 #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Ignored" -msgstr "" +msgstr "Ignoriert" #. module: account_credit_control #: model:res.groups,name:account_credit_control.group_account_credit_control_info msgid "Info" -msgstr "" +msgstr "Information" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_account_invoice @@ -609,22 +609,22 @@ msgstr "Rechnung" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Invoice date" -msgstr "" +msgstr "Rechnungsdatum" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Invoice number" -msgstr "" +msgstr "Rechnungsnummer" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Invoiced amount" -msgstr "" +msgstr "Rechnungsbetrag" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view msgid "Issued Lines" -msgstr "" +msgstr "Posten" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication___last_update @@ -669,7 +669,7 @@ msgstr "Zuletzt geändert am" #: selection:credit.control.line,channel:0 #: selection:credit.control.policy.level,channel:0 msgid "Letter" -msgstr "" +msgstr "Brief" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_current_policy_level @@ -677,7 +677,7 @@ msgstr "" #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_level #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Level" -msgstr "" +msgstr "Stufe" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form @@ -689,96 +689,96 @@ msgstr "Zeilen" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Lines already sent." -msgstr "" +msgstr "Bereits übermittelte Posten" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form msgid "Lines marker" -msgstr "" +msgstr "Postenmarkierung" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_printer_form msgid "Lines report" -msgstr "" +msgstr "Postenreport" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_manual_ids msgid "Lines to handle manually" -msgstr "" +msgstr "Posten für manuelle Verarbeitung" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Lines which have been ignored from previous runs." -msgstr "" +msgstr "In vorhergehenden Läufen ignorierte Posten." #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form #: model:ir.ui.view,arch_db:account_credit_control.credit_mangement_policy_level_form msgid "Mail and reporting" -msgstr "" +msgstr "Mail und Reporting" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form msgid "Mailer" -msgstr "" +msgstr "Mailer" #. module: account_credit_control #: model:res.groups,name:account_credit_control.group_account_credit_control_manager msgid "Manager" -msgstr "" +msgstr "Mananger" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view msgid "Manual Credit Control Policy" -msgstr "" +msgstr "Manuelles Mahnverfahren" #. module: account_credit_control #: model:ir.actions.act_window,name:account_credit_control.action_customer_followup msgid "Manual Follow-Ups" -msgstr "" +msgstr "Manuelle Nachfragen" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_manual_followup #: model:ir.model.fields,field_description:account_credit_control.field_res_partner_manual_followup #: model:ir.model.fields,field_description:account_credit_control.field_res_users_manual_followup msgid "Manual Followup" -msgstr "" +msgstr "Manuelle Nachfragen" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Manual Lines" -msgstr "" +msgstr "Manuelle Posten" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Manual change" -msgstr "" +msgstr "Manuelle Anpassung" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Manual followup" -msgstr "" +msgstr "Manuelle Nachfragen" #. module: account_credit_control #: model:credit.control.policy.level,custom_mail_text:account_credit_control.no_follow_1 #: model:credit.control.policy.level,custom_text:account_credit_control.no_follow_1 msgid "Manual no follow" -msgstr "" +msgstr "Manuell Nicht nachfragen" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_manually_overridden msgid "Manually overridden" -msgstr "" +msgstr "Manuell übersteuert" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_name msgid "Mark as" -msgstr "" +msgstr "Markiert als" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_mark_as_sent msgid "Mark letter lines as sent" -msgstr "" +msgstr "Markiere Briefzeilen als gesendet" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_credit_control_emailer @@ -788,17 +788,17 @@ msgstr "" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_credit_control_marker msgid "Mass marker" -msgstr "" +msgstr "Sammelmarkierung" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_credit_control_printer msgid "Mass printer" -msgstr "" +msgstr "Sammeldruck" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_move_line_id msgid "Move line" -msgstr "" +msgstr "Verschiebe Posten" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_move_line_ids @@ -819,24 +819,24 @@ msgstr "Name" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_new_policy_id msgid "New Policy to Apply" -msgstr "" +msgstr "Neues Mahnverfahren anwenden" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_new_policy_level_id msgid "New level to apply" -msgstr "" +msgstr "Neue Mahnstufe anwenden" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_res_partner_payment_next_action #: model:ir.model.fields,field_description:account_credit_control.field_res_users_payment_next_action msgid "Next Action" -msgstr "" +msgstr "Nächste Aktion" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_res_partner_payment_next_action_date #: model:ir.model.fields,field_description:account_credit_control.field_res_users_payment_next_action_date msgid "Next Action Date" -msgstr "" +msgstr "Datum nächste Aktion" #. module: account_credit_control #: code:addons/account_credit_control/wizard/credit_control_emailer.py:47 @@ -844,38 +844,40 @@ msgstr "" #: code:addons/account_credit_control/wizard/credit_control_printer.py:45 #, python-format msgid "No credit control lines selected." -msgstr "" +msgstr "Keine Mahnposten selektiert." #. module: account_credit_control #: model:credit.control.policy.level,name:account_credit_control.no_follow_1 msgid "No follow" -msgstr "" +msgstr "Keine Nachfrage" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_changer_do_nothing msgid "No follow policy" -msgstr "" +msgstr "Keine Nachfrageregel" #. module: account_credit_control #: code:addons/account_credit_control/wizard/credit_control_marker.py:63 #, python-format msgid "No lines will be changed. All the selected lines are already done." msgstr "" +"Keine Posten werden verändert. Alle selektierten Posten sind bereits " +"verarbeitet." #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_credit_control_printer_mark_as_sent msgid "Only letter lines will be marked." -msgstr "" +msgstr "Nur Briefzeilen werden markiert." #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Open Credit Control Lines" -msgstr "" +msgstr "Öffne Mahnposten" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Open amount" -msgstr "" +msgstr "offener Betrag" #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_res_partner_payment_responsible_id @@ -884,6 +886,8 @@ msgid "" "Optionally you can assign a user to this field, which will make him " "responsible for the action." msgstr "" +"Optional Benutzer zu diesem Feld zuordnen und als Verantwortliche(n) " +"definieren." #. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.2_time_1 From 874c9cfc95563f952fdd06cb6ac40b04ed9ee066 Mon Sep 17 00:00:00 2001 From: dscherrer Date: Thu, 30 Aug 2018 15:37:30 +0000 Subject: [PATCH 05/26] Translated using Weblate (German) Currently translated at 95.0% (190 of 200 strings) Translation: account-financial-tools-10.0/account-financial-tools-10.0-account_credit_control Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-10-0/account-financial-tools-10-0-account_credit_control/de/ --- account_credit_control/i18n/de.po | 240 +++++++++++++++++++++++------- 1 file changed, 184 insertions(+), 56 deletions(-) diff --git a/account_credit_control/i18n/de.po b/account_credit_control/i18n/de.po index 14b782e31..4f83c6c63 100644 --- a/account_credit_control/i18n/de.po +++ b/account_credit_control/i18n/de.po @@ -1,11 +1,13 @@ msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: German (account-financial-tools-10.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-01 03:44+0000\n" -"PO-Revision-Date: 2018-08-30 13:06+0000\n" +"POT-Creation-Date: 2018-08-30 13:07+0000\n" +"PO-Revision-Date: 2018-08-30 15:37+0000\n" "Last-Translator: dscherrer \n" -"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -35,16 +37,20 @@ msgid "" " " msgstr "" "\n" -"Unsere Buchhaltung weist aus, dass wir, trotz zweier Erinnerungen, die " -"Zahlung zu unten aufgeführten Rechnungen bei uns nicht eingegangen ist.\n" -" Sollten die Zahlungen zwischenzeitlich erfolgt sein, so betrachten Sie " -"dieses Schreiben bitte als gegenstandslos. Ansonsten nehmen Sie die Zahlung " -"bitte vor. Können wir nicht innerhalb der kommenden 5 Werktage einen " +" Unsere Buchhaltung weist aus, dass wir, trotz zweier " +"Erinnerungen, die Zahlung zu unten aufgeführten Rechnungen bei uns nicht " +"eingegangen ist.\n" +" Sollten die Zahlungen zwischenzeitlich erfolgt sein, so " +"betrachten Sie dieses Schreiben bitte als gegenstandslos. Ansonsten nehmen " +"Sie die Zahlung bitte vor. \n" +" Können wir nicht innerhalb der kommenden 5 Werktage einen " "entsprechenden Zahlungseingang verbuchen, werden wir die Forderung an eine " "beauftragte Agentur abtreten.\n" -" Wünschen Sie geänderte Zahlungsmodalitäten, sprechen Sie uns bitte an. " -"Ein Kunden-Kontoauszug wurde für Sie beigefügt.\n" -" Vielen Dank für Ihre mutmaßliche Zusammenarbeit in dieser Angelegenheit.\n" +"\n" +" Wünschen Sie geänderte Zahlungsmodalitäten, sprechen Sie uns " +"bitte an. Ein Kunden-Kontoauszug wurde für Sie beigefügt.\n" +" Vielen Dank für Ihre mutmaßliche Zusammenarbeit in dieser " +"Angelegenheit.\n" "\n" "Mit freundlichem Gruß" @@ -886,8 +892,7 @@ msgid "" "Optionally you can assign a user to this field, which will make him " "responsible for the action." msgstr "" -"Optional Benutzer zu diesem Feld zuordnen und als Verantwortliche(n) " -"definieren." +"Optional Benutzer zu diesem Feld zuordnen und als Verantwortliche definieren." #. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.2_time_1 @@ -904,6 +909,16 @@ msgid "" " Best regards\n" " " msgstr "" +"Unsere Durchsicht hat ergeben, dass wir noch keinen Zahlungseingang zu den " +"unten aufgeführten Rechnungen erhalten haben.\n" +" Falls Sie die Zahlung bereits ausgeführt haben, bitten wir Sie, " +"diese Nachricht zu ignorieren. Andernfalls erwarten wir Ihre Zahlung " +"innerhalb der nächsten 10 Tage.\n" +"\n" +" Vielen Dank für Ihre Mitarbeit.\n" +"\n" +" Freundliche Grüsse\n" +" " #. module: account_credit_control #: model:credit.control.policy.level,custom_mail_text:account_credit_control.3_time_1 @@ -918,6 +933,16 @@ msgid "" "
\n" " Best regards" msgstr "" +"Unsere Durchsicht hat ergeben, dass wir noch keinen Zahlungseingang zu den " +"im Anhang aufgeführten Rechnungen erhalten haben.
\n" +"
\n" +" Falls Sie die Zahlung bereits ausgeführt haben, bitten wir Sie, diese " +"Nachricht zu ignorieren. Andernfalls erwarten wir Ihre Zahlung innerhalb der " +"nächsten 10 Tage.
\n" +"
\n" +" Vielen Dank für Ihre Mitarbeit.
\n" +"
\n" +"Freundliche Grüsse" #. module: account_credit_control #: model:credit.control.policy.level,custom_mail_text:account_credit_control.2_time_1 @@ -931,6 +956,15 @@ msgid "" "
\n" " Best regards" msgstr "" +"Unsere Durchsicht hat ergeben, dass wir noch keinen Zahlungseingang zu den " +"im Anhang aufgeführten Rechnungen erhalten haben.
\n" +" Falls Sie die Zahlung bereits ausgeführt haben, bitten wir Sie, diese " +"Nachricht zu ignorieren. Andernfalls erwarten wir Ihre Zahlung innerhalb der " +"nächsten 10 Tage.
\n" +"
\n" +" Vielen Dank für Ihre Mitarbeit.
\n" +"
\n" +" Freundliche Grüsse" #. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.3_time_2 @@ -946,6 +980,17 @@ msgid "" " Best regards\n" " " msgstr "" +"Unsere Durchsicht hat ergeben, dass wir trotz erfolgter erster " +"Zahlungserinnerung noch immer keinen Zahlungseingang der untenstehenden " +"Rechnung verbuchen konnten.\n" +" Falls Sie die Zahlung bereits ausgeführt haben, bitten wir Sie, " +"diese Nachricht zu ignorieren. Andernfalls erwarten wir Ihre Zahlung " +"innerhalb der nächsten 5 Tage.\n" +"\n" +" Vielen Dank für Ihre Mitarbeit\n" +"\n" +" Freundliche Grüsse\n" +" " #. module: account_credit_control #: model:credit.control.policy.level,custom_mail_text:account_credit_control.3_time_2 @@ -959,6 +1004,16 @@ msgid "" "
\n" " Best regards" msgstr "" +"Unsere Durchsicht hat ergeben, dass wir trotz erfolgter erster " +"Zahlungserinnerung noch immer keinen Zahlungseingang zu den im Anhang " +"aufgeführten Rechnungen verbuchen konnten.
\n" +" Falls Sie die Zahlung bereits ausgeführt haben, bitten wir Sie, diese " +"Nachricht zu ignorieren. Andernfalls erwarten wir Ihre Zahlung innerhalb der " +"nächsten 5 Tage.
\n" +"
\n" +" Vielen Dank für Ihre Mitarbeit.
\n" +"
\n" +" Freundliche Grüsse" #. module: account_credit_control #: model:credit.control.policy.level,custom_mail_text:account_credit_control.2_time_2 @@ -980,6 +1035,24 @@ msgid "" "
\n" " Best regards" msgstr "" +"Unsere Durchsicht hat ergeben, dass wir trotz wiederholter Mahnungen noch " +"immer keinen Zahlungseingang zu den im Anhang aufgeführten Rechnungen " +"verbuchen konnten.\n" +"
\n" +"
\n" +" Wenn Sie die Zahlung in der Zwischenzeit übermittelt haben, ignorieren Sie " +"bitte diese Nachricht. Ansonsten erwarten wir ihre unmittelbare Zahlung.
" +"\n" +" Wenn wir Ihre Zahlung nicht innerhalb der nächsten 5 Tage erhalten, werden " +"wir die Angelegenheit an eine Inkassofirma
\n" +" übergeben.
\n" +"
\n" +" Für Zahlungsvorschläge bitten wir Sie, uns umgehend zu kontaktieren.
\n" +" Wir haben Ihnen einen Auszug der Ausstände beigelegt.
\n" +"
\n" +" Vielen Dank für Ihre Mitarbeit.
\n" +"
\n" +" Freundliche Grüsse" #. module: account_credit_control #: model:credit.control.policy.level,custom_mail_text:account_credit_control.3_time_3 @@ -998,6 +1071,21 @@ msgid "" "
\n" " Best regards" msgstr "" +"Unsere Durchsicht hat ergeben, dass wir trotz wiederholter Mahnungen noch " +"immer keinen Zahlungseingang zu den im Anhang aufgeführten Rechnungen " +"verbuchen konnten.
\n" +" Wenn Sie die Zahlung in der Zwischenzeit übermittelt haben, ignorieren Sie " +"bitte diese Nachricht. Ansonsten erwarten wir ihre unmittelbare Zahlung.
" +"\n" +" Wenn wir Ihre Zahlung nicht innerhalb der nächsten 5 Tage erhalten, werden " +"wir die Angelegenheit an eine Inkassofirma übergeben.
\n" +"
\n" +" Für Zahlungsvorschläge bitten wir Sie, uns umgehend zu kontaktieren.
\n" +" Wir haben Ihnen einen Auszug der Ausstände beigelegt.
\n" +"
\n" +" Vielen Dank für Ihre Mitarbeit.
\n" +"
\n" +" Freundliche Grüsse" #. module: account_credit_control #: model:credit.control.policy.level,custom_text:account_credit_control.2_time_2 @@ -1020,16 +1108,34 @@ msgid "" " Best regards\n" " " msgstr "" +"Unsere Durchsicht hat ergeben, dass wir trotz wiederholter Mahnungen noch " +"immer keinen Zahlungseingang zu den im Anhang aufgeführten Rechnungen " +"verbuchen konnten.\n" +"\n" +" Wenn Sie die Zahlung in der Zwischenzeit übermittelt haben, " +"ignorieren Sie bitte diese Nachricht. Ansonsten erwarten wir ihre " +"unmittelbare Zahlung.\n" +" Wenn wir Ihre Zahlung nicht innerhalb der nächsten 5 Tage " +"erhalten, werden wir die Angelegenheit an eine Inkassofirma übergeben.\n" +"\n" +" Für Zahlungsvorschläge bitten wir Sie, uns umgehend zu " +"kontaktieren.\n" +" Wir haben Ihnen einen Auszug der Ausstände beigelegt.\n" +"\n" +" Vielen Dank für Ihre Mitarbeit.\n" +"\n" +" Freundliche Grüsse\n" +" " #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_mail_mail msgid "Outgoing Mails" -msgstr "" +msgstr "Ausgehende Mails" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_policy_level_id msgid "Overdue Level" -msgstr "" +msgstr "Mahnstufe" #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_res_partner @@ -1043,170 +1149,170 @@ msgstr "Partner" #: model:ir.model.fields,help:account_credit_control.field_res_partner_payment_note #: model:ir.model.fields,help:account_credit_control.field_res_users_payment_note msgid "Payment Note" -msgstr "" +msgstr "Zahlungsanzeige" #. module: account_credit_control #: code:addons/account_credit_control/models/credit_control_run.py:92 #, python-format msgid "Please select a policy" -msgstr "" +msgstr "Bitte Mahnverfahren auswählen" #. module: account_credit_control #: code:addons/account_credit_control/wizard/credit_control_policy_changer.py:47 #, python-format msgid "Please use wizard on customer invoices" -msgstr "" +msgstr "Bitte Wizard auf Kundenrechnungen ausführen" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_policy_ids #: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Policies" -msgstr "" +msgstr "Verfahren" #. module: account_credit_control #: code:addons/account_credit_control/models/credit_control_run.py:115 #, python-format msgid "Policy \"%s\" has generated %d Credit Control Lines.
" -msgstr "" +msgstr "Mahnverfahren \"%s\" hat %d Mahnposten generiert.
" #. module: account_credit_control #: code:addons/account_credit_control/models/credit_control_run.py:119 #, python-format msgid "Policy \"%s\" has not generated any Credit Control Lines.
" -msgstr "" +msgstr "Mahnverfahren \"%s\" hat keine Mahnposten generiert.
" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_ids msgid "Policy Levels" -msgstr "" +msgstr "Stufen Mahnverfahren" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form #: model:ir.ui.view,arch_db:account_credit_control.credit_mangement_policy_level_form msgid "Policy level" -msgstr "" +msgstr "Stufe Mahnverfahren" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_form msgid "Policy levels" -msgstr "" +msgstr "Stufen Mahnverfahren" #. module: account_credit_control #: selection:credit.control.policy.level,computation_mode:0 msgid "Previous Reminder" -msgstr "" +msgstr "Letzte Mahnung" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_printer_form msgid "Print" -msgstr "" +msgstr "Druck" #. module: account_credit_control #: model:ir.actions.act_window,name:account_credit_control.open_credit_line_printer_wizard #: model:ir.actions.act_window,name:account_credit_control.open_credit_line_printer_wizard_menu_action msgid "Print Lines" -msgstr "" +msgstr "Druck Posten" #. module: account_credit_control #: model:ir.actions.act_window,help:account_credit_control.open_credit_line_printer_wizard msgid "Print selected lines" -msgstr "" +msgstr "Druck ausgewählte Posten" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_printer_form msgid "Print the selected lines" -msgstr "" +msgstr "Druck ausgewählte Posten" #. module: account_credit_control #: selection:credit.control.line,state:0 #: selection:credit.control.marker,name:0 #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Ready To Send" -msgstr "" +msgstr "Bereit zum Versand" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_policy_id #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_level_policy_id msgid "Related Policy" -msgstr "" +msgstr "Verknüpftes Mahnverfahren" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_report #: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form msgid "Report" -msgstr "" +msgstr "Auswertung" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_report_date msgid "Report Date" -msgstr "" +msgstr "Datum Auswertung" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Run date" -msgstr "" +msgstr "Ausführungsdatum" #. module: account_credit_control #: model:ir.actions.act_window,name:account_credit_control.open_credit_line_emailer_wizard #: model:ir.actions.act_window,name:account_credit_control.open_credit_line_emailer_wizard_menu_action msgid "Send By Email" -msgstr "" +msgstr "Versenden mit Email" #. module: account_credit_control #: model:ir.actions.act_window,help:account_credit_control.open_credit_line_emailer_wizard msgid "Send an email for the selected lines." -msgstr "" +msgstr "Emailversand für ausgewählte Posten." #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form msgid "Send emails for the selected lines" -msgstr "" +msgstr "Emailversand für ausgewählte Posten." #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_emailer_form msgid "Send the emails" -msgstr "" +msgstr "Versand Emails" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "Sent" -msgstr "" +msgstr "Gesendet" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_mail_message_id msgid "Sent Email" -msgstr "" +msgstr "Gesendete Email" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_date_sent msgid "Sent date" -msgstr "" +msgstr "Versanddatum" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form msgid "Set current credit level" -msgstr "" +msgstr "Einstellen aktuelle Kreditstufe" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form msgid "Set new policy" -msgstr "" +msgstr "Einstellen neues Mahnverfahren" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_run_id msgid "Source" -msgstr "" +msgstr "Quelle" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_state #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_state msgid "State" -msgstr "" +msgstr "Status" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document msgid "Summary" -msgstr "" +msgstr "Zusammenfassung" #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_account_invoice_credit_policy_id @@ -1214,6 +1320,8 @@ msgid "" "The Credit Control Policy used for this invoice. If nothing is defined, it " "will use the account setting or the partner setting." msgstr "" +"Für diese Rechnung gültiges Mahnverfahren. Wenn nichts definiert ist, wird " +"die Kontoeinstellung oder die Partnereinstellung angewandt." #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_res_partner_credit_policy_id @@ -1222,6 +1330,9 @@ msgid "" "The Credit Control Policy used for this partner. This setting can be forced " "on the invoice. If nothing is defined, it will use the company setting." msgstr "" +"Für diesen Partner gültiges Mahnverfahren. Die Einstellung kann auf der " +"Rechnung übersteuert werden. Wenn nichts definiert ist, wird die " +"Unternehmenseinstellung angewandt." #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_res_company_credit_policy_id @@ -1229,49 +1340,55 @@ msgid "" "The Credit Control Policy used on partners by default. This setting can be " "overridden on partners or invoices." msgstr "" +"Standardmässig auf Partnern angewandtes Mahnverfahren. Diese Einstellung " +"kann auf Partnern oder Rechnungen übersteuert werden." #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "The line was deprecated by a manual change of policy on invoice." msgstr "" +"Dieser Posten wurde aufgrund einer manuellen Änderung des Mahnverfahrens auf " +"der Rechnung heruntergesetzt." #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_credit_control_line_currency_id msgid "The optional other currency if it is a multi-currency entry." msgstr "" +"Die optionale andere Währung, falls es sich um einen Multiwährungseintrag " +"handelt." #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "The partner had a manual followup." -msgstr "" +msgstr "Dieser Partner hatte eine manuelle Nachbearbeitung." #. module: account_credit_control #: code:addons/account_credit_control/models/credit_control_policy.py:246 #, python-format msgid "The smallest level can not be of type Previous Reminder" -msgstr "" +msgstr "Die tiefste Mahnstufe kann nicht vom Typ letzte Mahnung sein" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search msgid "These lines are ready to send by email or by letter using the Actions." -msgstr "" +msgstr "Diese Posten können via Aktionen per Email oder Brief gesendet werden." #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_res_partner_payment_next_action #: model:ir.model.fields,help:account_credit_control.field_res_users_payment_next_action msgid "This is the next action to be taken." -msgstr "" +msgstr "Dies ist die nächste vorzunehmende Aktion." #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_res_partner_payment_next_action_date #: model:ir.model.fields,help:account_credit_control.field_res_users_payment_next_action_date msgid "This is when the manual follow-up is needed." -msgstr "" +msgstr "Dies ist wenn eine manuelle Nachbearbeitung nötig ist." #. module: account_credit_control #: model:ir.model.fields,help:account_credit_control.field_credit_control_policy_account_ids msgid "This policy will be active only for the selected accounts" -msgstr "" +msgstr "Dieses Mahnverfahren wird nur für die ausgewählten Konten aktiviert" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_control_policy_changer_form @@ -1279,27 +1396,30 @@ msgid "" "This wizard will let you set the overdue policy and level for selected " "invoices" msgstr "" +"Dieser Wizard ermöglicht Ihnen, auf ausgewählten Rechnungen das " +"Mahnverfahren und die Mahnstufe zu verändern" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_total_due msgid "Total Due" -msgstr "" +msgstr "Total fällig" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_total_invoiced msgid "Total Invoiced" -msgstr "" +msgstr "Total fakturiert" #. module: account_credit_control #: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_user_id #: model:res.groups,name:account_credit_control.group_account_credit_control_user msgid "User" -msgstr "" +msgstr "Benutzer" #. module: account_credit_control #: model:ir.ui.view,arch_db:account_credit_control.credit_line_marker_form msgid "Warning: you will maybe not be able to revert this operation." msgstr "" +"Warnung: Dieser Vorgang kann vielleicht nicht rückgängig gemacht werden." #. module: account_credit_control #: code:addons/account_credit_control/models/credit_control_line.py:217 @@ -1308,6 +1428,8 @@ msgid "" "You are not allowed to delete a credit control line that is not in draft " "state." msgstr "" +"Es ist nicht erlaubt, einen Mahnposten, der sich nicht im Entwurfszustand " +"befindet, zu löschen." #. module: account_credit_control #: code:addons/account_credit_control/models/credit_control_policy.py:186 @@ -1317,6 +1439,9 @@ msgid "" "Please choose one of the following policies:\n" " %s" msgstr "" +"Sie können nur auf Konto %s definierte Mahnverfahren verwenden.\n" +"Bitte wählen Sie eines der folgenden Mahnverfahren:\n" +" %s" #. module: account_credit_control #: code:addons/account_credit_control/models/account_invoice.py:45 @@ -1326,6 +1451,9 @@ msgid "" "A payment reminder has already been sent to the customer.\n" "You must create a credit note and issue a new invoice." msgstr "" +"Sie können diese Rechnung nicht löschen.\n" +"Eine Zahlungserinnerung wurde bereits an den Kunden gesendet.\n" +"Sie müssen eine Gutschrift erstellen und eine neue Rechnung ausstellen." #. module: account_credit_control #: model:ir.model,name:account_credit_control.model_credit_control_communication From 6c71e88eec2b33c3ccdf6a324c07808111336d55 Mon Sep 17 00:00:00 2001 From: dscherrer Date: Thu, 30 Aug 2018 16:07:42 +0000 Subject: [PATCH 06/26] Translated using Weblate (German) Currently translated at 95.0% (190 of 200 strings) Translation: account-financial-tools-10.0/account-financial-tools-10.0-account_credit_control Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-10-0/account-financial-tools-10-0-account_credit_control/de/ --- account_credit_control/i18n/de.po | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/account_credit_control/i18n/de.po b/account_credit_control/i18n/de.po index 4f83c6c63..8cfcaecc7 100644 --- a/account_credit_control/i18n/de.po +++ b/account_credit_control/i18n/de.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: German (account-financial-tools-10.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-30 13:07+0000\n" -"PO-Revision-Date: 2018-08-30 15:37+0000\n" +"POT-Creation-Date: 2018-08-30 16:00+0000\n" +"PO-Revision-Date: 2018-08-30 16:07+0000\n" "Last-Translator: dscherrer \n" "Language-Team: German Date: Thu, 30 Aug 2018 16:08:38 +0000 Subject: [PATCH 07/26] Translated using Weblate (German) Currently translated at 95.0% (190 of 200 strings) Translation: account-financial-tools-10.0/account-financial-tools-10.0-account_credit_control Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-10-0/account-financial-tools-10-0-account_credit_control/de/ --- account_credit_control/i18n/de.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_credit_control/i18n/de.po b/account_credit_control/i18n/de.po index 8cfcaecc7..5f59289e5 100644 --- a/account_credit_control/i18n/de.po +++ b/account_credit_control/i18n/de.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: German (account-financial-tools-10.0)\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-08-30 16:00+0000\n" -"PO-Revision-Date: 2018-08-30 16:07+0000\n" +"PO-Revision-Date: 2018-08-31 16:25+0000\n" "Last-Translator: dscherrer \n" "Language-Team: German Date: Mon, 3 Sep 2018 15:13:10 -0500 Subject: [PATCH 08/26] [FIX] account_reversal - Reverse multiple journal entries. --- account_reversal/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_reversal/models/account_move.py b/account_reversal/models/account_move.py index 7ccdeab52..79a9b5031 100644 --- a/account_reversal/models/account_move.py +++ b/account_reversal/models/account_move.py @@ -119,5 +119,5 @@ class AccountMove(models.Model): moves._post_validate() moves.post() if reconcile: - orig.move_reverse_reconcile() + self.move_reverse_reconcile() return moves From aeabc29f3cb1f74ade6734d543d549356968063b Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 18 Sep 2018 11:38:45 +0200 Subject: [PATCH 09/26] [FIX] account_lock_date_update: Fix tests --- .../tests/test_account_lock_date_update.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/account_lock_date_update/tests/test_account_lock_date_update.py b/account_lock_date_update/tests/test_account_lock_date_update.py index 6838dcf2f..70bf49066 100644 --- a/account_lock_date_update/tests/test_account_lock_date_update.py +++ b/account_lock_date_update/tests/test_account_lock_date_update.py @@ -10,11 +10,12 @@ class TestAccountLockDateUpdate(TransactionCase): def setUp(self): super(TestAccountLockDateUpdate, self).setUp() - self.UpdateLockDateUpdateObj = self.env['account.update.lock_date'] - self.company = self.env.ref('base.main_company') self.demo_user = self.env.ref('base.user_demo') self.adviser_group = self.env.ref('account.group_account_manager') + self.UpdateLockDateUpdateObj = self.env[ + 'account.update.lock_date' + ].sudo(self.demo_user) def create_account_lock_date_update(self): return self.UpdateLockDateUpdateObj.create({ @@ -27,23 +28,21 @@ class TestAccountLockDateUpdate(TransactionCase): 'period_lock_date': '2000-01-01', 'fiscalyear_lock_date': '2000-01-01', }) - self.demo_user.write({ 'groups_id': [(3, self.adviser_group.id)], }) - with self.assertRaises(UserError): wizard.sudo(self.demo_user.id).execute() def test_02_update_with_access(self): wizard = self.create_account_lock_date_update() wizard.write({ - 'period_lock_date': '2000-01-01', + 'period_lock_date': '2000-02-01', 'fiscalyear_lock_date': '2000-01-01', }) - self.demo_user.write({ 'groups_id': [(4, self.adviser_group.id)], }) - wizard.sudo(self.demo_user.id).execute() + self.assertEqual(self.company.period_lock_date, '2000-02-01') + self.assertEqual(self.company.fiscalyear_lock_date, '2000-01-01') From c4d62752a0335614add7d24a0979a3be5adcbdd2 Mon Sep 17 00:00:00 2001 From: moutio Date: Tue, 18 Sep 2018 12:44:38 +0200 Subject: [PATCH 10/26] [FIX] account_chart_update: Limit fiscal position search with same name (#651) --- account_chart_update/README.rst | 1 + account_chart_update/__manifest__.py | 3 ++- account_chart_update/wizard/wizard_chart_update.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/account_chart_update/README.rst b/account_chart_update/README.rst index 2407f0e1f..a1d133ab0 100644 --- a/account_chart_update/README.rst +++ b/account_chart_update/README.rst @@ -58,6 +58,7 @@ Contributors * Jairo Llopis * Jacques-Etienne Baudoux * Sylvain Van Hoof +* Nacho Muñoz Maintainer ---------- diff --git a/account_chart_update/__manifest__.py b/account_chart_update/__manifest__.py index 96fda9ba7..2a1cf15d1 100644 --- a/account_chart_update/__manifest__.py +++ b/account_chart_update/__manifest__.py @@ -8,7 +8,7 @@ { 'name': "Detect changes and update the Account Chart from a template", "summary": "Wizard to update a company's account chart from a template", - 'version': "10.0.1.0.1", + 'version': "10.0.1.0.2", 'author': "Tecnativa, " "BCIM, " "Okia, " @@ -21,6 +21,7 @@ 'Jairo Llopis', 'Jacques-Etienne Baudoux', 'Sylvain Van Hoof' + 'Nacho Muñoz', ], 'license': "AGPL-3", "data": [ diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 3f9c00e7f..8120ec35f 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -284,7 +284,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): """Find a real fiscal position from a template.""" return self.env['account.fiscal.position'].search( [('name', 'in', templates.mapped("name")), - ('company_id', '=', self.company_id.id)]) + ('company_id', '=', self.company_id.id)], limit=1) @api.multi @tools.ormcache("templates", "current_fp_accounts") From 5dcdccc0561f62096f32027dc1851a0e4c4c0ab3 Mon Sep 17 00:00:00 2001 From: OCA Git Bot Date: Wed, 19 Sep 2018 02:32:23 +0200 Subject: [PATCH 11/26] [UPD] addons table in README.md [ci skip] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25bc5d27d..2064c774c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ addon | version | summary [account_asset_depr_line_cancel](account_asset_depr_line_cancel/) | 10.0.1.0.0 | Assets Management - Cancel button [account_asset_disposal](account_asset_disposal/) | 10.0.2.0.0 | Makes asset close account move automatically [account_balance_line](account_balance_line/) | 10.0.1.0.0 | Display balance totals in move line view -[account_chart_update](account_chart_update/) | 10.0.1.0.1 | Wizard to update a company's account chart from a template +[account_chart_update](account_chart_update/) | 10.0.1.0.2 | Wizard to update a company's account chart from a template [account_check_deposit](account_check_deposit/) | 10.0.1.0.0 | Manage deposit of checks to the bank [account_credit_control](account_credit_control/) | 10.0.1.3.4 | Account Credit Control [account_credit_control_dunning_fees](account_credit_control_dunning_fees/) | 10.0.1.0.0 | Credit control dunning fees From 1eeb127f913159254d16e16b6cf22d6859bb2ace Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 18 Sep 2018 14:59:54 +0200 Subject: [PATCH 12/26] [FIX] account_chart_update: Don't cache recordsets When marking methods as ormcache, you can't return recordsets, as they keep the cursor information, and that cursor can be closed (worker spawn for example) when you need to access again data. This is fixed returning IDs instead, and browsing when needed --- .../wizard/wizard_chart_update.py | 85 ++++++++++--------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 8120ec35f..492452488 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -262,7 +262,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): ("type_tax_use", "=", template.type_tax_use)], limit=1) result |= single - return result + return result[:1].id @api.model @tools.ormcache("code") @@ -276,7 +276,8 @@ class WizardUpdateChartsAccounts(models.TransientModel): """Find an account that matches the template.""" return self.env['account.account'].search( [('code', 'in', map(self.padded_code, templates.mapped("code"))), - ('company_id', '=', self.company_id.id)]) + ('company_id', '=', self.company_id.id)], + ).id @api.multi @tools.ormcache("templates") @@ -284,27 +285,27 @@ class WizardUpdateChartsAccounts(models.TransientModel): """Find a real fiscal position from a template.""" return self.env['account.fiscal.position'].search( [('name', 'in', templates.mapped("name")), - ('company_id', '=', self.company_id.id)], limit=1) + ('company_id', '=', self.company_id.id)], limit=1).id @api.multi @tools.ormcache("templates", "current_fp_accounts") def find_fp_account_by_templates(self, templates, current_fp_accounts): result = [] for tpl in templates: - pos = self.find_fp_by_templates(tpl.position_id) - src = self.find_account_by_templates(tpl.account_src_id) - dest = self.find_account_by_templates(tpl.account_dest_id) + pos_id = self.find_fp_by_templates(tpl.position_id) + src_id = self.find_account_by_templates(tpl.account_src_id) + dest_id = self.find_account_by_templates(tpl.account_dest_id) mappings = self.env["account.fiscal.position.account"].search([ - ("position_id", "=", pos.id), - ("account_src_id", "=", src.id), + ("position_id", "=", pos_id), + ("account_src_id", "=", src_id), ]) existing = mappings.filtered(lambda x: x.account_dest_id == dest) if not existing: # create a new mapping result.append((0, 0, { - 'position_id': pos.id, - 'account_src_id': src.id, - 'account_dest_id': dest.id, + 'position_id': pos_id, + 'account_src_id': src_id, + 'account_dest_id': dest_id, })) else: current_fp_accounts -= existing @@ -318,20 +319,20 @@ class WizardUpdateChartsAccounts(models.TransientModel): def find_fp_tax_by_templates(self, templates, current_fp_taxes): result = [] for tpl in templates: - pos = self.find_fp_by_templates(tpl.position_id) - src = self.find_tax_by_templates(tpl.tax_src_id) - dest = self.find_tax_by_templates(tpl.tax_dest_id) + pos_id = self.find_fp_by_templates(tpl.position_id) + src_id = self.find_tax_by_templates(tpl.tax_src_id) + dest_id = self.find_tax_by_templates(tpl.tax_dest_id) mappings = self.env["account.fiscal.position.tax"].search([ - ("position_id", "=", pos.id), - ("tax_src_id", "=", src.id), + ("position_id", "=", pos_id), + ("tax_src_id", "=", src_id), ]) - existing = mappings.filtered(lambda x: x.tax_dest_id == dest) + existing = mappings.filtered(lambda x: x.tax_dest_id.id == dest_id) if not existing: # create a new mapping result.append((0, 0, { - 'position_id': pos.id, - 'tax_src_id': src.id, - 'tax_dest_id': dest.id, + 'position_id': pos_id, + 'tax_src_id': src_id, + 'tax_dest_id': dest_id, })) else: current_fp_taxes -= existing @@ -461,15 +462,15 @@ class WizardUpdateChartsAccounts(models.TransientModel): @api.multi def _find_taxes(self): """Search for, and load, tax templates to create/update/delete.""" - found_taxes = self.env["account.tax"] + found_taxes_ids = [] self.tax_ids.unlink() # Search for changes between template and real tax for template in self.chart_template_ids.mapped("tax_template_ids"): # Check if the template matches a real tax - tax = self.find_tax_by_templates(template) + tax_id = self.find_tax_by_templates(template) - if not tax: + if not tax_id: # Tax to be created self.tax_ids.create({ 'tax_id': template.id, @@ -478,9 +479,10 @@ class WizardUpdateChartsAccounts(models.TransientModel): 'notes': _('Name or description not found.'), }) else: - found_taxes |= tax + found_taxes_ids.append(tax_id) # Check the tax for changes + tax = self.env['account.tax'].browse(tax_id) notes = self.diff_notes(template, tax) if notes: # Tax to be updated @@ -488,7 +490,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): 'tax_id': template.id, 'update_chart_wizard_id': self.id, 'type': 'updated', - 'update_tax_id': tax.id, + 'update_tax_id': tax_id, 'notes': notes, }) @@ -496,7 +498,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): # deactivation taxes_to_delete = self.env['account.tax'].search( [('company_id', '=', self.company_id.id), - ("id", "not in", found_taxes.ids), + ("id", "not in", found_taxes_ids), ("active", "=", True)]) for tax in taxes_to_delete: self.tax_ids.create({ @@ -513,9 +515,9 @@ class WizardUpdateChartsAccounts(models.TransientModel): for template in self.chart_template_ids.mapped("account_ids"): # Search for a real account that matches the template - account = self.find_account_by_templates(template) + account_id = self.find_account_by_templates(template) - if not account: + if not account_id: # Account to be created self.account_ids.create({ 'account_id': template.id, @@ -525,6 +527,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): }) else: # Check the account for changes + account = self.env['account.account'].browse(account_id) notes = self.diff_notes(template, account) if notes: # Account to be updated @@ -532,7 +535,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): 'account_id': template.id, 'update_chart_wizard_id': self.id, 'type': 'updated', - 'update_account_id': account.id, + 'update_account_id': account_id, 'notes': notes, }) @@ -547,8 +550,8 @@ class WizardUpdateChartsAccounts(models.TransientModel): [('chart_template_id', 'in', self.chart_template_ids.ids)]) for template in templates: # Search for a real fiscal position that matches the template - fp = self.find_fp_by_templates(template) - if not fp: + fp_id = self.find_fp_by_templates(template) + if not fp_id: # Fiscal position to be created wiz_fp.create({ 'fiscal_position_id': template.id, @@ -558,6 +561,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): }) else: # Check the fiscal position for changes + fp = self.env['account.fiscal.position'].browse(fp_id) notes = self.diff_notes(template, fp) if notes: # Fiscal position template to be updated @@ -565,7 +569,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): 'fiscal_position_id': template.id, 'update_chart_wizard_id': self.id, 'type': 'updated', - 'update_fiscal_position_id': fp.id, + 'update_fiscal_position_id': fp_id, 'notes': notes, }) @@ -602,8 +606,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): 'reconcile': account_template.reconcile, 'note': account_template.note, 'tax_ids': [ - (6, 0, - self.find_tax_by_templates(account_template.tax_ids).ids), + (6, 0, [self.find_tax_by_templates(account_template.tax_ids)]), ], 'company_id': self.company_id.id, }) @@ -665,10 +668,8 @@ class WizardUpdateChartsAccounts(models.TransientModel): for fp_tax in fp_template.tax_ids: # Create the fp tax mapping tax_mapping.append({ - 'tax_src_id': self.find_tax_by_templates( - fp_tax.tax_src_id).id, - 'tax_dest_id': self.find_tax_by_templates( - fp_tax.tax_dest_id).id, + 'tax_src_id': self.find_tax_by_templates(fp_tax.tax_src_id), + 'tax_dest_id': self.find_tax_by_templates(fp_tax.tax_dest_id), }) # Account mappings account_mapping = [] @@ -676,11 +677,11 @@ class WizardUpdateChartsAccounts(models.TransientModel): # Create the fp account mapping account_mapping.append({ 'account_src_id': ( - self.find_account_by_templates( - fp_account.account_src_id).id), + self.find_account_by_templates(fp_account.account_src_id) + ), 'account_dest_id': ( - self.find_account_by_templates( - fp_account.account_dest_id).id), + self.find_account_by_templates(fp_account.account_dest_id) + ), }) return { 'company_id': self.company_id.id, From 949ca0a235df7b878b4fd9a842408a624615aeae Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 18 Sep 2018 14:41:19 +0200 Subject: [PATCH 13/26] [FIX+IMP] account_chart_update: Major refactoring * Compare all fields from template Not all fields were properly compared with previous code. This means also to exclude some of them, but now we have a full and extensible system. * Optimize cached method * Generate accounts and fiscal positions using Odoo methods (tax already did) * README by fragments * Add tests up to full coverage --- account_chart_update/README.rst | 87 +++- account_chart_update/__manifest__.py | 14 +- account_chart_update/i18n/es.po | 266 +++++----- account_chart_update/readme/CONTRIBUTORS.rst | 6 + account_chart_update/readme/DESCRIPTION.rst | 12 + account_chart_update/readme/ROADMAP.rst | 5 + account_chart_update/readme/USAGE.rst | 7 + .../static/description/index.html | 457 ++++++++++++++++++ account_chart_update/tests/__init__.py | 4 + .../tests/test_account_chart_update.py | 306 ++++++++++++ account_chart_update/wizard/__init__.py | 2 - .../wizard/wizard_chart_update.py | 263 +++++----- 12 files changed, 1129 insertions(+), 300 deletions(-) create mode 100644 account_chart_update/readme/CONTRIBUTORS.rst create mode 100644 account_chart_update/readme/DESCRIPTION.rst create mode 100644 account_chart_update/readme/ROADMAP.rst create mode 100644 account_chart_update/readme/USAGE.rst create mode 100644 account_chart_update/static/description/index.html create mode 100644 account_chart_update/tests/__init__.py create mode 100644 account_chart_update/tests/test_account_chart_update.py diff --git a/account_chart_update/README.rst b/account_chart_update/README.rst index a1d133ab0..e4e6541b1 100644 --- a/account_chart_update/README.rst +++ b/account_chart_update/README.rst @@ -1,11 +1,30 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - =========================================================== Detect changes and update the Account Chart from a template =========================================================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png + :target: https://odoo-community.org/page/development-status + :alt: Mature +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github + :target: https://github.com/OCA/account-financial-tools/tree/10.0/account_chart_update + :alt: OCA/account-financial-tools +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-financial-tools-10-0/account-financial-tools-10-0-account_chart_update + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/92/10.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This is a pretty useful tool to update Odoo installations after tax reforms on the official charts of accounts, or to apply fixes performed on the chart template. @@ -19,40 +38,53 @@ The wizard: * It can also update (overwrite) the accounts, taxes, tax codes and fiscal positions that got modified on the template. +**Table of contents** + +.. contents:: + :local: + Usage ===== -The wizard, accesible from *Accounting > Configuration > Settings > Chart of -Accounts > Update chart of accounts*, lets the user select what kind of objects -must be checked/updated, and whether old records must be checked for changes -and updates. +The wizard, accesible from *Accounting > Settings > Update chart of accounts*, +lets the user select what kind of objects must be checked/updated, and whether +old records must be checked for changes and updates. -It will display all the objects to be created / updated with some information -about the detected differences, and allow the user to exclude records -individually. - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/92/9.0 +It will display all the objects to be created / updated / deactivated with some +information about the detected differences, and allow the user to exclude +records individually. Known issues / Roadmap ====================== -* Add tests. +* Generate and update account reconcile models. +* Generate XML-ID for fiscal position tax and account mapping lines. +* Allow to select independently operations to perform (create, update, + deactivate). +* Detect fiscal positions to deactivate? Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, -please check there if your issue has already been reported. If you spotted it -first, help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Tecnativa +* BCIM +* Okia + Contributors ------------- +~~~~~~~~~~~~ * Pedro M. Baeza * Jairo Llopis @@ -60,17 +92,20 @@ Contributors * Sylvain Van Hoof * Nacho Muñoz -Maintainer ----------- + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/account-financial-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_chart_update/__manifest__.py b/account_chart_update/__manifest__.py index 2a1cf15d1..872b71007 100644 --- a/account_chart_update/__manifest__.py +++ b/account_chart_update/__manifest__.py @@ -1,28 +1,22 @@ # -*- coding: utf-8 -*- -# Copyright 2015-2017 Pedro Manuel Baeza # Copyright 2016 Jairo Llopis # Copyright 2016 Jacques-Etienne Baudoux # Copyright 2016 Sylvain Van Hoof +# Copyright 2015-2018 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': "Detect changes and update the Account Chart from a template", "summary": "Wizard to update a company's account chart from a template", - 'version': "10.0.1.0.2", + 'version': "10.0.2.0.0", 'author': "Tecnativa, " "BCIM, " "Okia, " "Odoo Community Association (OCA)", 'website': "http://odoo-community.org", 'depends': ["account"], - 'category': "Accounting & Finance", - 'contributors': [ - 'Pedro M. Baeza', - 'Jairo Llopis', - 'Jacques-Etienne Baudoux', - 'Sylvain Van Hoof' - 'Nacho Muñoz', - ], + 'development_status': 'Mature', + 'category': "Accounting", 'license': "AGPL-3", "data": [ 'wizard/wizard_chart_update_view.xml', diff --git a/account_chart_update/i18n/es.po b/account_chart_update/i18n/es.po index aa7de1162..523559d12 100644 --- a/account_chart_update/i18n/es.po +++ b/account_chart_update/i18n/es.po @@ -1,73 +1,70 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_chart_update +# * account_chart_update # -# Translators: -# OCA Transbot , 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-01 03:44+0000\n" -"PO-Revision-Date: 2018-02-01 03:44+0000\n" -"Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" -"Language: es\n" +"POT-Creation-Date: 2018-09-21 00:20+0000\n" +"PO-Revision-Date: 2018-09-21 00:20+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: \n" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_code_digits msgid "# of digits" -msgstr "" +msgstr "Nº de dígitos" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid " or " -msgstr "" +msgstr " o " #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_account_id msgid "Account template" -msgstr "" +msgstr "Plantilla de cuenta" #. module: account_chart_update #: model:ir.model,name:account_chart_update.model_wizard_update_charts_accounts_account msgid "Account that needs to be updated (new or updated in the template)." -msgstr "" +msgstr "Cuenta que necesita ser actualizada (nueva o cambiada en la plantilla)." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_update_account_id msgid "Account to update" -msgstr "" +msgstr "Cuenta a actualizar" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_ids #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Accounts" -msgstr "" +msgstr "Cuentas" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_chart_template_id msgid "Chart Template" -msgstr "" +msgstr "Plan contable" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_chart_template_ids msgid "Chart Templates" -msgstr "" +msgstr "Planes contables" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Chart of Accounts" -msgstr "" +msgstr "Plan contable" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Close" -msgstr "" +msgstr "Cerrar" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_company_id @@ -77,23 +74,23 @@ msgstr "Compañía" #. module: account_chart_update #: selection:wizard.update.charts.accounts,state:0 msgid "Configuration" -msgstr "" +msgstr "Configuración" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_continue_on_errors msgid "Continue on errors" -msgstr "" +msgstr "Continuar en errores" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Create/Update" -msgstr "" +msgstr "Crear/Actualizar" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:625 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:613 #, python-format msgid "Created account %s." -msgstr "" +msgstr "Creada cuenta %s." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_create_uid @@ -109,43 +106,41 @@ msgstr "Creado por" #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_fiscal_position_create_date #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax_create_date msgid "Created on" -msgstr "Creado en" +msgstr "Creado el" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:708 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:714 #, python-format msgid "Created or updated fiscal position %s." -msgstr "" - -#. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:587 -#, python-format -msgid "Created tax %s." -msgstr "" +msgstr "Creada o actualizada posición fiscal %s." #. module: account_chart_update #: code:addons/account_chart_update/wizard/wizard_chart_update.py:580 #, python-format +msgid "Created tax %s." +msgstr "Creado impuesto %s." + +#. module: account_chart_update +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:575 +#, python-format msgid "Deactivated tax %s." -msgstr "" +msgstr "Deactivado impuesto %s." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_deleted_taxes msgid "Deactivated taxes" -msgstr "" +msgstr "Impuestos desactivados" #. module: account_chart_update #: model:ir.model.fields,help:account_chart_update.field_wizard_update_charts_accounts_tax_type_tax_use -msgid "" -"Determines where the tax is selectable. Note : 'None' means a tax can't be " -"used by itself, however it can still be used in a group." -msgstr "" +msgid "Determines where the tax is selectable. Note : 'None' means a tax can't be used by itself, however it can still be used in a group." +msgstr "Determina dónde puede seleccionarse un impuesto. Nota : 'Ninguno' significa que un impuesto no puede ser usado por si mismo; aun así, puede utilizarse en un grupo." #. 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:451 #, python-format msgid "Differences in these fields: %s." -msgstr "" +msgstr "Diferencias en estos campos: %s." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_display_name @@ -153,64 +148,60 @@ msgstr "" #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_fiscal_position_display_name #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax_display_name msgid "Display Name" -msgstr "Nombre mostrado" +msgstr "Nombre a mostrar" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:629 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:622 #, python-format msgid "Exception creating account %s." -msgstr "" +msgstr "Excepción creando cuenta %s." #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:641 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:644 #, python-format msgid "Exception writing account %s." -msgstr "" +msgstr "Excepción escribiendo cuenta %s." #. module: account_chart_update #: model:ir.model.fields,help:account_chart_update.field_wizard_update_charts_accounts_update_account msgid "Existing accounts are updated. Accounts are searched by code." -msgstr "" +msgstr "Las cuentas existentes serán actualizadas. Las cuentas se buscan por código." #. module: account_chart_update #: model:ir.model.fields,help:account_chart_update.field_wizard_update_charts_accounts_update_fiscal_position -msgid "" -"Existing fiscal positions are updated. Fiscal positions are searched by name." -msgstr "" +msgid "Existing fiscal positions are updated. Fiscal positions are searched by name." +msgstr "Las posiciones fiscales existentes serán actualizadas. Las posiciones fiscales se buscan por nombre." #. module: account_chart_update #: model:ir.model.fields,help:account_chart_update.field_wizard_update_charts_accounts_update_tax msgid "Existing taxes are updated. Taxes are searched by name." -msgstr "" +msgstr "Los impuestos existentes serán actualizados. Los impuestos se buscan por nombre." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_fiscal_position_fiscal_position_id msgid "Fiscal position template" -msgstr "" +msgstr "Plantilla posición fiscal" #. module: account_chart_update #: model:ir.model,name:account_chart_update.model_wizard_update_charts_accounts_fiscal_position -msgid "" -"Fiscal position that needs to be updated (new or updated in the template)." -msgstr "" +msgid "Fiscal position that needs to be updated (new or updated in the template)." +msgstr "Posición fiscal que necesita ser actualizada (nuevo o modificada en la plantilla)" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_fiscal_position_update_fiscal_position_id msgid "Fiscal position to update" -msgstr "" +msgstr "Posición fiscal a actualizar" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_fiscal_position_ids #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Fiscal positions" -msgstr "" +msgstr "Posiciones fiscales" #. module: account_chart_update #: model:ir.model.fields,help:account_chart_update.field_wizard_update_charts_accounts_lang -msgid "" -"For records searched by name (taxes, fiscal positions), the template name " -"will be matched against the record name on this language." -msgstr "" +msgid "For records searched by name (taxes, fiscal positions), the template name will be matched against the record name on this language." +msgstr "Para registros buscados por nombre (impuestos, posiciones fiscales), el nombre de la plantilla será casado contra el nombre del registro en este idioma." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_id @@ -222,27 +213,23 @@ msgstr "ID" #. module: account_chart_update #: model:ir.model.fields,help:account_chart_update.field_wizard_update_charts_accounts_continue_on_errors -msgid "" -"If set, the wizard will continue to the next step even if there are minor " -"errors." -msgstr "" +msgid "If set, the wizard will continue to the next step even if there are minor errors." +msgstr "Si está establecido, el asistente continuará al siguiente paso aunque haya errores." #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart -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 "" +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 estas opciones establecidas, el asistente no solo crearé nuevos registros, si no que también actualizará registros con cambios (por ejemplo, diferente importe de impuesto)" #. module: account_chart_update #: model:ir.model.fields,help:account_chart_update.field_wizard_update_charts_accounts_chart_template_ids msgid "Includes all chart templates." -msgstr "" +msgstr "Incluye todos los planes contables." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_lang msgid "Language" -msgstr "" +msgstr "Idioma" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts___last_update @@ -250,7 +237,7 @@ msgstr "" #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_fiscal_position___last_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax___last_update msgid "Last Modified on" -msgstr "Última modificación el" +msgstr "Última modificación en" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_write_uid @@ -266,110 +253,125 @@ msgstr "Última actualización por" #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax_write_date #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_write_date msgid "Last Updated on" -msgstr "Última actualización en" +msgstr "Última actualización el" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Log" -msgstr "" +msgstr "Registro (Log)" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_log msgid "Messages and Errors" -msgstr "" +msgstr "Mensajes y errores" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:478 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:474 #, python-format msgid "Name or description not found." -msgstr "" +msgstr "Nombre o descripción no encontrada." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_new_accounts msgid "New accounts" -msgstr "" +msgstr "Nuevas cuentas" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_new_fps msgid "New fiscal positions" -msgstr "" +msgstr "Nuevas posiciones fiscales" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_new_taxes msgid "New taxes" -msgstr "" +msgstr "Nuevos impuestos" #. module: account_chart_update #: selection:wizard.update.charts.accounts.account,type:0 #: selection:wizard.update.charts.accounts.fiscal.position,type:0 #: selection:wizard.update.charts.accounts.tax,type:0 msgid "New template" -msgstr "" +msgstr "Nueva plantilla" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Next" -msgstr "" +msgstr "Siguiente" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:524 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:517 #, python-format msgid "No account found with this code." -msgstr "" +msgstr "No se ha encontrado cuenta con este código." #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:557 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:551 #, python-format msgid "No fiscal position found with this name." -msgstr "" +msgstr "No se ha encontrado posición fiscal con este nombre." #. module: account_chart_update #: model:ir.model.fields,help:account_chart_update.field_wizard_update_charts_accounts_code_digits -msgid "" -"No. of digits to use for account code. Make sure it is the same number as " -"existing accounts." -msgstr "" +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 es el mismo número que las cuentas existentes." #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Note: Only the changed fields are updated." -msgstr "" +msgstr "Nota: Solo los campos cambiados se actualizan." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_notes #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_fiscal_position_notes #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax_notes msgid "Notes" -msgstr "" +msgstr "Notas" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:233 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:246 #, python-format -msgid "" -"One or more errors detected!\n" +msgid "One or more errors detected!\n" +"\n" +"%s" +msgstr "Se ha detectado uno o más errores\n" "\n" "%s" -msgstr "" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Other options" -msgstr "" +msgstr "Otras opciones" + +#. module: account_chart_update +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:667 +#, python-format +msgid "Post-updated tax %s." +msgstr "Impuesto %s post-actualizado." #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Previous" -msgstr "" +msgstr "Anterior" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Records to create/update" -msgstr "" +msgstr "Registros a crear/actualizar" + +#. module: account_chart_update +#: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_rejected_new_account_number +msgid "Rejected new account number" +msgstr "Número de nuevas cuentas rechazadas" + +#. module: account_chart_update +#: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_rejected_updated_account_number +msgid "Rejected updated account number" +msgstr "Número de cuentas a actualizar rechazadas" #. module: account_chart_update #: selection:wizard.update.charts.accounts,state:0 msgid "Select records to update" -msgstr "" +msgstr "Seleccione registros a actualizar" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_state @@ -379,62 +381,60 @@ msgstr "Estado" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Summary of created objects" -msgstr "" +msgstr "Resumen de objetos creados" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Summary of updated objects" -msgstr "" +msgstr "Resumen de objetos actualizados" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax_type_tax_use msgid "Tax Scope" -msgstr "" +msgstr "Ámbito del impuesto" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:458 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:456 #, python-format msgid "Tax is disabled." -msgstr "" +msgstr "Impuesto desactivado." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax_tax_id msgid "Tax template" -msgstr "" +msgstr "Plantilla de impuesto" #. module: account_chart_update #: model:ir.model,name:account_chart_update.model_wizard_update_charts_accounts_tax msgid "Tax that needs to be updated (new or updated in the template)." -msgstr "" +msgstr "Impuesto que necesita ser actualizado (nuevo o modificado en la plantilla)." #. module: account_chart_update #: selection:wizard.update.charts.accounts.tax,type:0 msgid "Tax to deactivate" -msgstr "" +msgstr "Impuesto a deactivar" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax_update_tax_id msgid "Tax to update" -msgstr "" +msgstr "Impuesto a actualizar" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax_ids #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Taxes" -msgstr "" +msgstr "Impuestos" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart -msgid "" -"This wizard will update your accounts, taxes and fiscal positions according " -"to the selected chart template" -msgstr "" +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 con el plan contable seleccionado" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:506 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:501 #, python-format msgid "To deactivate: not in the template" -msgstr "" +msgstr "A deactivar: no está en la plantilla" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_type @@ -446,80 +446,80 @@ msgstr "Tipo" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_update_account msgid "Update accounts" -msgstr "" +msgstr "Actualizar cuentas" #. module: account_chart_update #: model:ir.actions.act_window,name:account_chart_update.action_wizard_update_chart msgid "Update chart of accounts" -msgstr "" +msgstr "Actualizar plan contable" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_account_config_settings msgid "Update chart template" -msgstr "" +msgstr "Actualizar plan contable" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_account_update_chart_wizard_id #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_fiscal_position_update_chart_wizard_id #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_tax_update_chart_wizard_id msgid "Update chart wizard" -msgstr "" +msgstr "Asistente de actualización de plan contable" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_update_fiscal_position msgid "Update fiscal positions" -msgstr "" +msgstr "Actualizar posiciones fiscales" #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Update records?" -msgstr "" +msgstr "¿Actualizar registros?" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_update_tax msgid "Update taxes" -msgstr "" +msgstr "Actualizar impuestos" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:638 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:635 #, python-format msgid "Updated account %s." -msgstr "" +msgstr "Cuenta %s actualizada." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_updated_accounts msgid "Updated accounts" -msgstr "" +msgstr "Cuentas actualizadas" #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_updated_fps msgid "Updated fiscal positions" -msgstr "" +msgstr "Posiciones fiscales actualizadas" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:593 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:588 #, python-format msgid "Updated tax %s." -msgstr "" +msgstr "Impuesto %s actualizado." #. module: account_chart_update #: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_updated_taxes msgid "Updated taxes" -msgstr "" +msgstr "Impuestos actualizados" #. module: account_chart_update #: selection:wizard.update.charts.accounts.account,type:0 #: selection:wizard.update.charts.accounts.fiscal.position,type:0 #: selection:wizard.update.charts.accounts.tax,type:0 msgid "Updated template" -msgstr "" +msgstr "Plantilla actualizada" #. module: account_chart_update #: selection:wizard.update.charts.accounts,state:0 msgid "Wizard completed" -msgstr "" +msgstr "Asistente completado" #. module: account_chart_update #: model:ir.model,name:account_chart_update.model_wizard_update_charts_accounts msgid "wizard.update.charts.accounts" -msgstr "" +msgstr "wizard.update.charts.accounts" diff --git a/account_chart_update/readme/CONTRIBUTORS.rst b/account_chart_update/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..f247d64d2 --- /dev/null +++ b/account_chart_update/readme/CONTRIBUTORS.rst @@ -0,0 +1,6 @@ +* Pedro M. Baeza +* Jairo Llopis +* Jacques-Etienne Baudoux +* Sylvain Van Hoof +* Nacho Muñoz + diff --git a/account_chart_update/readme/DESCRIPTION.rst b/account_chart_update/readme/DESCRIPTION.rst new file mode 100644 index 000000000..16bcfce38 --- /dev/null +++ b/account_chart_update/readme/DESCRIPTION.rst @@ -0,0 +1,12 @@ +This is a pretty useful tool to update Odoo installations after tax reforms +on the official charts of accounts, or to apply fixes performed on the chart +template. + +The wizard: + +* Allows the user to compare a chart and a template showing differences + on accounts, taxes, tax codes and fiscal positions. +* It may create the new account, taxes, tax codes and fiscal positions detected + on the template. +* It can also update (overwrite) the accounts, taxes, tax codes and fiscal + positions that got modified on the template. diff --git a/account_chart_update/readme/ROADMAP.rst b/account_chart_update/readme/ROADMAP.rst new file mode 100644 index 000000000..40b5a6a8a --- /dev/null +++ b/account_chart_update/readme/ROADMAP.rst @@ -0,0 +1,5 @@ +* Generate and update account reconcile models. +* Generate XML-ID for fiscal position tax and account mapping lines. +* Allow to select independently operations to perform (create, update, + deactivate). +* Detect fiscal positions to deactivate? diff --git a/account_chart_update/readme/USAGE.rst b/account_chart_update/readme/USAGE.rst new file mode 100644 index 000000000..011aafa72 --- /dev/null +++ b/account_chart_update/readme/USAGE.rst @@ -0,0 +1,7 @@ +The wizard, accesible from *Accounting > Settings > Update chart of accounts*, +lets the user select what kind of objects must be checked/updated, and whether +old records must be checked for changes and updates. + +It will display all the objects to be created / updated / deactivated with some +information about the detected differences, and allow the user to exclude +records individually. diff --git a/account_chart_update/static/description/index.html b/account_chart_update/static/description/index.html new file mode 100644 index 000000000..c0d18befa --- /dev/null +++ b/account_chart_update/static/description/index.html @@ -0,0 +1,457 @@ + + + + + + +Detect changes and update the Account Chart from a template + + + +
+

Detect changes and update the Account Chart from a template

+ + +

Mature License: AGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runbot

+

This is a pretty useful tool to update Odoo installations after tax reforms +on the official charts of accounts, or to apply fixes performed on the chart +template.

+

The wizard:

+
    +
  • Allows the user to compare a chart and a template showing differences +on accounts, taxes, tax codes and fiscal positions.
  • +
  • It may create the new account, taxes, tax codes and fiscal positions detected +on the template.
  • +
  • It can also update (overwrite) the accounts, taxes, tax codes and fiscal +positions that got modified on the template.
  • +
+

Table of contents

+ +
+

Usage

+

The wizard, accesible from Accounting > Settings > Update chart of accounts, +lets the user select what kind of objects must be checked/updated, and whether +old records must be checked for changes and updates.

+

It will display all the objects to be created / updated / deactivated with some +information about the detected differences, and allow the user to exclude +records individually.

+
+
+

Known issues / Roadmap

+
    +
  • Generate and update account reconcile models.
  • +
  • Generate XML-ID for fiscal position tax and account mapping lines.
  • +
  • Allow to select independently operations to perform (create, update, +deactivate).
  • +
  • Detect fiscal positions to deactivate?
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
  • BCIM
  • +
  • Okia
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/account-financial-tools project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_chart_update/tests/__init__.py b/account_chart_update/tests/__init__.py new file mode 100644 index 000000000..243c1b0ff --- /dev/null +++ b/account_chart_update/tests/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_account_chart_update diff --git a/account_chart_update/tests/test_account_chart_update.py b/account_chart_update/tests/test_account_chart_update.py new file mode 100644 index 000000000..e3b2d0268 --- /dev/null +++ b/account_chart_update/tests/test_account_chart_update.py @@ -0,0 +1,306 @@ +# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields +from odoo.tests import common + + +class TestAccountChartUpdate(common.HttpCase): + at_install = False + post_install = True + + def _create_xml_id(self, record): + return self.env['ir.model.data'].create({ + 'module': 'account_chart_update', + 'name': "%s-%s" % (record._table, record.id), + 'model': record._name, + 'res_id': record.id, + }) + + def _create_account_tmpl(self, name, code, user_type, chart_template): + record = self.env['account.account.template'].create({ + 'name': name, + 'code': code, + 'user_type_id': user_type.id, + 'chart_template_id': chart_template and chart_template.id, + }) + self._create_xml_id(record) + return record + + def _create_tax_tmpl(self, name, chart_template): + record = self.env['account.tax.template'].create({ + 'name': name, + 'amount': 0, + 'chart_template_id': chart_template.id, + 'tax_group_id': self.env.ref('account.tax_group_taxes').id, + }) + self._create_xml_id(record) + return record + + def _create_fp_tmpl(self, name, chart_template): + record = self.env['account.fiscal.position.template'].create({ + 'name': name, + 'chart_template_id': chart_template.id, + }) + self._create_xml_id(record) + return record + + def setUp(self): + super(TestAccountChartUpdate, self).setUp() + # Make sure user is in English + self.env.user.lang = 'en_US' + self.account_type = self.env['account.account.type'].create({ + 'name': 'Test account_chart_update account type', + }) + self.account_template = self._create_account_tmpl( + 'Test', '100000', self.account_type, False, + ) + self.chart_template = self.env['account.chart.template'].create({ + 'name': 'Test account_chart_update chart', + 'currency_id': self.env.ref('base.EUR').id, + 'code_digits': 6, + 'transfer_account_id': self.account_template.id, + }) + self.account_template.chart_template_id = self.chart_template.id + self.account_template_pl = self._create_account_tmpl( + 'Undistributed Profits/Losses', '999999', + self.env.ref("account.data_unaffected_earnings"), + self.chart_template, + ) + self.tax_template = self._create_tax_tmpl( + 'Test tax', self.chart_template, + ) + self.fp_template = self._create_fp_tmpl('Test fp', self.chart_template) + self.fp_template_tax = self.env[ + 'account.fiscal.position.tax.template' + ].create({ + 'tax_src_id': self.tax_template.id, + 'position_id': self.fp_template.id, + }) + self._create_xml_id(self.fp_template_tax) + self.fp_template_account = self.env[ + 'account.fiscal.position.account.template' + ].create({ + 'account_src_id': self.account_template.id, + 'account_dest_id': self.account_template.id, + 'position_id': self.fp_template.id, + }) + self._create_xml_id(self.fp_template_account) + self.tax_group = self.env['account.tax.group'].create({ + 'name': 'Test tax group', + }) + self.company = self.env['res.company'].create({ + 'name': 'Test account_chart_update company', + 'currency_id': self.chart_template.currency_id.id, + }) + # Load chart of template into company + wizard = self.env['wizard.multi.charts.accounts'].create({ + 'company_id': self.company.id, + 'chart_template_id': self.chart_template.id, + 'code_digits': self.chart_template.code_digits, + 'transfer_account_id': self.account_template.id, + 'currency_id': self.chart_template.currency_id.id, + 'bank_account_code_prefix': '572', + 'cash_account_code_prefix': '570', + }) + wizard.onchange_chart_template_id() + wizard.execute() + self.tax = self.env['account.tax'].search([ + ('name', '=', self.tax_template.name), + ('company_id', '=', self.company.id), + ]) + self.account = self.env['account.account'].search([ + ('code', '=', self.account_template.code), + ('company_id', '=', self.company.id), + ]) + self.fp = self.env['account.fiscal.position'].search([ + ('name', '=', self.fp_template.name), + ('company_id', '=', self.company.id), + ]) + # Prepare wizard values + self.wizard_obj = self.env['wizard.update.charts.accounts'] + self.wizard_vals = { + 'company_id': self.company.id, + 'chart_template_id': self.chart_template.id, + 'code_digits': 6, + 'lang': 'en_US' + } + + def test_chart_update(self): + # Test no changes + wizard = self.wizard_obj.create(self.wizard_vals) + wizard.action_find_records() + self.assertEqual(wizard.state, 'ready') + self.assertFalse(wizard.tax_ids) + self.assertFalse(wizard.account_ids) + self.assertFalse(wizard.fiscal_position_ids) + wizard.unlink() + # Add templates + new_tax_tmpl = self._create_tax_tmpl( + 'Test tax 2', self.chart_template, + ) + new_account_tmpl = self._create_account_tmpl( + 'Test account 2', '333333', self.account_type, self.chart_template, + ) + new_fp = self._create_fp_tmpl('Test fp 2', self.chart_template) + fp_template_tax = self.env[ + 'account.fiscal.position.tax.template' + ].create({ + 'tax_src_id': self.tax_template.id, + 'position_id': new_fp.id, + }) + self._create_xml_id(fp_template_tax) + fp_template_account = self.env[ + 'account.fiscal.position.account.template' + ].create({ + 'account_src_id': self.account_template.id, + 'account_dest_id': self.account_template.id, + 'position_id': new_fp.id, + }) + self._create_xml_id(fp_template_account) + # Check that no action is performed if the option is not selected + wizard_vals = self.wizard_vals.copy() + wizard_vals.update({ + 'update_tax': False, + 'update_account': False, + 'update_fiscal_position': False, + }) + wizard = self.wizard_obj.create(wizard_vals) + wizard.action_find_records() + self.assertFalse(wizard.tax_ids) + self.assertFalse(wizard.account_ids) + self.assertFalse(wizard.fiscal_position_ids) + wizard.unlink() + # Now do the real one for detecting additions + wizard = self.wizard_obj.create(self.wizard_vals) + wizard.action_find_records() + self.assertTrue(wizard.tax_ids) + self.assertEqual(wizard.tax_ids.tax_id, new_tax_tmpl) + self.assertEqual(wizard.tax_ids.type, 'new') + self.assertTrue(wizard.account_ids) + self.assertEqual(wizard.account_ids.account_id, new_account_tmpl) + self.assertEqual(wizard.tax_ids.type, 'new') + self.assertTrue(wizard.fiscal_position_ids) + self.assertEqual(wizard.fiscal_position_ids.fiscal_position_id, new_fp) + self.assertEqual(wizard.fiscal_position_ids.type, 'new') + wizard.action_update_records() + self.assertEqual(wizard.state, 'done') + self.assertEqual(wizard.new_taxes, 1) + self.assertEqual(wizard.new_accounts, 1) + self.assertEqual(wizard.new_fps, 1) + self.assertTrue(wizard.log) + new_tax = self.env['account.tax'].search([ + ('name', '=', new_tax_tmpl.name), + ('company_id', '=', self.company.id), + ]) + self.assertTrue(new_tax) + new_account = self.env['account.account'].search([ + ('code', '=', new_account_tmpl.code), + ('company_id', '=', self.company.id), + ]) + self.assertTrue(new_account) + fp = self.env['account.fiscal.position'].search([ + ('name', '=', new_fp.name), + ('company_id', '=', self.company.id), + ]) + self.assertTrue(fp) + self.assertTrue(fp.tax_ids) + self.assertTrue(fp.account_ids) + wizard.unlink() + # Update objects + self.tax_template.description = "Test description" + self.tax_template.tax_group_id = self.tax_group.id + self.tax_template.refund_account_id = new_account_tmpl.id + self.account_template.name = "Other name" + self.fp_template.note = "Test note" + self.fp_template.account_ids.account_dest_id = new_account_tmpl.id + self.fp_template.tax_ids.tax_dest_id = self.tax_template.id + wizard = self.wizard_obj.create(self.wizard_vals) + wizard.action_find_records() + self.assertTrue(wizard.tax_ids) + self.assertEqual(wizard.tax_ids.tax_id, self.tax_template) + self.assertEqual(wizard.tax_ids.type, 'updated') + self.assertTrue(wizard.account_ids) + self.assertEqual(wizard.account_ids.account_id, self.account_template) + self.assertEqual(wizard.account_ids.type, 'updated') + self.assertTrue(wizard.fiscal_position_ids) + self.assertTrue(wizard.fiscal_position_ids.type, 'updated') + self.assertEqual( + wizard.fiscal_position_ids.fiscal_position_id, self.fp_template, + ) + self.assertEqual(wizard.fiscal_position_ids.type, 'updated') + wizard.action_update_records() + self.assertEqual(wizard.updated_taxes, 1) + self.assertEqual(wizard.updated_accounts, 1) + self.assertEqual(wizard.updated_fps, 1) + self.assertEqual(self.tax.description, self.tax_template.description) + self.assertEqual(self.tax.tax_group_id, self.tax_group) + self.assertEqual(self.tax.refund_account_id, new_account) + self.assertEqual(self.account.name, self.account_template.name) + self.assertEqual(self.fp.note, self.fp_template.note) + self.assertEqual(self.fp.account_ids.account_dest_id, new_account) + self.assertEqual(self.fp.tax_ids.tax_dest_id, self.tax) + wizard.unlink() + # Remove objects + new_tax_tmpl.unlink() + wizard = self.wizard_obj.create(self.wizard_vals) + wizard.action_find_records() + self.assertTrue(wizard.tax_ids) + self.assertEqual(wizard.tax_ids.update_tax_id, new_tax) + self.assertEqual(wizard.tax_ids.type, 'deleted') + wizard.action_update_records() + self.assertEqual(wizard.deleted_taxes, 1) + self.assertFalse(new_tax.active) + wizard.unlink() + # Errors on account update + self.account_template.reconcile = True + self.env['account.move'].create({ + 'name': 'Test move', + 'journal_id': self.env['account.journal'].search([ + ('company_id', '=', self.company.id), + ], limit=1).id, + 'date': fields.Date.today(), + 'line_ids': [ + (0, 0, { + 'account_id': self.account.id, + 'name': 'Test move line', + 'debit': 10, + 'credit': 0, + }), + (0, 0, { + 'account_id': self.account.id, + 'name': 'Test move line2', + 'debit': 0, + 'credit': 10, + }), + ] + }) + self.tax_template.description = "Other description" + wizard = self.wizard_obj.create(self.wizard_vals) + wizard.action_find_records() + with self.assertRaises(Exception): + wizard.action_update_records() + # Errors on account update - continuing after that + wizard.continue_on_errors = True + wizard.action_update_records() + self.assertFalse(self.account.reconcile) + self.assertEqual(self.tax.description, self.tax_template.description) + self.assertEqual(wizard.rejected_updated_account_number, 1) + self.assertEqual(wizard.updated_accounts, 0) + wizard.unlink() + # Errors on account_creation + self.account_template.reconcile = False + new_account_tmpl_2 = self._create_account_tmpl( + 'Test account 3', '444444', self.account_type, self.chart_template, + ) + wizard = self.wizard_obj.create(self.wizard_vals) + wizard.action_find_records() + self.assertEqual(wizard.account_ids.type, 'new') + new_account_tmpl_2.code = '333333' # Trick the code for forcing error + with self.assertRaises(Exception): + wizard.action_update_records() + wizard.continue_on_errors = True + wizard.action_update_records() + self.assertEqual(wizard.rejected_new_account_number, 1) + self.assertEqual(wizard.new_accounts, 0) + wizard.unlink() diff --git a/account_chart_update/wizard/__init__.py b/account_chart_update/wizard/__init__.py index 3c52c6a91..3c2acb990 100644 --- a/account_chart_update/wizard/__init__.py +++ b/account_chart_update/wizard/__init__.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# © 2010 Zikzakmedia S.L. (http://www.zikzakmedia.com) -# © 2010 Pexego Sistemas Informáticos S.L.(http://www.pexego.es) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import wizard_chart_update diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 492452488..bf16b05ee 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -6,14 +6,17 @@ # © 2015 Antonio Espinosa # © 2016 Jairo Llopis # © 2016 Jacques-Etienne Baudoux +# Copyright 2018 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, exceptions, _, tools +from odoo import _, api, exceptions, fields, models, tools +from odoo.tools import config from contextlib import closing from cStringIO import StringIO import logging _logger = logging.getLogger(__name__) +EXCEPTION_TEXT = u"Traceback (most recent call last)" class WizardUpdateChartsAccounts(models.TransientModel): @@ -76,12 +79,14 @@ class WizardUpdateChartsAccounts(models.TransientModel): new_accounts = fields.Integer( string='New accounts', compute="_compute_new_accounts_count") + rejected_new_account_number = fields.Integer() new_fps = fields.Integer( string='New fiscal positions', compute="_compute_new_fps_count") updated_taxes = fields.Integer( string='Updated taxes', compute="_compute_updated_taxes_count") + rejected_updated_account_number = fields.Integer() updated_accounts = fields.Integer( string='Updated accounts', compute="_compute_updated_accounts_count") @@ -115,7 +120,8 @@ class WizardUpdateChartsAccounts(models.TransientModel): @api.depends('account_ids') def _compute_new_accounts_count(self): self.new_accounts = len( - self.account_ids.filtered(lambda x: x.type == 'new')) + self.account_ids.filtered(lambda x: x.type == 'new') + ) - self.rejected_new_account_number @api.multi @api.depends('fiscal_position_ids') @@ -133,7 +139,8 @@ class WizardUpdateChartsAccounts(models.TransientModel): @api.depends('account_ids') def _compute_updated_accounts_count(self): self.updated_accounts = len( - self.account_ids.filtered(lambda x: x.type == 'updated')) + self.account_ids.filtered(lambda x: x.type == 'updated') + ) - self.rejected_updated_account_number @api.multi @api.depends('fiscal_position_ids') @@ -208,30 +215,35 @@ class WizardUpdateChartsAccounts(models.TransientModel): def action_update_records(self): """Action that creates/updates/deletes the selected elements.""" self = self.with_context(lang=self.lang) - + self.rejected_new_account_number = 0 + self.rejected_updated_account_number = 0 with closing(StringIO()) as log_output: handler = logging.StreamHandler(log_output) _logger.addHandler(handler) - # Create or update the records. if self.update_tax: self._update_taxes() + perform_rest = True if self.update_account: self._update_accounts() - if self.update_fiscal_position: + if (EXCEPTION_TEXT in log_output.getvalue() and + not self.continue_on_errors): # Abort early + perform_rest = False + # Clear this cache for avoiding incorrect account hits (as it was + # queried before account creation) + self.find_account_by_templates.clear_cache(self) + if self.update_tax and perform_rest: + self._update_taxes_pending_for_accounts() + if self.update_fiscal_position and perform_rest: self._update_fiscal_positions() - # Store new chart in the company self.company_id.chart_template_id = self.chart_template_id - _logger.removeHandler(handler) self.log = log_output.getvalue() - # Check if errors where detected and wether we should stop. - if self.log and not self.continue_on_errors: + if EXCEPTION_TEXT in self.log and not self.continue_on_errors: raise exceptions.Warning( _("One or more errors detected!\n\n%s") % self.log) - # Store the data and go to the next step. self.state = 'done' return self._reopen() @@ -295,11 +307,11 @@ class WizardUpdateChartsAccounts(models.TransientModel): pos_id = self.find_fp_by_templates(tpl.position_id) src_id = self.find_account_by_templates(tpl.account_src_id) dest_id = self.find_account_by_templates(tpl.account_dest_id) - mappings = self.env["account.fiscal.position.account"].search([ + existing = self.env["account.fiscal.position.account"].search([ ("position_id", "=", pos_id), ("account_src_id", "=", src_id), + ("account_dest_id", "=", dest_id), ]) - existing = mappings.filtered(lambda x: x.account_dest_id == dest) if not existing: # create a new mapping result.append((0, 0, { @@ -322,11 +334,11 @@ class WizardUpdateChartsAccounts(models.TransientModel): pos_id = self.find_fp_by_templates(tpl.position_id) src_id = self.find_tax_by_templates(tpl.tax_src_id) dest_id = self.find_tax_by_templates(tpl.tax_dest_id) - mappings = self.env["account.fiscal.position.tax"].search([ + existing = self.env["account.fiscal.position.tax"].search([ ("position_id", "=", pos_id), ("tax_src_id", "=", src_id), + ("tax_dest_id", "=", dest_id), ]) - existing = mappings.filtered(lambda x: x.tax_dest_id.id == dest_id) if not existing: # create a new mapping result.append((0, 0, { @@ -342,40 +354,24 @@ class WizardUpdateChartsAccounts(models.TransientModel): return result @api.model - @tools.ormcache("template") - def fields_to_ignore(self, template): + @tools.ormcache("name") + def fields_to_ignore(self, template, name): """Get fields that will not be used when checking differences. - :param str template: - The template record. - - :return set: - Fields to ignore in diff. + :param str template: A template record. + :param str name: The name of the template model. + :return set: Fields to ignore in diff. """ - specials = { + specials_mapping = { + "account.tax.template": { + "children_tax_ids", + }, "account.account.template": { "code", }, - "account.tax.template": { - "account_id", - "refund_account_id", - } } - to_include = { - "account.fiscal.position.template": [ - 'tax_ids', - 'account_ids', - ], - } - specials = ({"display_name", "__last_update"} | - specials.get(template._name, set())) - for key, field in template._fields.iteritems(): - if (template._name in to_include and - key in to_include[template._name]): - continue - if ".template" in field.get_description(self.env).get( - "relation", ""): - specials.add(key) + specials = ({"display_name", "__last_update", "company_id"} | + specials_mapping.get(name, set())) return set(models.MAGIC_COLUMNS) | specials @api.model @@ -391,43 +387,44 @@ class WizardUpdateChartsAccounts(models.TransientModel): Fields that are different in both records, and the expected value. """ result = dict() - ignore = self.fields_to_ignore(template) + ignore = self.fields_to_ignore(template, template._name) for key, field in template._fields.iteritems(): if key in ignore: continue - relation = expected = t = None - # Code must be padded to check equality - if key == "code": - expected = self.padded_code(template.code) + expected = t = None # Translate template records to reals for comparison - else: - relation = field.get_description(self.env).get("relation", "") - if relation: - if ".tax.template" in relation: - t = "tax" - elif ".account.template" in relation: - t = "account" - if t: - find = getattr( - self, - "find_%s%s_by_templates" % ( - "fp_" if ".fiscal.position" in relation - else "", - t)) - if ".fiscal.position" in relation: - # Special case - expected = find(template[key], real[key]) - else: - expected = find(template[key]) + relation = field.get_description(self.env).get("relation", "") + if relation: + if ".tax.template" in relation: + t = "tax" + elif ".account.template" in relation: + t = "account" + if t: + find = getattr( + self, + "find_%s%s_by_templates" % ( + "fp_" if ".fiscal.position" in relation + else "", + t)) + if ".fiscal.position" in relation: + # Special case: if something is returned, then + # there's any difference, so it will get non equal + # when comparing, although we get the warning + # "Comparing apples with oranges" + expected = find(template[key], real[key]) + else: + exp_id = find(template[key]) + expected = self.env[relation[:-9]].browse(exp_id) # Register detected differences try: - if not relation: - if expected is not None and expected != real[key]: + if expected is not None: + if expected != [] and expected != real[key]: result[key] = expected - elif template[key] != real[key]: - result[key] = template[key] - elif expected: - result[key] = expected + elif template[key] != real[key]: + result[key] = template[key] + if isinstance(result.get(key, False), models.Model): + # Avoid to cache recordset references + result[key] = result[key].id except KeyError: pass return result @@ -464,12 +461,10 @@ class WizardUpdateChartsAccounts(models.TransientModel): """Search for, and load, tax templates to create/update/delete.""" found_taxes_ids = [] self.tax_ids.unlink() - # Search for changes between template and real tax for template in self.chart_template_ids.mapped("tax_template_ids"): # Check if the template matches a real tax tax_id = self.find_tax_by_templates(template) - if not tax_id: # Tax to be created self.tax_ids.create({ @@ -480,7 +475,6 @@ class WizardUpdateChartsAccounts(models.TransientModel): }) else: found_taxes_ids.append(tax_id) - # Check the tax for changes tax = self.env['account.tax'].browse(tax_id) notes = self.diff_notes(template, tax) @@ -493,14 +487,13 @@ class WizardUpdateChartsAccounts(models.TransientModel): 'update_tax_id': tax_id, 'notes': notes, }) - # search for taxes not in the template and propose them for # deactivation - taxes_to_delete = self.env['account.tax'].search( + taxes_to_deactivate = self.env['account.tax'].search( [('company_id', '=', self.company_id.id), ("id", "not in", found_taxes_ids), ("active", "=", True)]) - for tax in taxes_to_delete: + for tax in taxes_to_deactivate: self.tax_ids.create({ 'update_chart_wizard_id': self.id, 'type': 'deleted', @@ -512,11 +505,9 @@ class WizardUpdateChartsAccounts(models.TransientModel): def _find_accounts(self): """Load account templates to create/update.""" self.account_ids.unlink() - for template in self.chart_template_ids.mapped("account_ids"): # Search for a real account that matches the template account_id = self.find_account_by_templates(template) - if not account_id: # Account to be created self.account_ids.create({ @@ -581,35 +572,20 @@ class WizardUpdateChartsAccounts(models.TransientModel): # Deactivate tax if wiz_tax.type == 'deleted': tax.active = False - _logger.debug(_("Deactivated tax %s."), tax) + _logger.info(_("Deactivated tax %s."), "'%s'" % tax.name) continue - # Create tax if wiz_tax.type == 'new': - tax = template._generate_tax(self.company_id) - tax = tax['tax_template_to_tax'][template.id] - _logger.debug(_("Created tax %s."), template.name) - + template._generate_tax(self.company_id) + _logger.info(_("Created tax %s."), "'%s'" % template.name) # Update tax else: for key, value in self.diff_fields(template, tax).iteritems(): + # We defer update because account might not be created yet + if key in {'account_id', 'refund_account_id'}: + continue tax[key] = value - _logger.debug(_("Updated tax %s."), template.name) - wiz_tax.update_tax_id = tax - - def _create_account_from_template(self, account_template): - return self.env["account.account"].create({ - 'name': account_template.name, - 'currency_id': account_template.currency_id.id, - 'code': self.padded_code(account_template.code), - 'user_type_id': account_template.user_type_id.id, - 'reconcile': account_template.reconcile, - 'note': account_template.note, - 'tax_ids': [ - (6, 0, [self.find_tax_by_templates(account_template.tax_ids)]), - ], - 'company_id': self.company_id.id, - }) + _logger.info(_("Updated tax %s."), "'%s'" % template.name) @api.multi def _update_accounts(self): @@ -619,18 +595,35 @@ class WizardUpdateChartsAccounts(models.TransientModel): wiz_account.account_id) if wiz_account.type == 'new': # Create the account + tax_template_ref = { + tax.id: self.find_tax_by_templates(tax) for tax in + template.tax_ids + } + vals = self.chart_template_id._get_account_vals( + self.company_id, template, + self.padded_code(template.code), + tax_template_ref, + ) try: with self.env.cr.savepoint(): - account = ( - self._create_account_from_template( - template)) - _logger.debug( + self.chart_template_id.create_record_with_xmlid( + self.company_id, template, 'account.account', vals, + ) + _logger.info( _("Created account %s."), - account.code) - except exceptions.except_orm: - _logger.exception( - _("Exception creating account %s."), - template.code) + "'%s - %s'" % (vals['code'], vals['name']), + ) + except Exception: + self.rejected_new_account_number += 1 + if config['test_enable']: + _logger.info(EXCEPTION_TEXT) + else: # pragma: no cover + _logger.exception( + "ERROR: " + _("Exception creating account %s."), + "'%s - %s'" % (template.code, template.name), + ) + if not self.continue_on_errors: + break else: # Update the account try: @@ -638,15 +631,21 @@ class WizardUpdateChartsAccounts(models.TransientModel): for key, value in (self.diff_fields(template, account) .iteritems()): account[key] = value - _logger.debug(_("Updated account %s."), account) - except exceptions.except_orm: - _logger.exception( - _("Exception writing account %s."), - account) - wiz_account.update_account_id = account - - if self.update_tax: - self._update_taxes_pending_for_accounts() + _logger.info( + _("Updated account %s."), + "'%s - %s'" % (account.code, account.name), + ) + except Exception: + self.rejected_updated_account_number += 1 + if config['test_enable']: + _logger.info(EXCEPTION_TEXT) + else: # pragma: no cover + _logger.exception( + "ERROR: " + _("Exception writing account %s."), + "'%s - %s'" % (account.code, account.name), + ) + if not self.continue_on_errors: + break @api.multi def _update_taxes_pending_for_accounts(self): @@ -657,10 +656,15 @@ class WizardUpdateChartsAccounts(models.TransientModel): for wiz_tax in self.tax_ids: if wiz_tax.type == "deleted" or not wiz_tax.update_tax_id: continue - - for field in ("account_id", "refund_account_id"): - wiz_tax.update_tax_id[field] = ( - self.find_account_by_templates(wiz_tax.tax_id[field])) + template = wiz_tax.tax_id + tax = wiz_tax.update_tax_id + done = False + for key, value in self.diff_fields(template, tax).iteritems(): + if key in {'account_id', 'refund_account_id'}: + tax[key] = value + done = True + if done: + _logger.info(_("Post-updated tax %s."), "'%s'" % tax.name) def _prepare_fp_vals(self, fp_template): # Tax mappings @@ -698,16 +702,17 @@ class WizardUpdateChartsAccounts(models.TransientModel): wiz_fp.fiscal_position_id) if wiz_fp.type == 'new': # Create a new fiscal position - fp = self.env['account.fiscal.position'].create( - self._prepare_fp_vals(template)) + self.chart_template_id.create_record_with_xmlid( + self.company_id, template, 'account.fiscal.position', + self._prepare_fp_vals(template), + ) else: # Update the given fiscal position for key, value in self.diff_fields(template, fp).iteritems(): fp[key] = value - wiz_fp.update_fiscal_position_id = fp - _logger.debug( + _logger.info( _("Created or updated fiscal position %s."), - template.name) + "'%s'" % template.name) class WizardUpdateChartsAccountsTax(models.TransientModel): From 3e7cb7ff48ba4ff6ac420c4ca5fb11380af72ed0 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 21 Sep 2018 01:04:19 +0000 Subject: [PATCH 14/26] [UPD] Update account_chart_update.pot --- .../i18n/account_chart_update.pot | 46 +++++++++++++------ 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/account_chart_update/i18n/account_chart_update.pot b/account_chart_update/i18n/account_chart_update.pot index a9e72ae04..8d1c19cb7 100644 --- a/account_chart_update/i18n/account_chart_update.pot +++ b/account_chart_update/i18n/account_chart_update.pot @@ -85,7 +85,7 @@ msgid "Create/Update" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:625 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:614 #, python-format msgid "Created account %s." msgstr "" @@ -107,19 +107,19 @@ msgid "Created on" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:708 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:715 #, python-format msgid "Created or updated fiscal position %s." msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:587 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:581 #, python-format msgid "Created tax %s." msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:580 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:576 #, python-format msgid "Deactivated tax %s." msgstr "" @@ -135,7 +135,7 @@ msgid "Determines where the tax is selectable. Note : 'None' means a tax can't b 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:451 #, python-format msgid "Differences in these fields: %s." msgstr "" @@ -149,13 +149,13 @@ msgid "Display Name" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:629 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:623 #, python-format msgid "Exception creating account %s." msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:641 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:645 #, python-format msgid "Exception writing account %s." msgstr "" @@ -264,7 +264,7 @@ msgid "Messages and Errors" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:478 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:475 #, python-format msgid "Name or description not found." msgstr "" @@ -297,13 +297,13 @@ msgid "Next" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:524 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:518 #, python-format msgid "No account found with this code." msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:557 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:552 #, python-format msgid "No fiscal position found with this name." msgstr "" @@ -326,7 +326,7 @@ msgid "Notes" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:233 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:246 #, python-format msgid "One or more errors detected!\n" "\n" @@ -338,6 +338,12 @@ msgstr "" msgid "Other options" msgstr "" +#. module: account_chart_update +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:668 +#, python-format +msgid "Post-updated tax %s." +msgstr "" + #. module: account_chart_update #: model:ir.ui.view,arch_db:account_chart_update.view_update_multi_chart msgid "Previous" @@ -348,6 +354,16 @@ msgstr "" msgid "Records to create/update" msgstr "" +#. module: account_chart_update +#: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_rejected_new_account_number +msgid "Rejected new account number" +msgstr "" + +#. module: account_chart_update +#: model:ir.model.fields,field_description:account_chart_update.field_wizard_update_charts_accounts_rejected_updated_account_number +msgid "Rejected updated account number" +msgstr "" + #. module: account_chart_update #: selection:wizard.update.charts.accounts,state:0 msgid "Select records to update" @@ -374,7 +390,7 @@ msgid "Tax Scope" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:458 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:456 #, python-format msgid "Tax is disabled." msgstr "" @@ -411,7 +427,7 @@ 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:506 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:502 #, python-format msgid "To deactivate: not in the template" msgstr "" @@ -461,7 +477,7 @@ msgid "Update taxes" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:638 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:636 #, python-format msgid "Updated account %s." msgstr "" @@ -477,7 +493,7 @@ msgid "Updated fiscal positions" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:593 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:589 #, python-format msgid "Updated tax %s." msgstr "" From dbe93cb86d557a70713542ff7b7a3478854c4156 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 21 Sep 2018 01:04:39 +0000 Subject: [PATCH 15/26] [UPD] Update account_reversal.pot --- account_reversal/i18n/account_reversal.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_reversal/i18n/account_reversal.pot b/account_reversal/i18n/account_reversal.pot index fe7b10d5b..4d3a63b6a 100644 --- a/account_reversal/i18n/account_reversal.pot +++ b/account_reversal/i18n/account_reversal.pot @@ -126,7 +126,7 @@ msgid "Reversal Date" msgstr "" #. module: account_reversal -#: model:ir.model.fields,field_description:account_reversal.field_account_move_reversal_id_4066 +#: model:ir.model.fields,field_description:account_reversal.field_account_move_reversal_id_4068 msgid "Reversal Entry" msgstr "" From fa7303a0fdb007ed42f739d0214c292233015435 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 21 Sep 2018 01:04:39 +0000 Subject: [PATCH 16/26] [UPD] Update account_tag_category.pot --- account_tag_category/i18n/account_tag_category.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_tag_category/i18n/account_tag_category.pot b/account_tag_category/i18n/account_tag_category.pot index c2927d8ff..3438a2797 100644 --- a/account_tag_category/i18n/account_tag_category.pot +++ b/account_tag_category/i18n/account_tag_category.pot @@ -71,7 +71,7 @@ msgstr "" #. module: account_tag_category #: model:ir.model.fields,field_description:account_tag_category.field_account_account_tag_category_color -#: model:ir.model.fields,field_description:account_tag_category.field_account_account_tag_category_color_4085 +#: model:ir.model.fields,field_description:account_tag_category.field_account_account_tag_category_color_4087 msgid "Color Index" msgstr "" From 27a65f78ba9b68f1796df9d850e15eb655c7235c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 21 Sep 2018 23:24:53 +0200 Subject: [PATCH 17/26] [FIX] account_chart_update: Handle updated m2m correctly --- account_chart_update/__manifest__.py | 2 +- .../tests/test_account_chart_update.py | 11 +++++++++++ account_chart_update/wizard/wizard_chart_update.py | 6 ++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/account_chart_update/__manifest__.py b/account_chart_update/__manifest__.py index 872b71007..99dc46bf9 100644 --- a/account_chart_update/__manifest__.py +++ b/account_chart_update/__manifest__.py @@ -8,7 +8,7 @@ { 'name': "Detect changes and update the Account Chart from a template", "summary": "Wizard to update a company's account chart from a template", - 'version': "10.0.2.0.0", + 'version': "10.0.2.0.1", 'author': "Tecnativa, " "BCIM, " "Okia, " diff --git a/account_chart_update/tests/test_account_chart_update.py b/account_chart_update/tests/test_account_chart_update.py index e3b2d0268..6b3a298c8 100644 --- a/account_chart_update/tests/test_account_chart_update.py +++ b/account_chart_update/tests/test_account_chart_update.py @@ -89,6 +89,12 @@ class TestAccountChartUpdate(common.HttpCase): self.tax_group = self.env['account.tax.group'].create({ 'name': 'Test tax group', }) + self.account_tag_1 = self.env['account.account.tag'].create({ + 'name': 'Test account tag 1', + }) + self.account_tag_2 = self.env['account.account.tag'].create({ + 'name': 'Test account tag 2', + }) self.company = self.env['res.company'].create({ 'name': 'Test account_chart_update company', 'currency_id': self.chart_template.currency_id.id, @@ -212,6 +218,9 @@ class TestAccountChartUpdate(common.HttpCase): self.tax_template.tax_group_id = self.tax_group.id self.tax_template.refund_account_id = new_account_tmpl.id self.account_template.name = "Other name" + self.account_template.tag_ids = [ + (6, 0, [self.account_tag_1.id, self.account_tag_2.id]), + ] self.fp_template.note = "Test note" self.fp_template.account_ids.account_dest_id = new_account_tmpl.id self.fp_template.tax_ids.tax_dest_id = self.tax_template.id @@ -237,6 +246,8 @@ class TestAccountChartUpdate(common.HttpCase): self.assertEqual(self.tax.tax_group_id, self.tax_group) self.assertEqual(self.tax.refund_account_id, new_account) self.assertEqual(self.account.name, self.account_template.name) + self.assertIn(self.account_tag_1, self.account.tag_ids) + self.assertIn(self.account_tag_2, self.account.tag_ids) self.assertEqual(self.fp.note, self.fp_template.note) self.assertEqual(self.fp.account_ids.account_dest_id, new_account) self.assertEqual(self.fp.tax_ids.tax_dest_id, self.tax) diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 70a0a7b97..71fb8507c 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -422,8 +422,10 @@ class WizardUpdateChartsAccounts(models.TransientModel): result[key] = expected elif template[key] != real[key]: result[key] = template[key] - if isinstance(result.get(key, False), models.Model): - # Avoid to cache recordset references + # Avoid to cache recordset references + if isinstance(real._fields[key], fields.Many2many): + result[key] = [(6, 0, result[key].ids)] + elif isinstance(real._fields[key], fields.Many2one): result[key] = result[key].id except KeyError: pass From 1a98fbfced2b9eca09b6f84da19a652b37c134b1 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 21 Sep 2018 23:57:51 +0000 Subject: [PATCH 18/26] [UPD] Update account_chart_update.pot --- .../i18n/account_chart_update.pot | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/account_chart_update/i18n/account_chart_update.pot b/account_chart_update/i18n/account_chart_update.pot index 8d1c19cb7..f097021b9 100644 --- a/account_chart_update/i18n/account_chart_update.pot +++ b/account_chart_update/i18n/account_chart_update.pot @@ -85,7 +85,7 @@ msgid "Create/Update" 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:616 #, python-format msgid "Created account %s." msgstr "" @@ -107,19 +107,19 @@ msgid "Created on" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:715 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:717 #, python-format msgid "Created or updated fiscal position %s." msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:581 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:583 #, python-format msgid "Created tax %s." msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:576 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:578 #, python-format msgid "Deactivated tax %s." msgstr "" @@ -135,7 +135,7 @@ msgid "Determines where the tax is selectable. Note : 'None' means a tax can't b msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:451 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:453 #, python-format msgid "Differences in these fields: %s." msgstr "" @@ -149,13 +149,13 @@ msgid "Display Name" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:623 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:625 #, python-format msgid "Exception creating account %s." msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:645 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:647 #, python-format msgid "Exception writing account %s." msgstr "" @@ -264,7 +264,7 @@ msgid "Messages and Errors" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:475 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:477 #, python-format msgid "Name or description not found." msgstr "" @@ -297,13 +297,13 @@ msgid "Next" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:518 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:520 #, python-format msgid "No account found with this code." msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:552 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:554 #, python-format msgid "No fiscal position found with this name." msgstr "" @@ -339,7 +339,7 @@ msgid "Other options" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:668 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:670 #, python-format msgid "Post-updated tax %s." msgstr "" @@ -390,7 +390,7 @@ msgid "Tax Scope" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:456 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:458 #, python-format msgid "Tax is disabled." msgstr "" @@ -427,7 +427,7 @@ 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:502 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:504 #, python-format msgid "To deactivate: not in the template" msgstr "" @@ -477,7 +477,7 @@ msgid "Update taxes" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:636 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:638 #, python-format msgid "Updated account %s." msgstr "" @@ -493,7 +493,7 @@ msgid "Updated fiscal positions" msgstr "" #. module: account_chart_update -#: code:addons/account_chart_update/wizard/wizard_chart_update.py:589 +#: code:addons/account_chart_update/wizard/wizard_chart_update.py:591 #, python-format msgid "Updated tax %s." msgstr "" From 5adcbba6d46e0359d9ae9ef71c8b4f75df8db543 Mon Sep 17 00:00:00 2001 From: OCA Git Bot Date: Sat, 22 Sep 2018 02:32:17 +0200 Subject: [PATCH 19/26] [UPD] addons table in README.md [ci skip] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2064c774c..a9b8a8331 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ addon | version | summary [account_asset_depr_line_cancel](account_asset_depr_line_cancel/) | 10.0.1.0.0 | Assets Management - Cancel button [account_asset_disposal](account_asset_disposal/) | 10.0.2.0.0 | Makes asset close account move automatically [account_balance_line](account_balance_line/) | 10.0.1.0.0 | Display balance totals in move line view -[account_chart_update](account_chart_update/) | 10.0.1.0.2 | Wizard to update a company's account chart from a template +[account_chart_update](account_chart_update/) | 10.0.2.0.1 | Wizard to update a company's account chart from a template [account_check_deposit](account_check_deposit/) | 10.0.1.0.0 | Manage deposit of checks to the bank [account_credit_control](account_credit_control/) | 10.0.1.3.4 | Account Credit Control [account_credit_control_dunning_fees](account_credit_control_dunning_fees/) | 10.0.1.0.0 | Credit control dunning fees From ce9b358cc0f827bd573b7031b43e3af5d9bbdd39 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 22 Sep 2018 12:07:45 +0200 Subject: [PATCH 20/26] [FIX] account_chart_update: Avoid Unicode decode error --- account_chart_update/wizard/wizard_chart_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py index 71fb8507c..114b7dd8d 100644 --- a/account_chart_update/wizard/wizard_chart_update.py +++ b/account_chart_update/wizard/wizard_chart_update.py @@ -226,7 +226,7 @@ class WizardUpdateChartsAccounts(models.TransientModel): perform_rest = True if self.update_account: self._update_accounts() - if (EXCEPTION_TEXT in log_output.getvalue() and + if (EXCEPTION_TEXT in log_output.getvalue().decode('utf-8') and not self.continue_on_errors): # Abort early perform_rest = False # Clear this cache for avoiding incorrect account hits (as it was From 9015eb973669ef2c5e6a2a15c0c27fd0298ef36f Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 17 Sep 2018 19:46:44 +0200 Subject: [PATCH 21/26] [ADD] account_group: Groups for accounts Installation ============ If you have already the chart of accounts loaded on your company, you will need to update it through the module `account_chart_update`. Follow the instructions on that module for that. Configuration ============= To configure account groups, you need to: * Be "Account / Adviser" role. * Go to *Invoicing > Configuration > Accounts Groups*. * Create or modify existing groups. For assigning groups to account templates, you have to: * Set the group on your account chart module or extension. * Or develop/create UI access. When you have groups on your account templates, you can load a chart template for a new company, and they will be transferred to created accounts. Usage ===== For assigning groups to accounts: * Go to *Invoicing > Adviser > Chart of Accounts*. * Edit one account and set "Group" field. --- account_group/README.rst | 115 +++++ account_group/__init__.py | 4 + account_group/__manifest__.py | 22 + account_group/i18n/es.po | 131 +++++ account_group/models/__init__.py | 7 + account_group/models/account_account.py | 30 ++ .../models/account_account_template.py | 14 + .../models/account_chart_template.py | 18 + account_group/models/account_group.py | 74 +++ account_group/readme/CONFIGURE.rst | 13 + account_group/readme/CONTRIBUTORS.rst | 3 + account_group/readme/DESCRIPTION.rst | 4 + account_group/readme/INSTALL.rst | 3 + account_group/readme/ROADMAP.rst | 1 + account_group/readme/USAGE.rst | 4 + account_group/security/ir.model.access.csv | 3 + account_group/static/description/index.html | 464 ++++++++++++++++++ account_group/views/account_account_views.xml | 13 + account_group/views/account_group_views.xml | 66 +++ 19 files changed, 989 insertions(+) create mode 100644 account_group/README.rst create mode 100644 account_group/__init__.py create mode 100644 account_group/__manifest__.py create mode 100644 account_group/i18n/es.po create mode 100644 account_group/models/__init__.py create mode 100644 account_group/models/account_account.py create mode 100644 account_group/models/account_account_template.py create mode 100644 account_group/models/account_chart_template.py create mode 100644 account_group/models/account_group.py create mode 100644 account_group/readme/CONFIGURE.rst create mode 100644 account_group/readme/CONTRIBUTORS.rst create mode 100644 account_group/readme/DESCRIPTION.rst create mode 100644 account_group/readme/INSTALL.rst create mode 100644 account_group/readme/ROADMAP.rst create mode 100644 account_group/readme/USAGE.rst create mode 100644 account_group/security/ir.model.access.csv create mode 100644 account_group/static/description/index.html create mode 100644 account_group/views/account_account_views.xml create mode 100644 account_group/views/account_group_views.xml diff --git a/account_group/README.rst b/account_group/README.rst new file mode 100644 index 000000000..0937ee2e9 --- /dev/null +++ b/account_group/README.rst @@ -0,0 +1,115 @@ +=================== +Groups for accounts +=================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github + :target: https://github.com/OCA/account-financial-tools/tree/10.0/account_group + :alt: OCA/account-financial-tools +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-financial-tools-10-0/account-financial-tools-10-0-account_group + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/92/10.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This modules brings to version 10 the account group feature from v11. + +It also includes a level field for indicating the level depth of the account +group. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +If you have already the chart of accounts loaded on your company, you will +need to update it through the module `account_chart_update`. Follow the +instructions on that module for that. + +Configuration +============= + +To configure account groups, you need to: + +#. Be "Account / Adviser" role. +#. Go to *Invoicing/Accounting > Configuration > Accounting > Accounts Groups*. +#. Create or modify existing groups. + +For assigning groups to account templates, you have to: + +#. Set the group on your account chart module or extension. +#. Or develop/create UI access. + +When you have groups on your account templates, you can load a chart template +for a new company, and they will be transferred to created accounts. + +Usage +===== + +For assigning groups to accounts: + +#. Go to *Invoicing > Adviser > Chart of Accounts*. +#. Edit one account and set "Group" field. + +Known issues / Roadmap +====================== + +* This module shouldn't be migrated to v11, as it's a native feature. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `__: + + * Pedro M. Baeza + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/account-financial-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_group/__init__.py b/account_group/__init__.py new file mode 100644 index 000000000..69f6d6ffd --- /dev/null +++ b/account_group/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/account_group/__manifest__.py b/account_group/__manifest__.py new file mode 100644 index 000000000..4ebac6d93 --- /dev/null +++ b/account_group/__manifest__.py @@ -0,0 +1,22 @@ +# coding: utf-8 +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Groups for accounts", + "summary": "Use v11 account groups feature", + "version": "10.0.1.0.0", + "category": "Accounting", + "website": "https://github.com/OCA/account-financial-tools", + "author": "Tecnativa," + "Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "depends": [ + "account", + ], + "data": [ + "security/ir.model.access.csv", + "views/account_account_views.xml", + "views/account_group_views.xml", + ], +} diff --git a/account_group/i18n/es.po b/account_group/i18n/es.po new file mode 100644 index 000000000..b69852d5c --- /dev/null +++ b/account_group/i18n/es.po @@ -0,0 +1,131 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-09-17 17:46+0000\n" +"PO-Revision-Date: 2018-09-17 17:46+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_group +#: model:ir.model,name:account_group.model_account_account +msgid "Account" +msgstr "Cuenta" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_account_ids +msgid "Accounts" +msgstr "Cuentas" + +#. module: account_group +#: model:ir.ui.view,arch_db:account_group.view_account_group_form +#: model:ir.ui.view,arch_db:account_group.view_account_group_search +#: model:ir.ui.view,arch_db:account_group.view_account_group_tree +msgid "Accounts Group" +msgstr "Grupo de cuentas" + +#. module: account_group +#: model:ir.actions.act_window,name:account_group.action_account_group_tree +#: model:ir.ui.menu,name:account_group.account_group_menu +#: model:ir.ui.view,arch_db:account_group.view_account_group_search +msgid "Accounts Groups" +msgstr "Grupos de cuentas" + +#. module: account_group +#: model:ir.model.fields,help:account_group.field_account_group_account_ids +msgid "Assigned accounts." +msgstr "Cuentas asignadas" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_code_prefix +msgid "Code prefix" +msgstr "Código prefijo" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_create_date +msgid "Created on" +msgstr "Creado el" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_display_name +msgid "Display Name" +msgstr "Nombre a mostrar" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_account_group_id +#: model:ir.model.fields,field_description:account_group.field_account_account_template_group_id +msgid "Group" +msgstr "Grupo" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_id +msgid "ID" +msgstr "ID" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group___last_update +msgid "Last Modified on" +msgstr "Última modificación en" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_write_date +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_parent_left +msgid "Left Parent" +msgstr "Padre izquierdo" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_level +msgid "Level" +msgstr "Nivel" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_name +msgid "Name" +msgstr "Nombre" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_parent_id +msgid "Parent" +msgstr "Padre" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_parent_right +msgid "Right Parent" +msgstr "Padre derecho" + +#. module: account_group +#: model:ir.model,name:account_group.model_account_chart_template +msgid "Templates for Account Chart" +msgstr "Plantillas de plan contable" + +#. module: account_group +#: model:ir.model,name:account_group.model_account_account_template +msgid "Templates for Accounts" +msgstr "Plantillas de cuentas" + +#. module: account_group +#: model:ir.model,name:account_group.model_account_group +msgid "account.group" +msgstr "account.group" diff --git a/account_group/models/__init__.py b/account_group/models/__init__.py new file mode 100644 index 000000000..171e49961 --- /dev/null +++ b/account_group/models/__init__.py @@ -0,0 +1,7 @@ +# coding: utf-8 +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import account_account +from . import account_account_template +from . import account_chart_template +from . import account_group diff --git a/account_group/models/account_account.py b/account_group/models/account_account.py new file mode 100644 index 000000000..627f91517 --- /dev/null +++ b/account_group/models/account_account.py @@ -0,0 +1,30 @@ +# coding: utf-8 +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class AccountAccount(models.Model): + _inherit = "account.account" + + group_id = fields.Many2one( + comodel_name='account.group', + string="Group", + ) + + @api.onchange('code') + def onchange_code(self): + AccountGroup = self.env['account.group'] + group = False + code_prefix = self.code + # find group with longest matching prefix + while code_prefix: + matching_group = AccountGroup.search([ + ('code_prefix', '=', code_prefix), + ], limit=1) + if matching_group: + group = matching_group + break + code_prefix = code_prefix[:-1] + self.group_id = group diff --git a/account_group/models/account_account_template.py b/account_group/models/account_account_template.py new file mode 100644 index 000000000..de4d3c70e --- /dev/null +++ b/account_group/models/account_account_template.py @@ -0,0 +1,14 @@ +# coding: utf-8 +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountAccountTemplate(models.Model): + _inherit = "account.account.template" + + group_id = fields.Many2one( + comodel_name='account.group', + string="Group", + ) diff --git a/account_group/models/account_chart_template.py b/account_group/models/account_chart_template.py new file mode 100644 index 000000000..90ebc94e5 --- /dev/null +++ b/account_group/models/account_chart_template.py @@ -0,0 +1,18 @@ +# coding: utf-8 +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class AccountChartTemplate(models.Model): + _inherit = "account.chart.template" + + def _get_account_vals(self, company, account_template, code_acc, + tax_template_ref): + """Add account group to created accounts.""" + res = super(AccountChartTemplate, self)._get_account_vals( + company, account_template, code_acc, tax_template_ref, + ) + res['group_id'] = account_template.group_id.id + return res diff --git a/account_group/models/account_group.py b/account_group/models/account_group.py new file mode 100644 index 000000000..0190d334e --- /dev/null +++ b/account_group/models/account_group.py @@ -0,0 +1,74 @@ +# coding: utf-8 +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models +from odoo.osv import expression + + +class AccountGroup(models.Model): + _name = 'account.group' + _parent_store = True + _parent_order = 'name' + _order = 'code_prefix' + + parent_id = fields.Many2one( + comodel_name='account.group', + string="Parent", + index=True, + ondelete='cascade', + ) + parent_left = fields.Integer( + string='Left Parent', + index=True, + ) + parent_right = fields.Integer( + string='Right Parent', + index=True, + ) + name = fields.Char( + required=True, + ) + code_prefix = fields.Char() + account_ids = fields.One2many( + comodel_name='account.account', + inverse_name='group_id', + string='Accounts', + help="Assigned accounts.", + ) + level = fields.Integer( + compute='_compute_level', + store=True, + ) + + @api.depends('parent_id') + def _compute_level(self): + for group in self: + level = 1 + parent = group.parent_id + while parent: + level += 1 + parent = parent.parent_id + group.level = level + + def name_get(self): + result = [] + for group in self: + name = group.name + if group.code_prefix: + name = group.code_prefix + ' ' + name + result.append((group.id, name)) + return result + + @api.model + def name_search(self, name='', args=None, operator='ilike', limit=100): + if not args: + args = [] + criteria_operator = ( + ['|'] if operator not in expression.NEGATIVE_TERM_OPERATORS + else ['&', '!'] + ) + domain = criteria_operator + [ + ('code_prefix', '=ilike', name + '%'), ('name', operator, name) + ] + return self.search(domain + args, limit=limit).name_get() diff --git a/account_group/readme/CONFIGURE.rst b/account_group/readme/CONFIGURE.rst new file mode 100644 index 000000000..2d3762fec --- /dev/null +++ b/account_group/readme/CONFIGURE.rst @@ -0,0 +1,13 @@ +To configure account groups, you need to: + +#. Be "Account / Adviser" role. +#. Go to *Invoicing/Accounting > Configuration > Accounting > Accounts Groups*. +#. Create or modify existing groups. + +For assigning groups to account templates, you have to: + +#. Set the group on your account chart module or extension. +#. Or develop/create UI access. + +When you have groups on your account templates, you can load a chart template +for a new company, and they will be transferred to created accounts. diff --git a/account_group/readme/CONTRIBUTORS.rst b/account_group/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..2b13251be --- /dev/null +++ b/account_group/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Tecnativa `__: + + * Pedro M. Baeza diff --git a/account_group/readme/DESCRIPTION.rst b/account_group/readme/DESCRIPTION.rst new file mode 100644 index 000000000..94927a308 --- /dev/null +++ b/account_group/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This modules brings to version 10 the account group feature from v11. + +It also includes a level field for indicating the level depth of the account +group. diff --git a/account_group/readme/INSTALL.rst b/account_group/readme/INSTALL.rst new file mode 100644 index 000000000..9d6703b01 --- /dev/null +++ b/account_group/readme/INSTALL.rst @@ -0,0 +1,3 @@ +If you have already the chart of accounts loaded on your company, you will +need to update it through the module `account_chart_update`. Follow the +instructions on that module for that. diff --git a/account_group/readme/ROADMAP.rst b/account_group/readme/ROADMAP.rst new file mode 100644 index 000000000..8adc36330 --- /dev/null +++ b/account_group/readme/ROADMAP.rst @@ -0,0 +1 @@ +* This module shouldn't be migrated to v11, as it's a native feature. diff --git a/account_group/readme/USAGE.rst b/account_group/readme/USAGE.rst new file mode 100644 index 000000000..e54fe105d --- /dev/null +++ b/account_group/readme/USAGE.rst @@ -0,0 +1,4 @@ +For assigning groups to accounts: + +#. Go to *Invoicing > Adviser > Chart of Accounts*. +#. Edit one account and set "Group" field. diff --git a/account_group/security/ir.model.access.csv b/account_group/security/ir.model.access.csv new file mode 100644 index 000000000..833503320 --- /dev/null +++ b/account_group/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_group_manager,account.group,model_account_group,account.group_account_manager,1,1,1,1 +access_account_group,account.group,model_account_group,account.group_account_user,1,0,0,0 diff --git a/account_group/static/description/index.html b/account_group/static/description/index.html new file mode 100644 index 000000000..635505c11 --- /dev/null +++ b/account_group/static/description/index.html @@ -0,0 +1,464 @@ + + + + + + +Groups for accounts + + + +
+

Groups for accounts

+ + +

Beta License: AGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runbot

+

This modules brings to version 10 the account group feature from v11.

+

It also includes a level field for indicating the level depth of the account +group.

+

Table of contents

+ +
+

Installation

+

If you have already the chart of accounts loaded on your company, you will +need to update it through the module account_chart_update. Follow the +instructions on that module for that.

+
+
+

Configuration

+

To configure account groups, you need to:

+
    +
  1. Be “Account / Adviser” role.
  2. +
  3. Go to Invoicing/Accounting > Configuration > Accounting > Accounts Groups.
  4. +
  5. Create or modify existing groups.
  6. +
+

For assigning groups to account templates, you have to:

+
    +
  1. Set the group on your account chart module or extension.
  2. +
  3. Or develop/create UI access.
  4. +
+

When you have groups on your account templates, you can load a chart template +for a new company, and they will be transferred to created accounts.

+
+
+

Usage

+

For assigning groups to accounts:

+
    +
  1. Go to Invoicing > Adviser > Chart of Accounts.
  2. +
  3. Edit one account and set “Group” field.
  4. +
+
+
+

Known issues / Roadmap

+
    +
  • This module shouldn’t be migrated to v11, as it’s a native feature.
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/account-financial-tools project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_group/views/account_account_views.xml b/account_group/views/account_account_views.xml new file mode 100644 index 000000000..e551bd7ca --- /dev/null +++ b/account_group/views/account_account_views.xml @@ -0,0 +1,13 @@ + + + + account.account + + + + + + + + + diff --git a/account_group/views/account_group_views.xml b/account_group/views/account_group_views.xml new file mode 100644 index 000000000..c4742dad5 --- /dev/null +++ b/account_group/views/account_group_views.xml @@ -0,0 +1,66 @@ + + + + account.group.form + account.group + +
+ + + + + + + + + + +
+
+
+ + + account.group.search + account.group + + + + + + + + + account.group.tree + account.group + + + + + + + + + + + Accounts Groups + account.group + form + tree,form + + + + + +
From bcfc42129623a7f798b634f7133ab9aad25d3026 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Thu, 27 Sep 2018 10:16:58 +0000 Subject: [PATCH 22/26] [UPD] Update account_group.pot --- account_group/i18n/account_group.pot | 130 +++++++++++++++++++++++++++ account_group/i18n/es.po | 3 +- 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 account_group/i18n/account_group.pot diff --git a/account_group/i18n/account_group.pot b/account_group/i18n/account_group.pot new file mode 100644 index 000000000..6b932aaaf --- /dev/null +++ b/account_group/i18n/account_group.pot @@ -0,0 +1,130 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_group +#: model:ir.model,name:account_group.model_account_account +msgid "Account" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_account_ids +msgid "Accounts" +msgstr "" + +#. module: account_group +#: model:ir.ui.view,arch_db:account_group.view_account_group_form +#: model:ir.ui.view,arch_db:account_group.view_account_group_search +#: model:ir.ui.view,arch_db:account_group.view_account_group_tree +msgid "Accounts Group" +msgstr "" + +#. module: account_group +#: model:ir.actions.act_window,name:account_group.action_account_group_tree +#: model:ir.ui.menu,name:account_group.account_group_menu +#: model:ir.ui.view,arch_db:account_group.view_account_group_search +msgid "Accounts Groups" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,help:account_group.field_account_group_account_ids +msgid "Assigned accounts." +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_code_prefix +msgid "Code prefix" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_create_uid +msgid "Created by" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_create_date +msgid "Created on" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_display_name +msgid "Display Name" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_account_group_id +#: model:ir.model.fields,field_description:account_group.field_account_account_template_group_id +msgid "Group" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_id +msgid "ID" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group___last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_parent_left +msgid "Left Parent" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_level +msgid "Level" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_name +msgid "Name" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_parent_id +msgid "Parent" +msgstr "" + +#. module: account_group +#: model:ir.model.fields,field_description:account_group.field_account_group_parent_right +msgid "Right Parent" +msgstr "" + +#. module: account_group +#: model:ir.model,name:account_group.model_account_chart_template +msgid "Templates for Account Chart" +msgstr "" + +#. module: account_group +#: model:ir.model,name:account_group.model_account_account_template +msgid "Templates for Accounts" +msgstr "" + +#. module: account_group +#: model:ir.model,name:account_group.model_account_group +msgid "account.group" +msgstr "" + diff --git a/account_group/i18n/es.po b/account_group/i18n/es.po index b69852d5c..9ab2e3f8c 100644 --- a/account_group/i18n/es.po +++ b/account_group/i18n/es.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_group +# * account_group # msgid "" msgstr "" @@ -10,6 +10,7 @@ msgstr "" "PO-Revision-Date: 2018-09-17 17:46+0000\n" "Last-Translator: <>\n" "Language-Team: \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" From b8681aab79d9bd39c1619fbae99a0af1b3edfa21 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Thu, 27 Sep 2018 10:17:14 +0000 Subject: [PATCH 23/26] [UPD] Update account_reversal.pot --- account_reversal/i18n/account_reversal.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_reversal/i18n/account_reversal.pot b/account_reversal/i18n/account_reversal.pot index 4d3a63b6a..f988dff9a 100644 --- a/account_reversal/i18n/account_reversal.pot +++ b/account_reversal/i18n/account_reversal.pot @@ -126,7 +126,7 @@ msgid "Reversal Date" msgstr "" #. module: account_reversal -#: model:ir.model.fields,field_description:account_reversal.field_account_move_reversal_id_4068 +#: model:ir.model.fields,field_description:account_reversal.field_account_move_reversal_id_4084 msgid "Reversal Entry" msgstr "" From 9a564717bbab0fce5f28748d519afa98d2e383ea Mon Sep 17 00:00:00 2001 From: oca-travis Date: Thu, 27 Sep 2018 10:17:15 +0000 Subject: [PATCH 24/26] [UPD] Update account_tag_category.pot --- account_tag_category/i18n/account_tag_category.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_tag_category/i18n/account_tag_category.pot b/account_tag_category/i18n/account_tag_category.pot index 3438a2797..8743bdbee 100644 --- a/account_tag_category/i18n/account_tag_category.pot +++ b/account_tag_category/i18n/account_tag_category.pot @@ -71,7 +71,7 @@ msgstr "" #. module: account_tag_category #: model:ir.model.fields,field_description:account_tag_category.field_account_account_tag_category_color -#: model:ir.model.fields,field_description:account_tag_category.field_account_account_tag_category_color_4087 +#: model:ir.model.fields,field_description:account_tag_category.field_account_account_tag_category_color_4103 msgid "Color Index" msgstr "" From 1bbc28c2383685256c3e5eaf24e4be61eefac291 Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Fri, 28 Sep 2018 12:24:01 +0200 Subject: [PATCH 25/26] Fix compute methods dependencies and small optimizations --- .../models/account_asset.py | 38 ++++++++++--------- .../models/account_asset_line.py | 2 +- .../models/account_asset_profile.py | 3 +- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/account_asset_management/models/account_asset.py b/account_asset_management/models/account_asset.py index edff03f2d..d13df42f8 100644 --- a/account_asset_management/models/account_asset.py +++ b/account_asset_management/models/account_asset.py @@ -34,7 +34,7 @@ class AccountAsset(models.Model): inverse_name='asset_id', string='Entries', readonly=True, copy=False) move_line_check = fields.Boolean( - compute='_compute_move_line_check', type='boolean', + compute='_compute_move_line_check', string='Has accounting entries') name = fields.Char( string='Asset Name', size=64, required=True, @@ -93,7 +93,6 @@ class AccountAsset(models.Model): date_start = fields.Date( string='Asset Start Date', readonly=True, states={'draft': [('readonly', False)]}, - default=fields.Datetime.now, help="You should manually add depreciation lines " "with the depreciations of previous fiscal years " "if the Depreciation Start Date is different from the date " @@ -119,8 +118,8 @@ class AccountAsset(models.Model): comodel_name='res.partner', string='Partner', readonly=True, states={'draft': [('readonly', False)]}) method = fields.Selection( - selection=lambda self: self.env['account.asset.profile']. - _selection_method(), + selection=lambda self: self.env[ + 'account.asset.profile']._selection_method(), string='Computation Method', required=True, readonly=True, states={'draft': [('readonly', False)]}, default='linear', @@ -138,8 +137,9 @@ class AccountAsset(models.Model): states={'draft': [('readonly', False)]}, default=5, help="The number of years needed to depreciate your asset") method_period = fields.Selection( - selection=lambda self: self.env['account.asset.profile']. - _selection_method_period(), string='Period Length', + selection=lambda self: self.env[ + 'account.asset.profile']._selection_method_period(), + string='Period Length', required=True, readonly=True, states={'draft': [('readonly', False)]}, default='year', help="Period length for the depreciation accounting entries") @@ -150,8 +150,9 @@ class AccountAsset(models.Model): string='Degressive Factor', readonly=True, states={'draft': [('readonly', False)]}, default=0.3) method_time = fields.Selection( - selection=lambda self: self.env['account.asset.profile']. - _selection_method_time(), string='Time Method', + selection=lambda self: self.env[ + 'account.asset.profile']._selection_method_time(), + string='Time Method', required=True, readonly=True, states={'draft': [('readonly', False)]}, default='year', help="Choose the method to use to compute the dates and " @@ -197,8 +198,7 @@ class AccountAsset(models.Model): @api.model def _default_company_id(self): - return self.env[ - 'res.company']._company_default_get('account.asset') + return self.env['res.company']._company_default_get('account.asset') @api.multi def _compute_move_line_check(self): @@ -221,11 +221,12 @@ class AccountAsset(models.Model): asset.purchase_value - asset.salvage_value @api.multi - @api.depends('depreciation_base', + @api.depends('type', 'depreciation_base', + 'depreciation_line_ids.type', 'depreciation_line_ids.amount', 'depreciation_line_ids.previous_id', 'depreciation_line_ids.init_entry', - 'depreciation_line_ids.move_id') + 'depreciation_line_ids.move_check',) def _compute_depreciation(self): for asset in self: if asset.type == 'normal': @@ -250,7 +251,7 @@ class AccountAsset(models.Model): return res @api.multi - @api.constrains('method') + @api.constrains('method', 'method_time') def _check_method(self): for asset in self: if asset.method == 'degr-linear' and asset.method_time != 'year': @@ -259,7 +260,7 @@ class AccountAsset(models.Model): "Year.")) @api.multi - @api.constrains('date_start', 'method_end') + @api.constrains('date_start', 'method_end', 'method_time') def _check_dates(self): for asset in self: if asset.method_time == 'end': @@ -267,7 +268,8 @@ class AccountAsset(models.Model): raise UserError( _("The Start Date must precede the Ending Date.")) - @api.onchange('purchase_value', 'salvage_value', 'date_start', 'method') + @api.onchange('purchase_value', 'salvage_value', 'date_start', 'method', + 'depreciation_line_ids.type') def _onchange_purchase_salvage_value(self): if self.method in ['linear-limit', 'degr-limit']: self.depreciation_base = self.purchase_value or 0.0 @@ -334,9 +336,9 @@ class AccountAsset(models.Model): if vals.get('method_time'): if vals['method_time'] != 'year' and not vals.get('prorata'): vals['prorata'] = True + super(AccountAsset, self).write(vals) for asset in self: asset_type = vals.get('type') or asset.type - super(AccountAsset, self).write(vals) if asset_type == 'view' or \ self._context.get('asset_validate_from_write'): continue @@ -479,7 +481,7 @@ class AccountAsset(models.Model): '|', ('move_check', '=', True), ('init_entry', '=', True)] posted_lines = line_obj.search( domain, order='line_date desc') - if (len(posted_lines) > 0): + if posted_lines: last_line = posted_lines[0] else: last_line = line_obj @@ -521,7 +523,7 @@ class AccountAsset(models.Model): # check table with posted entries and # recompute in case of deviation depreciated_value_posted = depreciated_value = 0.0 - if (len(posted_lines) > 0): + if posted_lines: last_depreciation_date = datetime.strptime( last_line.line_date, '%Y-%m-%d') last_date_in_table = table[-1]['lines'][-1]['date'] diff --git a/account_asset_management/models/account_asset_line.py b/account_asset_management/models/account_asset_line.py index 6a62db6b3..5b03760ab 100644 --- a/account_asset_management/models/account_asset_line.py +++ b/account_asset_management/models/account_asset_line.py @@ -65,7 +65,7 @@ class AccountAssetLine(models.Model): help="Set this flag for entries of previous fiscal years " "for which OpenERP has not generated accounting entries.") - @api.depends('amount', 'previous_id') + @api.depends('amount', 'previous_id', 'type') @api.multi def _compute_values(self): dlines = self diff --git a/account_asset_management/models/account_asset_profile.py b/account_asset_management/models/account_asset_profile.py index a568e053d..aaf5e54de 100644 --- a/account_asset_management/models/account_asset_profile.py +++ b/account_asset_management/models/account_asset_profile.py @@ -109,8 +109,7 @@ class AccountAssetProfile(models.Model): @api.model def _default_company_id(self): - return self.env[ - 'res.company']._company_default_get('account.asset') + return self.env['res.company']._company_default_get('account.asset') @api.model def _selection_method(self): From 79db2400ab98a3f0677d9ee5401dfd0a00d70370 Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Mon, 1 Oct 2018 10:11:42 +0200 Subject: [PATCH 26/26] Rename demo file to test and move it into the right folder --- .../account_asset_test_data.xml} | 0 .../tests/test_account_asset_management.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename account_asset_management/{demo/account_asset_demo.xml => tests/account_asset_test_data.xml} (100%) diff --git a/account_asset_management/demo/account_asset_demo.xml b/account_asset_management/tests/account_asset_test_data.xml similarity index 100% rename from account_asset_management/demo/account_asset_demo.xml rename to account_asset_management/tests/account_asset_test_data.xml diff --git a/account_asset_management/tests/test_account_asset_management.py b/account_asset_management/tests/test_account_asset_management.py index 982fb0d22..5517b248c 100644 --- a/account_asset_management/tests/test_account_asset_management.py +++ b/account_asset_management/tests/test_account_asset_management.py @@ -24,8 +24,8 @@ class TestAssetManagement(common.TransactionCase): super(TestAssetManagement, self).setUp() self._load('account', 'test', 'account_minimal_test.xml') - self._load('account_asset_management', 'demo', - 'account_asset_demo.xml') + self._load('account_asset_management', 'tests', + 'account_asset_test_data.xml') # ENVIRONEMENTS self.asset_model = self.env['account.asset']