Browse Source

[UPD]Fix bug when send aged statement

* Put default_parent_id to false if it is in context
because it could be use in mail.compose.message model
and create a bug saying xx id doesn't exit in model.
* The default_parent_id only exists when doing search with
the related company field; to fix this issue, check if the
context contains the default_parent_id and put it false
pull/9/head
EL HADJI DEM 9 years ago
committed by Maxime Chambreuil
parent
commit
d363c6b871
  1. 8
      account_partner_aged_statement_webkit/partner_aged_statement.py

8
account_partner_aged_statement_webkit/partner_aged_statement.py

@ -47,7 +47,13 @@ class PartnerAgedStatement(orm.Model):
cr, uid, 'mail', 'email_compose_message_wizard_form')[1]
except ValueError:
compose_form_id = False
# When doing search with related company, it creates a bug saying
# the xx id doesn't exist in mail.message.
# The default_parent_id is used by mail.compose.message model
# to get the message_id. It must be false when doing search with
# related company
if 'default_parent_id' in context:
del context['default_parent_id']
ctx = dict(context)
ctx.update({
'default_model': 'res.partner',

Loading…
Cancel
Save