[ADD] Patches for special e-invoice module

This commit is contained in:
Jorge Enrique Gómez Gómez 2021-09-22 19:04:47 -05:00
parent e34e8eeaba
commit 98bd6b3ba9
7 changed files with 58 additions and 9 deletions

View File

@ -42,10 +42,11 @@ pt_vendor ()
DEST=$DESTDIR/vendor/electronic_invoice_dian/
OPTIONS="--directory=$DEST --strip=1"
patch $OPTIONS < patches/20210817_electronic-invoice-dian_sudo-in-email-sent.patch
patch $OPTIONS < patches/20210922_electronic-invoice-dian_changes-after-1-8.patch
# Now included in remote repo:
# patch $OPTIONS < patches/20210607_electronic-invoice-dian_remove-enterprise-module.patch
# Rolled-up in current patch:
# 20210607_electronic-invoice-dian_remove-enterprise-module.patch
# 20210817_electronic-invoice-dian_sudo-in-email-sent.patch
}
pt_special ()

View File

@ -3,3 +3,4 @@
.vscode
*.py[co]
[^e]*.po
__pycache__

View File

@ -67,13 +67,14 @@ cp_vendor ()
REPO="Avancys v14 for Agofer"
SRC=./vendor/
DEST=$DESTDIR/vendor/
# Exclude proprietary modules and modules included in other repos:
EXCL="--exclude-from=rejected_vendor_modules.txt"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Install $REPO into production directory structure"
echo "(selected modules)"
echo " …from $SRC to $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
# Exclude proprietary modules, and modules included in other repos.
rsync $OPTIONS --exclude-from=rejected_vendor_modules.txt $SRC $DEST
rsync $OPTIONS $EXCL $SRC $DEST
}
cp_special ()
@ -81,12 +82,14 @@ cp_special ()
REPO="Special Avancys v14 electronic invoice"
SRC=./special/
DEST=$DESTDIR/vendor/
# Exclude modules included in other repos:
EXCL="--exclude-from=rejected_special_modules.txt"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Install $REPO into production directory structure"
echo "(selected modules)"
echo " …from $SRC to $DEST"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
rsync $OPTIONS $SRC $DEST
rsync $OPTIONS $EXCL $SRC $DEST
}
cp_custom ()

View File

@ -5,9 +5,8 @@ diff -rupN electronic_invoice_dian/__manifest__.py electronic_invoice_dian.patch
'website': "http://www.avancys.com",
'category': 'Accounting/Accounting',
'version': '14.0.0.0',
- 'depends': ['account_accountant', 'sale'],
'depends': ['account', 'sale'],
- 'license': 'OEEL-1',
+ 'depends': ['account', 'sale'],
+ 'license': '',
'installable': True,
'data': [

View File

@ -0,0 +1,45 @@
diff -rupN electronic_invoice_dian.orig/__manifest__.py electronic_invoice_dian.patch/__manifest__.py
--- electronic_invoice_dian.orig/__manifest__.py 2021-09-22 18:22:44.527545853 -0500
+++ electronic_invoice_dian.patch/__manifest__.py 2021-09-22 18:48:10.756738336 -0500
@@ -13,7 +13,7 @@
'category': 'Accounting/Accounting',
'version': '14.0.0.0',
'depends': ['account', 'sale'],
- 'license': 'OEEL-1',
+ 'license': '',
'installable': True,
'data': [
'data/data.xml',
diff -rupN electronic_invoice_dian.orig/models/account_move.py electronic_invoice_dian.patch/models/account_move.py
--- electronic_invoice_dian.orig/models/account_move.py 2021-09-22 18:22:44.527545853 -0500
+++ electronic_invoice_dian.patch/models/account_move.py 2021-09-22 18:42:27.141585276 -0500
@@ -621,7 +621,7 @@ class AccountMove(models.Model):
def valid_email_address(self):
regex = r'(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)'
- emails = self.partner_id.email or ''
+ emails = self.partner_id.ei_email or self.partner_id.email or ''
email_list = emails.split(';')
return list(filter(
lambda email: re.match(regex, email),
@@ -642,7 +642,7 @@ class AccountMove(models.Model):
continue
email_pool = email_pool + email
invoice.create_transaction_log(invoice, 'email_sent', 'OK')
- invoice.ei_email_sent = True
+ invoice.sudo().ei_email_sent = True
if force_send:
email_pool.send()
diff -rupN electronic_invoice_dian.orig/templates/customer_acknowledge_email.xml electronic_invoice_dian.patch/templates/customer_acknowledge_email.xml
--- electronic_invoice_dian.orig/templates/customer_acknowledge_email.xml 2021-09-22 18:22:44.527545853 -0500
+++ electronic_invoice_dian.patch/templates/customer_acknowledge_email.xml 2021-09-07 19:24:15.396238817 -0500
@@ -6,7 +6,7 @@
<field name="email_from">${object.company_id.email or ''}</field>
<field name="subject">${object.company_id.partner_id.ref_num};${object.company_id.partner_id.name};${object.name};${object.journal_id.resolution_id.document_type};${object.company_id.partner_id.name}</field>
<field name="model_id" ref="account.model_account_move" />
- <field name="email_to">${(object.partner_id.email or object.partner_id.ei_email)}</field>
+ <field name="email_to">${(object.partner_id.ei_email or object.partner_id.email)}</field>
<field name="partner_to">${False}</field>
<field name="auto_delete" eval="True" />
<field name="body_html">

View File

@ -0,0 +1 @@
electronic_invoice_dian

View File

@ -1,4 +1,3 @@
account_accountant
mail_enterprise
web_mobile
electronic_invoice_dian