-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi All,

We use a module called party_event [1] on which we store diferent
kinds of events (emails, calls, etc) related to a party. We also
several modules (electronic_mail*) for sending and storing emails. Now
if we want to show emails on the party_event module we have to create
a new row in party_event table with the information of the email, so
we are storing duplicate information. To avoid this we tried to
override the serach method of the party_event adding information of
the emails module. I paste the code:

@classmethod
def search(cls, domain, offset=0, limit=None, order=None, count=False,
          query_string=False):
      ElectronicMail = Pool().get('electronic.mail')
      res = super(PartyEvent, cls).search(domain, offset, limit, order,
          count, query_string)
      mails = ElectronicMail.search(domain, offset, limit,
          order, query_string)
      for mail in mails:
          event = cls()
          event.type = 'email'
          event.event_date = mail.date
          event.subject = mail.subject
          event.description = mail.get_email
          event.party = mail.party
          event.resource = 'electronic.mail,%s' % mail.id
          event.user = mail.create_uid
          res.append(event)
      print res
      return res

With this code the client is showing the rows generated from
electronic.mail module but they fiels are always blank.

Could you please give me some advice on how to show the records proberly?

[1] https://bitbucket.org/zikzakmedia/trytond-party_event
- -- 
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRvaMyAAoJEGRfwiQCVal52AoH/i8wyNzAFqu4Dgt0jo2mW6s2
KqEBWt5Tv6nUf+Uu2CmUdeogfMem2eAdPd6ea9EiXwfq3Er+6U7qVH1r7nZ5zMa+
LGhRo1uL/WJpMekD8Ri8D7vn+BV4G2S34SoaYbyZee0eZAbhu3aq8NqRTVv2mEb0
eAGA8SWgjiWtee21KXu0jEDccYeBOvQO3+45lJbQc0QqbZCJSPk5NhrCG5is4KeV
HhGGYi0/yvmaMX9/RMdB2rYHwCfewMitIQOxClGY9wEj8hORcYMOeA9wJYPGE/PJ
z6Zf9ikl6d+XHGMLUoarQ07f42G7GZvfDLppbKVfypy/NispZKLx8zOYxrkDVVU=
=FI2P
-----END PGP SIGNATURE-----

Reply via email to