Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying fallower Ids. #99

Open
Grfokpr opened this issue Apr 8, 2017 · 2 comments
Open

Copying fallower Ids. #99

Grfokpr opened this issue Apr 8, 2017 · 2 comments

Comments

@Grfokpr
Copy link

Grfokpr commented Apr 8, 2017

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.

@iledarn
Copy link

iledarn commented Apr 8, 2017

@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)?

@Grfokpr
Copy link
Author

Grfokpr commented Apr 9, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants