Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3122 Lượt xem

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 

Ảnh đại diện
Huỷ bỏ

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?

Tác giả

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!

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ