From 014590a005b87e5e9602b653f8282815e85e136b Mon Sep 17 00:00:00 2001 From: hupo-odoo Date: Fri, 13 Jan 2023 11:09:20 +0000 Subject: [PATCH] [IMP] l10n_{dz,in,ua,ma}: invoice amount in words As it is now possible to activate the total amount of an invoice in letters, these localizations (dz,in,ua,ma) need by default the feature to be activated. In addition, some of them had aleady such feature which has therefore been removed to accommodate the new generic feature. The indian localization also has a different message on the right side of QR code on invoices closes odoo/odoo#107714 Task: 3097097 Pr: 107714 Related: odoo/enterprise#35959 Signed-off-by: Florian Gilbert (flg) --- addons/l10n_dz/__manifest__.py | 4 ++- addons/l10n_dz/demo/demo_company.xml | 34 ++++++++++++++++++ addons/l10n_dz/i18n/ar.po | 35 ------------------- addons/l10n_dz/i18n/fr.po | 35 ------------------- addons/l10n_dz/i18n/l10n_dz.pot | 35 ------------------- addons/l10n_dz/models/__init__.py | 2 +- addons/l10n_dz/models/account_move.py | 12 ------- addons/l10n_dz/models/company.py | 13 +++++++ addons/l10n_dz/report/account_move_report.xml | 12 ------- addons/l10n_in/models/__init__.py | 1 + addons/l10n_in/models/account_invoice.py | 1 - addons/l10n_in/models/company.py | 13 +++++++ .../static/src/img/Google_Pay-Logo.svg | 1 + addons/l10n_in/static/src/img/Paytm-Logo.svg | 1 + .../l10n_in/static/src/img/PhonePe-Logo.svg | 1 + addons/l10n_in/static/src/img/Upi-logo.svg | 1 + addons/l10n_in/views/report_invoice.xml | 30 +++++++++++----- addons/l10n_ma/__init__.py | 1 + addons/l10n_ma/__manifest__.py | 3 ++ addons/l10n_ma/demo/demo_company.xml | 34 ++++++++++++++++++ addons/l10n_ma/models/__init__.py | 1 + addons/l10n_ma/models/company.py | 13 +++++++ addons/l10n_ua/__init__.py | 1 + addons/l10n_ua/models/__init__.py | 1 + addons/l10n_ua/models/company.py | 13 +++++++ 25 files changed, 158 insertions(+), 140 deletions(-) create mode 100644 addons/l10n_dz/demo/demo_company.xml delete mode 100644 addons/l10n_dz/i18n/ar.po delete mode 100644 addons/l10n_dz/i18n/fr.po delete mode 100644 addons/l10n_dz/i18n/l10n_dz.pot delete mode 100644 addons/l10n_dz/models/account_move.py create mode 100644 addons/l10n_dz/models/company.py delete mode 100644 addons/l10n_dz/report/account_move_report.xml create mode 100644 addons/l10n_in/models/company.py create mode 100644 addons/l10n_in/static/src/img/Google_Pay-Logo.svg create mode 100644 addons/l10n_in/static/src/img/Paytm-Logo.svg create mode 100644 addons/l10n_in/static/src/img/PhonePe-Logo.svg create mode 100644 addons/l10n_in/static/src/img/Upi-logo.svg create mode 100644 addons/l10n_ma/demo/demo_company.xml create mode 100644 addons/l10n_ma/models/__init__.py create mode 100644 addons/l10n_ma/models/company.py create mode 100644 addons/l10n_ua/models/__init__.py create mode 100644 addons/l10n_ua/models/company.py diff --git a/addons/l10n_dz/__manifest__.py b/addons/l10n_dz/__manifest__.py index 0d971d20e23..72a945f8974 100755 --- a/addons/l10n_dz/__manifest__.py +++ b/addons/l10n_dz/__manifest__.py @@ -19,7 +19,9 @@ This module applies to companies based in Algeria. 'data/account_tax_data.xml', 'data/account_fiscal_position_template_data.xml', 'data/account_chart_template_configuration_data.xml', - 'report/account_move_report.xml', + ], + 'demo': [ + 'demo/demo_company.xml', ], 'license': 'LGPL-3', } diff --git a/addons/l10n_dz/demo/demo_company.xml b/addons/l10n_dz/demo/demo_company.xml new file mode 100644 index 00000000000..982cd16cd90 --- /dev/null +++ b/addons/l10n_dz/demo/demo_company.xml @@ -0,0 +1,34 @@ + + + + DZ Company + 3233 Green Acres Road + Unit 07 + Algier + 1000 + + +04334934343 + info@company.algerianbestcompany.com + www.algerianbestcompany.com + 12312312312 + + + + DZ Company + + + + + + + + + + + + + + + + + diff --git a/addons/l10n_dz/i18n/ar.po b/addons/l10n_dz/i18n/ar.po deleted file mode 100644 index 50c9b628131..00000000000 --- a/addons/l10n_dz/i18n/ar.po +++ /dev/null @@ -1,35 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * l10n_dz -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 14.0+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-29 13:57+0000\n" -"PO-Revision-Date: 2022-11-29 13:57+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: l10n_dz -#: model_terms:ir.ui.view,arch_db:l10n_dz.invoice_report_amount_in_words_inherit -msgid "Arranged the present invoice in the amount of :" -msgstr "رتبت هذه الفاتورة بمبلغ: " - -#. module: l10n_dz -#: model:ir.model.fields,field_description:l10n_dz.field_account_bank_statement_line__amount_sentence -#: model:ir.model.fields,field_description:l10n_dz.field_account_move__amount_sentence -#: model:ir.model.fields,field_description:l10n_dz.field_account_payment__amount_sentence -msgid "Arranged the present invoice in the amount of : " -msgstr "رتبت هذه الفاتورة بمبلغ: " - -#. module: l10n_dz -#: model:ir.model.fields,help:l10n_dz.field_account_bank_statement_line__amount_sentence -#: model:ir.model.fields,help:l10n_dz.field_account_move__amount_sentence -#: model:ir.model.fields,help:l10n_dz.field_account_payment__amount_sentence -msgid "The amount is automatically generated by the software" -msgstr "يتم إنشاء المبلغ تلقائيًا بواسطة البرنامج" diff --git a/addons/l10n_dz/i18n/fr.po b/addons/l10n_dz/i18n/fr.po deleted file mode 100644 index ad22047c9db..00000000000 --- a/addons/l10n_dz/i18n/fr.po +++ /dev/null @@ -1,35 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * l10n_dz -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 14.0+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-29 13:57+0000\n" -"PO-Revision-Date: 2022-11-29 13:57+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: l10n_dz -#: model_terms:ir.ui.view,arch_db:l10n_dz.invoice_report_amount_in_words_inherit -msgid "Arranged the present invoice in the amount of :" -msgstr "Arrêtée la présente facture à la somme de : " - -#. module: l10n_dz -#: model:ir.model.fields,field_description:l10n_dz.field_account_bank_statement_line__amount_sentence -#: model:ir.model.fields,field_description:l10n_dz.field_account_move__amount_sentence -#: model:ir.model.fields,field_description:l10n_dz.field_account_payment__amount_sentence -msgid "Arranged the present invoice in the amount of : " -msgstr "Arrêtée la présente facture à la somme de : " - -#. module: l10n_dz -#: model:ir.model.fields,help:l10n_dz.field_account_bank_statement_line__amount_sentence -#: model:ir.model.fields,help:l10n_dz.field_account_move__amount_sentence -#: model:ir.model.fields,help:l10n_dz.field_account_payment__amount_sentence -msgid "The amount is automatically generated by the software" -msgstr "Le montant est automatiquement généré par le programme" diff --git a/addons/l10n_dz/i18n/l10n_dz.pot b/addons/l10n_dz/i18n/l10n_dz.pot deleted file mode 100644 index 18f788471e9..00000000000 --- a/addons/l10n_dz/i18n/l10n_dz.pot +++ /dev/null @@ -1,35 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * l10n_dz -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 14.0+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-29 14:39+0000\n" -"PO-Revision-Date: 2022-11-29 14:39+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: l10n_dz -#: model_terms:ir.ui.view,arch_db:l10n_dz.invoice_report_amount_in_words_inherit -msgid "Arranged the present invoice in the amount of :" -msgstr "" - -#. module: l10n_dz -#: model:ir.model.fields,field_description:l10n_dz.field_account_bank_statement_line__amount_sentence -#: model:ir.model.fields,field_description:l10n_dz.field_account_move__amount_sentence -#: model:ir.model.fields,field_description:l10n_dz.field_account_payment__amount_sentence -msgid "Arranged the present invoice in the amount of : " -msgstr "" - -#. module: l10n_dz -#: model:ir.model.fields,help:l10n_dz.field_account_bank_statement_line__amount_sentence -#: model:ir.model.fields,help:l10n_dz.field_account_move__amount_sentence -#: model:ir.model.fields,help:l10n_dz.field_account_payment__amount_sentence -msgid "The amount is automatically generated by the software" -msgstr "" diff --git a/addons/l10n_dz/models/__init__.py b/addons/l10n_dz/models/__init__.py index 9c0a4213854..52e1016126a 100644 --- a/addons/l10n_dz/models/__init__.py +++ b/addons/l10n_dz/models/__init__.py @@ -1 +1 @@ -from . import account_move +from . import company diff --git a/addons/l10n_dz/models/account_move.py b/addons/l10n_dz/models/account_move.py deleted file mode 100644 index 7bae428cd33..00000000000 --- a/addons/l10n_dz/models/account_move.py +++ /dev/null @@ -1,12 +0,0 @@ -from odoo import api, models, fields - - -class AccountMove(models.Model): - _inherit = 'account.move' - - amount_total_words = fields.Char("Amount total in words", compute="_compute_amount_total_words") - - @api.depends('amount_total', 'currency_id') - def _compute_amount_total_words(self): - for record in self: - record.amount_total_words = record.currency_id.amount_to_text(record.amount_total) diff --git a/addons/l10n_dz/models/company.py b/addons/l10n_dz/models/company.py new file mode 100644 index 00000000000..6047cda956e --- /dev/null +++ b/addons/l10n_dz/models/company.py @@ -0,0 +1,13 @@ +from odoo import api, models + + +class ResCompany(models.Model): + _inherit = 'res.company' + + @api.model_create_multi + def create(self, vals_list): + companies = super().create(vals_list) + for company in companies: + if company.account_fiscal_country_id.code == 'DZ': + company.display_invoice_amount_total_words = True + return companies diff --git a/addons/l10n_dz/report/account_move_report.xml b/addons/l10n_dz/report/account_move_report.xml deleted file mode 100644 index 42e9357f445..00000000000 --- a/addons/l10n_dz/report/account_move_report.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/addons/l10n_in/models/__init__.py b/addons/l10n_in/models/__init__.py index 2f479b39847..6a760de9faa 100644 --- a/addons/l10n_in/models/__init__.py +++ b/addons/l10n_in/models/__init__.py @@ -4,6 +4,7 @@ from . import account from . import account_invoice from . import chart_template +from . import company from . import product_template from . import port_code from . import res_config_settings diff --git a/addons/l10n_in/models/account_invoice.py b/addons/l10n_in/models/account_invoice.py index e1cc07d18d3..a48b69d2e3d 100644 --- a/addons/l10n_in/models/account_invoice.py +++ b/addons/l10n_in/models/account_invoice.py @@ -8,7 +8,6 @@ from odoo.exceptions import ValidationError, RedirectWarning class AccountMove(models.Model): _inherit = "account.move" - amount_total_words = fields.Char("Total (In Words)", compute="_compute_amount_total_words") l10n_in_gst_treatment = fields.Selection([ ('regular', 'Registered Business - Regular'), ('composition', 'Registered Business - Composition'), diff --git a/addons/l10n_in/models/company.py b/addons/l10n_in/models/company.py new file mode 100644 index 00000000000..c1e38290f3f --- /dev/null +++ b/addons/l10n_in/models/company.py @@ -0,0 +1,13 @@ +from odoo import api, models + + +class ResCompany(models.Model): + _inherit = 'res.company' + + @api.model_create_multi + def create(self, vals_list): + companies = super().create(vals_list) + for company in companies: + if company.account_fiscal_country_id.code == 'IN': + company.display_invoice_amount_total_words = True + return companies diff --git a/addons/l10n_in/static/src/img/Google_Pay-Logo.svg b/addons/l10n_in/static/src/img/Google_Pay-Logo.svg new file mode 100644 index 00000000000..0d0de6bb6e0 --- /dev/null +++ b/addons/l10n_in/static/src/img/Google_Pay-Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/l10n_in/static/src/img/Paytm-Logo.svg b/addons/l10n_in/static/src/img/Paytm-Logo.svg new file mode 100644 index 00000000000..72723062b44 --- /dev/null +++ b/addons/l10n_in/static/src/img/Paytm-Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/l10n_in/static/src/img/PhonePe-Logo.svg b/addons/l10n_in/static/src/img/PhonePe-Logo.svg new file mode 100644 index 00000000000..0cfcefcb381 --- /dev/null +++ b/addons/l10n_in/static/src/img/PhonePe-Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/l10n_in/static/src/img/Upi-logo.svg b/addons/l10n_in/static/src/img/Upi-logo.svg new file mode 100644 index 00000000000..a390910198a --- /dev/null +++ b/addons/l10n_in/static/src/img/Upi-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/l10n_in/views/report_invoice.xml b/addons/l10n_in/views/report_invoice.xml index 8fac8b247c8..8615f3fdadb 100644 --- a/addons/l10n_in/views/report_invoice.xml +++ b/addons/l10n_in/views/report_invoice.xml @@ -9,14 +9,6 @@ Place of supply: - - -

- Total (In Words): - -

-
-
@@ -30,6 +22,28 @@ + + + + + + +
+ PAYMENT QR CODE +
+

UPI ID:

+ +
+
+ + + + +
+
+
+
+

diff --git a/addons/l10n_ma/__init__.py b/addons/l10n_ma/__init__.py index 67dee8c60db..be9f4fab00a 100644 --- a/addons/l10n_ma/__init__.py +++ b/addons/l10n_ma/__init__.py @@ -1,2 +1,3 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +from . import models diff --git a/addons/l10n_ma/__manifest__.py b/addons/l10n_ma/__manifest__.py index c792c5022e0..7d4ff24a8f5 100644 --- a/addons/l10n_ma/__manifest__.py +++ b/addons/l10n_ma/__manifest__.py @@ -25,5 +25,8 @@ Seddik au cours du troisième trimestre 2010.""", 'data/account_tax_data.xml', 'data/account_chart_template_data.xml', ], + 'demo': [ + 'demo/demo_company.xml', + ], 'license': 'LGPL-3', } diff --git a/addons/l10n_ma/demo/demo_company.xml b/addons/l10n_ma/demo/demo_company.xml new file mode 100644 index 00000000000..8784126bdc2 --- /dev/null +++ b/addons/l10n_ma/demo/demo_company.xml @@ -0,0 +1,34 @@ + + + + MA Company + 3233 Green Acres Road + Unit 07 + Marrakech + 1000 + + +04334934343 + info@company.morocobestcompany.com + www.morocobestcompany.com + 12312312312 + + + + MA Company + + + + + + + + + + + + + + + + + diff --git a/addons/l10n_ma/models/__init__.py b/addons/l10n_ma/models/__init__.py new file mode 100644 index 00000000000..52e1016126a --- /dev/null +++ b/addons/l10n_ma/models/__init__.py @@ -0,0 +1 @@ +from . import company diff --git a/addons/l10n_ma/models/company.py b/addons/l10n_ma/models/company.py new file mode 100644 index 00000000000..c8e6dfc640b --- /dev/null +++ b/addons/l10n_ma/models/company.py @@ -0,0 +1,13 @@ +from odoo import api, models + + +class ResCompany(models.Model): + _inherit = 'res.company' + + @api.model_create_multi + def create(self, vals_list): + companies = super().create(vals_list) + for company in companies: + if company.account_fiscal_country_id.code == 'MA': + company.display_invoice_amount_total_words = True + return companies diff --git a/addons/l10n_ua/__init__.py b/addons/l10n_ua/__init__.py index cacb7c95697..904a8ffa3f0 100644 --- a/addons/l10n_ua/__init__.py +++ b/addons/l10n_ua/__init__.py @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (C) 2019 Bohdan Lisnenko , ERP Ukraine +from . import models diff --git a/addons/l10n_ua/models/__init__.py b/addons/l10n_ua/models/__init__.py new file mode 100644 index 00000000000..52e1016126a --- /dev/null +++ b/addons/l10n_ua/models/__init__.py @@ -0,0 +1 @@ +from . import company diff --git a/addons/l10n_ua/models/company.py b/addons/l10n_ua/models/company.py new file mode 100644 index 00000000000..0b6654c3aa1 --- /dev/null +++ b/addons/l10n_ua/models/company.py @@ -0,0 +1,13 @@ +from odoo import api, models + + +class ResCompany(models.Model): + _inherit = 'res.company' + + @api.model_create_multi + def create(self, vals_list): + companies = super().create(vals_list) + for company in companies: + if company.account_fiscal_country_id.code == 'UA': + company.display_invoice_amount_total_words = True + return companies