Commit 5b3e4d1a authored by agb80's avatar agb80

Fixed unintended dependency to porta_sale module

Portal Sale module was not thinke to use as a dependency but we
were calling an email template installed by that module causing
the send to customer action on ir_attachment_facturae to crash
parent bec33174
Pipeline #200 failed with stage
......@@ -48,16 +48,21 @@ class email_template(orm.Model):
)
ir_model_data = self.pool.get('ir.model.data')
# Look for possible templates for invoice and overrite
reference_ids.append(
ir_model_data.get_object_reference(
cr, uid, 'account', 'email_template_edi_invoice'
)[1]
)
reference_ids.append(
ir_model_data.get_object_reference(
cr, uid, 'portal_sale', 'email_template_edi_invoice'
)[1]
)
try:
reference_ids.append(
ir_model_data.get_object_reference(
cr, uid, 'account', 'email_template_edi_invoice'
)[1]
)
reference_ids.append(
ir_model_data.get_object_reference(
cr, uid, 'portal_sale', 'email_template_edi_invoice'
)[1]
)
except ValueError:
# Module porta_sale not installed so we catch the error
# and skip error messages
pass
if template_id in reference_ids:
att_obj = self.pool.get('ir.attachment.facturae.mx')
states = ['printable', 'sent_customer', 'done']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment