[ADD] Patches for special e-invoice module
This commit is contained in:
parent
e34e8eeaba
commit
98bd6b3ba9
@ -42,10 +42,11 @@ pt_vendor ()
|
|||||||
DEST=$DESTDIR/vendor/electronic_invoice_dian/
|
DEST=$DESTDIR/vendor/electronic_invoice_dian/
|
||||||
OPTIONS="--directory=$DEST --strip=1"
|
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:
|
# Rolled-up in current patch:
|
||||||
# patch $OPTIONS < patches/20210607_electronic-invoice-dian_remove-enterprise-module.patch
|
# 20210607_electronic-invoice-dian_remove-enterprise-module.patch
|
||||||
|
# 20210817_electronic-invoice-dian_sudo-in-email-sent.patch
|
||||||
}
|
}
|
||||||
|
|
||||||
pt_special ()
|
pt_special ()
|
||||||
|
|||||||
@ -3,3 +3,4 @@
|
|||||||
.vscode
|
.vscode
|
||||||
*.py[co]
|
*.py[co]
|
||||||
[^e]*.po
|
[^e]*.po
|
||||||
|
__pycache__
|
||||||
|
|||||||
@ -67,13 +67,14 @@ cp_vendor ()
|
|||||||
REPO="Avancys v14 for Agofer"
|
REPO="Avancys v14 for Agofer"
|
||||||
SRC=./vendor/
|
SRC=./vendor/
|
||||||
DEST=$DESTDIR/vendor/
|
DEST=$DESTDIR/vendor/
|
||||||
|
# Exclude proprietary modules and modules included in other repos:
|
||||||
|
EXCL="--exclude-from=rejected_vendor_modules.txt"
|
||||||
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
echo "Install $REPO into production directory structure"
|
echo "Install $REPO into production directory structure"
|
||||||
echo "(selected modules)"
|
echo "(selected modules)"
|
||||||
echo " …from $SRC to $DEST"
|
echo " …from $SRC to $DEST"
|
||||||
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
# Exclude proprietary modules, and modules included in other repos.
|
rsync $OPTIONS $EXCL $SRC $DEST
|
||||||
rsync $OPTIONS --exclude-from=rejected_vendor_modules.txt $SRC $DEST
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cp_special ()
|
cp_special ()
|
||||||
@ -81,12 +82,14 @@ cp_special ()
|
|||||||
REPO="Special Avancys v14 electronic invoice"
|
REPO="Special Avancys v14 electronic invoice"
|
||||||
SRC=./special/
|
SRC=./special/
|
||||||
DEST=$DESTDIR/vendor/
|
DEST=$DESTDIR/vendor/
|
||||||
|
# Exclude modules included in other repos:
|
||||||
|
EXCL="--exclude-from=rejected_special_modules.txt"
|
||||||
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
echo "Install $REPO into production directory structure"
|
echo "Install $REPO into production directory structure"
|
||||||
echo "(selected modules)"
|
echo "(selected modules)"
|
||||||
echo " …from $SRC to $DEST"
|
echo " …from $SRC to $DEST"
|
||||||
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||||
rsync $OPTIONS $SRC $DEST
|
rsync $OPTIONS $EXCL $SRC $DEST
|
||||||
}
|
}
|
||||||
|
|
||||||
cp_custom ()
|
cp_custom ()
|
||||||
|
|||||||
@ -5,9 +5,8 @@ diff -rupN electronic_invoice_dian/__manifest__.py electronic_invoice_dian.patch
|
|||||||
'website': "http://www.avancys.com",
|
'website': "http://www.avancys.com",
|
||||||
'category': 'Accounting/Accounting',
|
'category': 'Accounting/Accounting',
|
||||||
'version': '14.0.0.0',
|
'version': '14.0.0.0',
|
||||||
- 'depends': ['account_accountant', 'sale'],
|
'depends': ['account', 'sale'],
|
||||||
- 'license': 'OEEL-1',
|
- 'license': 'OEEL-1',
|
||||||
+ 'depends': ['account', 'sale'],
|
|
||||||
+ 'license': '',
|
+ 'license': '',
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'data': [
|
'data': [
|
||||||
|
|||||||
@ -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">
|
||||||
1
rejected_special_modules.txt
Normal file
1
rejected_special_modules.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
electronic_invoice_dian
|
||||||
@ -1,4 +1,3 @@
|
|||||||
account_accountant
|
account_accountant
|
||||||
mail_enterprise
|
mail_enterprise
|
||||||
web_mobile
|
web_mobile
|
||||||
electronic_invoice_dian
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user