Skip to Content
Menu
This question has been flagged
2 Replies
2822 Views

When I am in editing a partner, I'd like to have the Chatter (on res.partner level) to keep track of the changes made in partner's accounting tab > Bank accounts > bank number field.

I added track_visibility='always' on the fields I'm interested on tracking in res.partner.bank but they would notify the res.partner.bank chatter, no the res.partner one 

Avatar
Discard

Do you want to track the change in res.partner.bank record from Partner or want to track the change in the res.partner object when Bank field is changed?

Author

I actually want both:

1) If a new partner.bank line is added (or deleted) add it to the res.partner chatter (with all the information inside)

2) If any of the partner.bank data is changed (like account number), also have it show up in the res.partner chatter

Thanks for your time!

Best Answer

Hi DevReaction,

You can add log when record write. What you need to do is, you need to override write method of res.partner and write code something like:

@api.multi

def write(self, vals):

    if vals.get('bank_ids'):

        self.message_post(body="You have added/changed bank accounts")

    return super(ClassName, self).write(vals)

Hope this will help you


Thanks and regards

Haresh Kansara

Avatar
Discard