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

[11.0][IMP] crm_claim: add activities to claims #214

Merged
merged 3 commits into from
Aug 22, 2018
Merged

[11.0][IMP] crm_claim: add activities to claims #214

merged 3 commits into from
Aug 22, 2018

Conversation

oihane
Copy link
Contributor

@oihane oihane commented Jul 17, 2018

No description provided.

@oihane oihane changed the title [IMP] crm_claim: add activities to claims [11.0][IMP] crm_claim: add activities to claims Jul 17, 2018
@pedrobaeza pedrobaeza added this to the 11.0 milestone Jul 17, 2018
activity_type = env.ref('mail.mail_activity_data_todo')
crm_claim_model = env.ref('crm_claim.model_crm_claim')
cr.execute("""
SELECT
Copy link
Member

Choose a reason for hiding this comment

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

You can make the insert from a select query and make this faster

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change done

WHERE
date_action_next IS NOT Null
OR
action_next IS NOT Null;

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

id,
name,
user_id,
CASE WHEN date_action_next IS NOT Null THEN date_action_next
Copy link
Member

Choose a reason for hiding this comment

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

Use COALESCE(date_action_next, now()) instead for simplifying the query

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

FROM
crm_claim
WHERE
date_action_next IS NOT Null
Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking that you can remove now this part of the WHERE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before this, you can set a 'date_action_next' without adding an 'action_next', if you don't add this where it won't create any activity (a 'summary' is not mandatory in the database, you can create one without text)

Copy link
Member

Choose a reason for hiding this comment

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

Is the text mandatory on activities?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are 3 fields mandatory through odoo:

  • user_id
  • date_deadline
  • activity_type_id

Internally:

  • res_model
  • res_model_id
  • res_id
  • res_name

summary and note are NOT MANDATORY

Copy link
Member

Choose a reason for hiding this comment

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

OK, thanks for the confirmation.

@pedrobaeza pedrobaeza merged commit fbf74b1 into OCA:11.0 Aug 22, 2018
@oihane oihane deleted the 11.0-crm_claim branch August 22, 2018 11:57
cristinamartinrod pushed a commit to Tecnativa/crm that referenced this pull request Nov 28, 2018
cristinamartinrod pushed a commit to Tecnativa/crm that referenced this pull request Nov 28, 2018
manuelcalerosolis pushed a commit to Tecnativa/crm that referenced this pull request Feb 21, 2020
manuelcalerosolis pushed a commit to Tecnativa/crm that referenced this pull request Mar 3, 2020
flachica pushed a commit to flachica/crm that referenced this pull request Apr 3, 2020
flachica pushed a commit to flachica/crm that referenced this pull request Apr 4, 2020
manuelcalerosolis pushed a commit to Tecnativa/crm that referenced this pull request Apr 22, 2020
flachica pushed a commit to flachica/crm that referenced this pull request Jun 13, 2020
redapureskill pushed a commit to redapureskill/crm that referenced this pull request Nov 15, 2020
Daniel-CA pushed a commit to Daniel-CA/crm that referenced this pull request May 13, 2021
bizzappdev pushed a commit to bizzappdev/crm that referenced this pull request Feb 10, 2022
FernandoRomera pushed a commit to MallorcaSoft/crm that referenced this pull request Dec 15, 2022
jdidderen-nsi pushed a commit to jdidderen-nsi/crm that referenced this pull request Jun 24, 2024
BernatObrador pushed a commit to APSL/crm that referenced this pull request Jul 18, 2024
BernatObrador pushed a commit to APSL/crm that referenced this pull request Aug 8, 2024
BernatObrador pushed a commit to APSL/crm that referenced this pull request Aug 8, 2024
BernatObrador pushed a commit to APSL/crm that referenced this pull request Aug 8, 2024
BernatObrador pushed a commit to APSL/crm that referenced this pull request Aug 8, 2024
BernatObrador pushed a commit to APSL/crm that referenced this pull request Aug 8, 2024
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.

3 participants