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

[FIX] Exception when scheduling a phonecall from another #89

Closed
wants to merge 5 commits into from

Conversation

antespi
Copy link
Contributor

@antespi antespi commented Apr 22, 2016

This PR fix a bug when scheduling a phonecall from another. Steps to reproduce:

  1. Install addon 'crm_phonecall_summary_predefined'
  2. Go to Sales > Logged phones and clean filters
  3. Click at Phone icon (icons on the right in each call row) to 'Schedule Other Call'
  4. Press 'Schedule Call' button

An IntegrityError is raised:

Integrity Error

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: summary_id - summary.id]

This PR adds summary_id field to crm.phonecall2phonecall model and view in order to create a new call with that field assigned and avoid integrity error.

This PR depends on these ones:

res = super(CRMPhonecall, self)._prepare_another_phonecall_vals(
call, schedule_time, call_summary, user_id=user_id,
section_id=section_id, categ_id=categ_id)
summary_id = (self.env.context and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should do res['summary_id'] = self.env.context.get('summary_id', res.get('summary_id', False)).

@antespi
Copy link
Contributor Author

antespi commented Apr 22, 2016

Until OCA/OCB#482 or odoo/odoo#11791 merged, travis and runbot will be red

@pedrobaeza
Copy link
Member

This can't be merged on OCB, so the only chance is Odoo.

@antespi
Copy link
Contributor Author

antespi commented Apr 22, 2016

Well, I hope Odoo HQ takes my PR into account. If not, we can see another approach to solve this bug.

@rafaelbn rafaelbn added this to the 8.0 milestone Apr 22, 2016
@coveralls
Copy link

coveralls commented May 11, 2016

Coverage Status

Coverage decreased (-1.4%) to 77.581% when pulling 83671f2 on Antiun:fix-schedule_phonecall into a45c3ad on OCA:8.0.

@pedrobaeza
Copy link
Member

Can you add a test for the new behavior?

@antespi
Copy link
Contributor Author

antespi commented May 11, 2016

Odoo is ignoring us and OCB fix is not an option, so I have to change strategy. Then when I have a new PR for this (without no core changes) I'll add test for it.

@rafaelbn
Copy link
Member

rafaelbn commented Oct 4, 2016

Hi @antespi @pedrobaeza , none of the dependencies of this PR are going to be merged. So Please I think it's better to close this. Anyway we are migrating this problem to v9, so better we must find a way in v9.

@antespi
Copy link
Contributor Author

antespi commented Oct 5, 2016

I'm closing this because requirements are not going to be merged.

@antespi antespi closed this Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants