From 40e8075d1435716740bbd5f55558321db872f134 Mon Sep 17 00:00:00 2001 From: Vincent Van Rossem Date: Mon, 28 Sep 2020 09:54:42 +0200 Subject: [PATCH 1/3] [IMP] beesdoo_account: .po files (fr, fr_BE, fr_CH) --- beesdoo_account/i18n/fr.po | 67 +++++++++++++++++++++++++++++++++++ beesdoo_account/i18n/fr_BE.po | 67 +++++++++++++++++++++++++++++++++++ beesdoo_account/i18n/fr_CH.po | 67 +++++++++++++++++++++++++++++++++++ 3 files changed, 201 insertions(+) create mode 100644 beesdoo_account/i18n/fr.po create mode 100644 beesdoo_account/i18n/fr_BE.po create mode 100644 beesdoo_account/i18n/fr_CH.po diff --git a/beesdoo_account/i18n/fr.po b/beesdoo_account/i18n/fr.po new file mode 100644 index 0000000..352d5ed --- /dev/null +++ b/beesdoo_account/i18n/fr.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * beesdoo_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-28 07:45+0000\n" +"PO-Revision-Date: 2020-09-28 07:45+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: beesdoo_account +#: model:ir.model.fields,field_description:beesdoo_account.field_res_config_settings__group_validate_invoice_negative_total_amount +msgid "Allow validating an invoice with a negative total amount" +msgstr "Autoriser la validation d'une facture avec un montant total négatif" + +#. module: beesdoo_account +#: model:ir.model.fields,help:beesdoo_account.field_res_config_settings__group_validate_invoice_negative_total_amount +msgid "Allows you to validate an invoice with a negative total amount" +msgstr "Permet de valider une facture avec un montant total négatif" + +#. module: beesdoo_account +#: model:ir.model,name:beesdoo_account.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres de configuration" + +#. module: beesdoo_account +#: model:ir.model,name:beesdoo_account.model_account_invoice +msgid "Invoice" +msgstr "Facture" + +#. module: beesdoo_account +#: code:addons/beesdoo_account/models/account_invoice.py:28 +#, python-format +msgid "Invoice must be in draft state in order to validate it." +msgstr "Pour pouvoir être validée, la facture doit être à l'état de brouillon." + +#. module: beesdoo_account +#: code:addons/beesdoo_account/models/account_invoice.py:32 +#, python-format +msgid "" +"No account was found to create the invoice, be sure you have installed a " +"chart of account." +msgstr "" +"Aucun compte n'a été trouvé pour créer la facture, vérifiez que vous avez " +"bien installé un plan comptable." + +#. module: beesdoo_account +#: code:addons/beesdoo_account/models/account_invoice.py:22 +#, python-format +msgid "" +"The field Vendor is required, please complete it to validate the Vendor " +"Bill." +msgstr "" +"Le champ Vendeur est requis, veuillez le compléter pour valider cette " +"facture d'achat." + +#. module: beesdoo_account +#: model:res.groups,name:beesdoo_account.group_validate_invoice_negative_total_amount +msgid "Validate an invoice with a negative total amount" +msgstr "Valider une facture avec un montant total négatif" diff --git a/beesdoo_account/i18n/fr_BE.po b/beesdoo_account/i18n/fr_BE.po new file mode 100644 index 0000000..352d5ed --- /dev/null +++ b/beesdoo_account/i18n/fr_BE.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * beesdoo_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-28 07:45+0000\n" +"PO-Revision-Date: 2020-09-28 07:45+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: beesdoo_account +#: model:ir.model.fields,field_description:beesdoo_account.field_res_config_settings__group_validate_invoice_negative_total_amount +msgid "Allow validating an invoice with a negative total amount" +msgstr "Autoriser la validation d'une facture avec un montant total négatif" + +#. module: beesdoo_account +#: model:ir.model.fields,help:beesdoo_account.field_res_config_settings__group_validate_invoice_negative_total_amount +msgid "Allows you to validate an invoice with a negative total amount" +msgstr "Permet de valider une facture avec un montant total négatif" + +#. module: beesdoo_account +#: model:ir.model,name:beesdoo_account.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres de configuration" + +#. module: beesdoo_account +#: model:ir.model,name:beesdoo_account.model_account_invoice +msgid "Invoice" +msgstr "Facture" + +#. module: beesdoo_account +#: code:addons/beesdoo_account/models/account_invoice.py:28 +#, python-format +msgid "Invoice must be in draft state in order to validate it." +msgstr "Pour pouvoir être validée, la facture doit être à l'état de brouillon." + +#. module: beesdoo_account +#: code:addons/beesdoo_account/models/account_invoice.py:32 +#, python-format +msgid "" +"No account was found to create the invoice, be sure you have installed a " +"chart of account." +msgstr "" +"Aucun compte n'a été trouvé pour créer la facture, vérifiez que vous avez " +"bien installé un plan comptable." + +#. module: beesdoo_account +#: code:addons/beesdoo_account/models/account_invoice.py:22 +#, python-format +msgid "" +"The field Vendor is required, please complete it to validate the Vendor " +"Bill." +msgstr "" +"Le champ Vendeur est requis, veuillez le compléter pour valider cette " +"facture d'achat." + +#. module: beesdoo_account +#: model:res.groups,name:beesdoo_account.group_validate_invoice_negative_total_amount +msgid "Validate an invoice with a negative total amount" +msgstr "Valider une facture avec un montant total négatif" diff --git a/beesdoo_account/i18n/fr_CH.po b/beesdoo_account/i18n/fr_CH.po new file mode 100644 index 0000000..352d5ed --- /dev/null +++ b/beesdoo_account/i18n/fr_CH.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * beesdoo_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-28 07:45+0000\n" +"PO-Revision-Date: 2020-09-28 07:45+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: beesdoo_account +#: model:ir.model.fields,field_description:beesdoo_account.field_res_config_settings__group_validate_invoice_negative_total_amount +msgid "Allow validating an invoice with a negative total amount" +msgstr "Autoriser la validation d'une facture avec un montant total négatif" + +#. module: beesdoo_account +#: model:ir.model.fields,help:beesdoo_account.field_res_config_settings__group_validate_invoice_negative_total_amount +msgid "Allows you to validate an invoice with a negative total amount" +msgstr "Permet de valider une facture avec un montant total négatif" + +#. module: beesdoo_account +#: model:ir.model,name:beesdoo_account.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres de configuration" + +#. module: beesdoo_account +#: model:ir.model,name:beesdoo_account.model_account_invoice +msgid "Invoice" +msgstr "Facture" + +#. module: beesdoo_account +#: code:addons/beesdoo_account/models/account_invoice.py:28 +#, python-format +msgid "Invoice must be in draft state in order to validate it." +msgstr "Pour pouvoir être validée, la facture doit être à l'état de brouillon." + +#. module: beesdoo_account +#: code:addons/beesdoo_account/models/account_invoice.py:32 +#, python-format +msgid "" +"No account was found to create the invoice, be sure you have installed a " +"chart of account." +msgstr "" +"Aucun compte n'a été trouvé pour créer la facture, vérifiez que vous avez " +"bien installé un plan comptable." + +#. module: beesdoo_account +#: code:addons/beesdoo_account/models/account_invoice.py:22 +#, python-format +msgid "" +"The field Vendor is required, please complete it to validate the Vendor " +"Bill." +msgstr "" +"Le champ Vendeur est requis, veuillez le compléter pour valider cette " +"facture d'achat." + +#. module: beesdoo_account +#: model:res.groups,name:beesdoo_account.group_validate_invoice_negative_total_amount +msgid "Validate an invoice with a negative total amount" +msgstr "Valider une facture avec un montant total négatif" From 4fc321373af54418a166cd1a36b1fc89ce06d4aa Mon Sep 17 00:00:00 2001 From: Vincent Van Rossem Date: Mon, 28 Sep 2020 09:58:21 +0200 Subject: [PATCH 2/3] [IMP] beesdoo_account: better description in DESCRIPTION.rst --- beesdoo_account/readme/DESCRIPTION.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beesdoo_account/readme/DESCRIPTION.rst b/beesdoo_account/readme/DESCRIPTION.rst index 93177b7..880f2f1 100644 --- a/beesdoo_account/readme/DESCRIPTION.rst +++ b/beesdoo_account/readme/DESCRIPTION.rst @@ -1 +1,2 @@ -Module that customize account module for Beescoop. +- Makes date_invoice field required in account.invoice_form and account.invoice_supplier_form +- Allow validating an invoice with a negative total amount From 80d617876c222e5496f2fdbe492d33637c5f1884 Mon Sep 17 00:00:00 2001 From: Vincent Van Rossem Date: Mon, 28 Sep 2020 10:17:17 +0200 Subject: [PATCH 3/3] [IMP] beesdoo_account: check if user has group AND amount is < 0 --- beesdoo_account/models/account_invoice.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/beesdoo_account/models/account_invoice.py b/beesdoo_account/models/account_invoice.py index 886cfa5..237fc00 100644 --- a/beesdoo_account/models/account_invoice.py +++ b/beesdoo_account/models/account_invoice.py @@ -1,4 +1,5 @@ from odoo import api, fields, models, _ +from odoo.tools import float_compare from odoo.exceptions import UserError @@ -7,16 +8,23 @@ class AccountInvoice(models.Model): @api.multi def action_invoice_open(self): + to_open_invoices = self.filtered(lambda inv: inv.state != "open") if self.user_has_groups( "beesdoo_account." "group_validate_invoice_negative_total_amount" + ) and to_open_invoices.filtered( + lambda inv: float_compare( + inv.amount_total, + 0.0, + precision_rounding=inv.currency_id.rounding, + ) + == -1 ): - return self.action_invoice_negative_amount_open() + return self.action_invoice_negative_amount_open(to_open_invoices) return super(AccountInvoice, self).action_invoice_open() @api.multi - def action_invoice_negative_amount_open(self): - """Identical to action_invoice_open without UserError on an invoice with a negative total amount""" - to_open_invoices = self.filtered(lambda inv: inv.state != "open") + def action_invoice_negative_amount_open(self, to_open_invoices): + """Similar to action_invoice_open without UserError on an invoice with a negative total amount""" if to_open_invoices.filtered(lambda inv: not inv.partner_id): raise UserError( _(