odoo-development icon indicating copy to clipboard operation
odoo-development copied to clipboard

Copying fallower Ids.

Open Grfokpr opened this issue 8 years ago • 2 comments

I need to copy fallower_ids from project.project to project.task. my method looks like this but it's not working. any suggestions how would you do this.

@api.multi def add_project_followers(self): for task in self: partner_ids = task.project_id.message_follower_ids.ids task.message_subscribe(partner_ids)


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Grfokpr avatar Apr 08 '17 11:04 Grfokpr

@Grfokpr , Your odoo version is 10.0, right? Maybe this article about message subtypes helps you: https://odoo-development.readthedocs.io/en/latest/odoo/models/mail.message.html

Your code looks right for me but for missing indentation. And what you have in odoo logs (may copy-paste it here)?

iledarn avatar Apr 08 '17 11:04 iledarn

@iledarn I do try to use this method as button but i'm getting "The operation cannot be completed, probably due to the following:

  • deletion: you may be trying to delete a record while other records still reference it
  • creation/update: a mandatory field is not correctly set

[object with reference: Partner - res.partner]" Validation Error.

Grfokpr avatar Apr 09 '17 09:04 Grfokpr