From 2b48abf9b03427ef2fc371d30b0b2e7e93856295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20E=2E=20G=C3=B3mez?= Date: Fri, 20 Aug 2021 15:36:35 -0500 Subject: [PATCH] [ADD] Allows using special repo for electronic invoices --- .gitignore | 1 + apply_patches.sh | 15 ++ install_odoo_code.sh | 17 ++ ...t-e-invoicing_installs-in-production.patch | 202 ++++++++++++++++++ selected_oca_modules.txt | 19 +- update_from_repo.sh | 24 +++ 6 files changed, 270 insertions(+), 8 deletions(-) create mode 100644 patches/20210820_l10n-co-account-e-invoicing_installs-in-production.patch diff --git a/.gitignore b/.gitignore index f5ad3b8..498b413 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ community/ core/ custom/ vendor/ +special/ diff --git a/apply_patches.sh b/apply_patches.sh index 9bcc98c..f4d4d4f 100755 --- a/apply_patches.sh +++ b/apply_patches.sh @@ -48,6 +48,18 @@ pt_vendor () # patch $OPTIONS < patches/20210607_electronic-invoice-dian_remove-enterprise-module.patch } +pt_special () +{ + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + echo " Patch special electronic invoice modules" + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + + DEST=$DESTDIR/vendor/ + OPTIONS="--directory=$DEST --p=1" + + git apply $OPTIONS patches/20210820_l10n-co-account-e-invoicing_installs-in-production.patch +} + pt_community () { echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" @@ -99,6 +111,9 @@ case $Modules in 'vendor') # Apply patches to Avancys modules pt_vendor exit;; + 'special') # Apply patches to e-invoice Avancys modules + pt_special + exit;; 'community') # Apply patches to OCA modules pt_community exit;; diff --git a/install_odoo_code.sh b/install_odoo_code.sh index 21d8fd9..3b360a0 100755 --- a/install_odoo_code.sh +++ b/install_odoo_code.sh @@ -63,6 +63,20 @@ cp_vendor () $SRC $DEST } +cp_special () +{ + REPO="Special Avancys v14 electronic invoice" + SRC=./special/ + DEST=$DESTDIR/vendor/ + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + echo "Install $REPO into production directory structure" + echo "(selected modules)" + echo " …from $SRC to $DEST" + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + rsync $OPTIONS --exclude-from=rejected_proprietary_modules.txt \ + $SRC $DEST +} + cp_custom () { REPO="Custom in-house modules " @@ -117,6 +131,9 @@ case $Modules in 'vendor') # Install Avancys modules cp_vendor exit;; + 'special') # Install Avancys e-invoice modules + cp_special + exit;; 'custom') # Install Custom modules developed in-house cp_custom exit;; diff --git a/patches/20210820_l10n-co-account-e-invoicing_installs-in-production.patch b/patches/20210820_l10n-co-account-e-invoicing_installs-in-production.patch new file mode 100644 index 0000000..c5cf1b7 --- /dev/null +++ b/patches/20210820_l10n-co-account-e-invoicing_installs-in-production.patch @@ -0,0 +1,202 @@ +diff --git a/account_tax_group_type/i18n/es_CO.po b/account_tax_group_type/i18n/es_CO.po +deleted file mode 100644 +index 55fa157..0000000 +--- a/account_tax_group_type/i18n/es_CO.po ++++ /dev/null +@@ -1,110 +0,0 @@ +-# Translation of Odoo Server. +-# This file contains the translation of the following modules: +-# * account_tax_group_type +-# +-msgid "" +-msgstr "" +-"Project-Id-Version: Odoo Server 14.0\n" +-"Report-Msgid-Bugs-To: \n" +-"POT-Creation-Date: 2021-08-20 14:04+0000\n" +-"PO-Revision-Date: 2021-08-20 14:04+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_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__code +-msgid "Code" +-msgstr "Código" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__create_uid +-msgid "Created by" +-msgstr "Creado por" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__create_date +-msgid "Created on" +-msgstr "Creado el" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__description +-msgid "Description" +-msgstr "Descripción" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group__display_name +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__display_name +-msgid "Display Name" +-msgstr "Nombre mostrado" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group__id +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__id +-msgid "ID" +-msgstr "" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group____last_update +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type____last_update +-msgid "Last Modified on" +-msgstr "Última modificación el" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__write_uid +-msgid "Last Updated by" +-msgstr "Última actualización por" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__write_date +-msgid "Last Updated on" +-msgstr "Última actualización el" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__name +-msgid "Name" +-msgstr "Nombre" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields.selection,name:account_tax_group_type.selection__account_tax_group_type__type__tax +-msgid "Tax" +-msgstr "Impuesto" +- +-#. module: account_tax_group_type +-#: model:ir.model,name:account_tax_group_type.model_account_tax_group +-msgid "Tax Group" +-msgstr "Grupo de impuestos" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group__tax_group_type_id +-msgid "Tax Group Type" +-msgstr "Tipo de Grupo de Impuesto" +- +-#. module: account_tax_group_type +-#: model:ir.model,name:account_tax_group_type.model_account_tax_group_type +-msgid "Tax Group Types" +-msgstr "Tipos de Grupos de Impuestos" +- +-#. module: account_tax_group_type +-#: code:addons/account_tax_group_type/models/account_tax_group_type.py:0 +-#, python-format +-msgid "The code of Tax Group Type must be unique!" +-msgstr "¡El código del Tipo de Grupo Impuesto debe ser único!" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields,field_description:account_tax_group_type.field_account_tax_group_type__type +-msgid "Type" +-msgstr "Tipo" +- +-#. module: account_tax_group_type +-#: model:ir.model.fields.selection,name:account_tax_group_type.selection__account_tax_group_type__type__withholding_tax +-msgid "Withholding Tax" +-msgstr "Impuesto de Retención" +- +-#. module: account_tax_group_type +-#: model:ir.model.constraint,message:account_tax_group_type.constraint_account_tax_group_type_code_uniq +-msgid "The code of Tax Group Type must be unique!" +-msgstr "¡El código del Tipo de Grupo Impuesto debe ser único!" +diff --git a/l10n_co_account_e_invoicing/__manifest__.py b/l10n_co_account_e_invoicing/__manifest__.py +index 41934a0..77c4dbf 100644 +--- a/l10n_co_account_e_invoicing/__manifest__.py ++++ b/l10n_co_account_e_invoicing/__manifest__.py +@@ -26,7 +26,7 @@ + ], + "external_dependencies": { + "python": [ +- "OpenSSL", ++ "pyopenssl", + "xades", + ], + }, +diff --git a/l10n_co_account_e_invoicing/models/account_move.py b/l10n_co_account_e_invoicing/models/account_move.py +index 376f36c..88f62ba 100644 +--- a/l10n_co_account_e_invoicing/models/account_move.py ++++ b/l10n_co_account_e_invoicing/models/account_move.py +@@ -89,16 +89,16 @@ class AccountMove(models.Model): + + warn_remaining_certificate = fields.Boolean( + string="Warn About Remainings?", +- compute="_get_warn_certificate", ++ # compute="_get_warn_certificate", + store=False) + warn_inactive_certificate = fields.Boolean( + string="Warn About Inactive Certificate?", +- compute="_get_warn_certificate", ++ # compute="_get_warn_certificate", + store=False) + sequence_resolution_id = fields.Many2one( + comodel_name='ir.sequence.date_range', + string='Sequence Resolution', +- compute='_compute_sequence_resolution_id', ++ # compute='_compute_sequence_resolution_id', + store=False) + invoice_datetime = fields.Datetime(string='Invoice Datetime', copy=False) + delivery_datetime = fields.Datetime(string='Delivery Datetime', copy=False) +@@ -127,7 +127,11 @@ class AccountMove(models.Model): + string='Send Invoice to DIAN?', + default=_default_send_invoice_to_dian, + copy=False) +- dbname = fields.Char(string="DB Name", compute="_get_dbname", store=False) ++ dbname = fields.Char( ++ string="DB Name", ++ # compute="_get_dbname", ++ store=False ++ ) + access_token = fields.Char(string='Access Token', copy=False) + is_accepted_rejected = fields.Boolean(string='Is Accepted/Rejected?', copy=False) + accepted_rejected_datetime = fields.Datetime( +diff --git a/l10n_co_account_move_discrepancy_response/__manifest__.py b/l10n_co_account_move_discrepancy_response/__manifest__.py +index 995ee1d..8d14c66 100644 +--- a/l10n_co_account_move_discrepancy_response/__manifest__.py ++++ b/l10n_co_account_move_discrepancy_response/__manifest__.py +@@ -23,7 +23,7 @@ + "wizards/account_move_reversal_views.xml", + "views/account_move_discrepancy_response_code_views.xml", + "views/account_move_views.xml", +- "views/account_journal_views.xml", ++ # "views/account_journal_views.xml", + ], + "installable": True, + } +diff --git a/l10n_co_base_location/__manifest__.py b/l10n_co_base_location/__manifest__.py +index eed50a8..3729340 100644 +--- a/l10n_co_base_location/__manifest__.py ++++ b/l10n_co_base_location/__manifest__.py +@@ -14,13 +14,13 @@ + "account_avancys", + "base_location"], + "data": [ +- "data/res.country.state.csv", +- #"data/res.city.csv", +- #"data/res.city.zip.csv", ++ # "data/res.country.state.csv", ++ # "data/res.city.csv", ++ # "data/res.city.zip.csv", + "views/res_country_state_views.xml", + "views/res_city_views.xml", + "views/res_city_zip_views.xml", + "views/res_partner_views.xml" + ], + "installable": True, +-} +\ No newline at end of file ++} diff --git a/selected_oca_modules.txt b/selected_oca_modules.txt index f4e950c..64cadcd 100644 --- a/selected_oca_modules.txt +++ b/selected_oca_modules.txt @@ -1,18 +1,21 @@ -account-financial-tools/account_asset_management/ -credit-control/account_credit_control/ account-financial-reporting/account_financial_report/ +account-financial-tools/account_asset_management/ account-financial-tools/account_fiscal_year/ -account-invoicing/account_invoice_force_number/ account-financial-tools/account_menu/ +account-invoicing/account_invoice_force_number/ bank-payment/account_payment_mode/ bank-payment/account_payment_order/ bank-payment/account_payment_partner/ +credit-control/account_credit_control/ +helpdesk/helpdesk_mgmt/ +hr/hr_branch/ +partner-contact/base_location/ +partner-contact/partner_fax/ +partner-contact/partner_identification/ +reporting-engine/report_xlsx/ +reporting-engine/report_xlsx_helper/ server-auth/auth_oauth_multi_token/ server-backend/base_user_role/ server-ux/date_range/ -helpdesk/helpdesk_mgmt/ -hr/hr_branch/ -reporting-engine/report_xlsx/ -reporting-engine/report_xlsx_helper/ web/web_m2x_options/ -web/web_responsive/ \ No newline at end of file +web/web_responsive/ diff --git a/update_from_repo.sh b/update_from_repo.sh index f0aa99d..47b86d3 100755 --- a/update_from_repo.sh +++ b/update_from_repo.sh @@ -77,6 +77,27 @@ gt_vendor () fi } +gt_special () +{ + REPO="Special repo for electronic invoice 1.8 by Avancys" + SRC=git@gitlab.com:mgarcia.avancys/v14-facturacionelectronica.git + DEST=./special/ + OPTIONS="" + if [ ! -d "$DEST" ]; then + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + echo "Clone $REPO" + echo " …to $DEST" + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + git clone $OPTIONS $SRC $DEST + else + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + echo "Update $REPO" + echo " …in $DEST" + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + git -C $DEST pull + fi +} + gt_custom () { REPO="Custom in-house modules" @@ -140,6 +161,9 @@ case $Modules in 'vendor') # Download from repo Avancys modules gt_vendor exit;; + 'special') # Download from special repo Avancys e-invoice modules + gt_special + exit;; 'custom') # Download from repo Custom modules developed in-house gt_custom exit;;