Skip to content

Commit

Permalink
Merge pull request OCA#114 from mdietrichc2c/toolstream-email-cc
Browse files Browse the repository at this point in the history
Add CC email address for Toolstream exports
  • Loading branch information
mdietrichc2c committed Jun 13, 2017
2 parents eb7f34a + 404e10b commit 5715028
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ edifact_purchase_error_path = ERREUR
edifact_regex_ref = (\w*?)\.edi
edifact_regex_errors = ERREUR: ([^<>]*)
toolstream_email_address = orbis@toolstream.com
toolstream_email_cc_address = john.ellery@toolstream.com
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ edifact_purchase_error_path = ERREUR
edifact_regex_ref = (\w*?)\.edi
edifact_regex_errors = ERREUR: ([^<>]*)
toolstream_email_address = fscalese@descours-cabaud.com
toolstream_email_cc_address =
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[magento_backend.debonix]
location = http://recette.debonix.fr
location = https://recette.debonix.fr
username = openerp_connect
password = dohSh(eo+m/oa1Zo

Expand Down
5 changes: 5 additions & 0 deletions specific-parts/specific-addons/specific_fct/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,10 @@ def _get_environment_config_by_id(self, cr, uid, ids, field_names,
_get_environment_config_by_id,
string="Toolstream email address",
type='char',
multi='server_env'),
'toolstream_email_cc_address': fields.function(
_get_environment_config_by_id,
string="Toolstream email CC address",
type='char',
multi='server_env')
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ def _send_toolstream_email(self, cr, uid, purchase, context=None):
'name': filename,
'datas_fname': filename},
context=context)
message_id = mail_obj.create(
cr, uid, {'subject': toolstream_account_id,
mail_values = {'subject': toolstream_account_id,
'email_to': company.toolstream_email_address,
'attachment_ids': [(6, 0, [attachment_id])]},
context=context)
'attachment_ids': [(6, 0, [attachment_id])]}
if company.toolstream_email_cc_address:
mail_values['email_cc'] = company.toolstream_email_cc_address
message_id = mail_obj.create(cr, uid, mail_values, context=context)
mail_obj.send(cr, uid, [message_id], context=context)

0 comments on commit 5715028

Please sign in to comment.