diff --git a/apply_patches.sh b/apply_patches.sh index 23d06e8..9bcc98c 100755 --- a/apply_patches.sh +++ b/apply_patches.sh @@ -42,8 +42,10 @@ pt_vendor () DEST=$DESTDIR/vendor/electronic_invoice_dian/ OPTIONS="--directory=$DEST --strip=1" - # Legalized in remote repo: - #patch $OPTIONS < patches/20210607_electronic-invoice-dian_remove-enterprise-module.patch + patch $OPTIONS < patches/20210817_electronic-invoice-dian_sudo-in-email-sent.patch + + # Now included in remote repo: + # patch $OPTIONS < patches/20210607_electronic-invoice-dian_remove-enterprise-module.patch } pt_community () diff --git a/patches/20210817_electronic-invoice-dian_sudo-in-email-sent.patch b/patches/20210817_electronic-invoice-dian_sudo-in-email-sent.patch new file mode 100644 index 0000000..fd8f2eb --- /dev/null +++ b/patches/20210817_electronic-invoice-dian_sudo-in-email-sent.patch @@ -0,0 +1,12 @@ +diff -rupN electronic_invoice_dian/models/account_move.py electronic_invoice_dian.patch/models/account_move.py +--- electronic_invoice_dian/models/account_move.py 2021-07-01 17:18:28.506355243 -0500 ++++ electronic_invoice_dian.patch/models/account_move.py 2021-08-18 00:05:11.094308447 -0500 +@@ -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() +