-
-
Notifications
You must be signed in to change notification settings - Fork 420
[ADD][crm_phonecall_planner] Phonecall autoscheduler #174
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
Conversation
A simple to use wizard that generates phonecall plannings under given criteria.
crm_phonecall_planner/README.rst
Outdated
Usage | ||
===== | ||
|
||
To use this module, you need to specify your partners' preferred phone call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this paragraph on "Configuration" section.
crm_phonecall_planner/README.rst
Outdated
Funders | ||
------- | ||
|
||
The development of this module has been financially supported by: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this as it's not actually true (this is for final customers).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can propose a change in the template for grouping contributors by company, putting something like:
* Tecnativa (https://www.tecnativa.com)
* Jairo Llopis <option e-mail>
...
crm_phonecall_planner/README.rst
Outdated
Contributors | ||
------------ | ||
|
||
* Jairo Llopis <jairo.llopis@tecnativa.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put here Tecnativa URL
from openerp.tests.common import SavepointCase | ||
|
||
|
||
class SomethingCase(SavepointCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SomethingCase?
) | ||
duration = fields.Float( | ||
string="Call duration", | ||
default=lambda self: self._default_duration(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do this, but move to up the default method and just put default=_default_duration
(without quotes in the method).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, check the guidelines: https://github.com/OCA/maintainer-tools/blob/master/CONTRIBUTING.md#fields
(same in comments below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this guideline is deprecated. Have you tried to inherit now in v9/v10 directly the method to see if it works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I remember to have tried in the past with a core model that defined a lambda, and I had to redefine the field just to override the default method.
The problem when you do default=_default_duration
is that you bind directly the function code object. By using a lambda, you bind directly the lambda code, but inside it you have the benefits of all the inheritance system. That's the reason behind that guideline.
Other field attributes, such as compute
or search
, accept a string that defines the method name and make this wrapper automatically, but in default
that system is not available, since passing a string would use that string as the default value instead, so the lambda callback wrapper is the best choice here AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, yes, it makes sense
|
||
@api.constrains("start", "end") | ||
def _constrains_plan_dates(self): | ||
if self.start > self.end: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to make it multi-record aware
|
||
@api.multi | ||
def _schedule_call(self, partner, when): | ||
call = self.env["crm.phonecall"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reduce cyclomatic complexity, do:
if not partner:
return self.env["crm.phonecall"]
_logger.debug(
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'll just remove the returned value, it's not used after all.
This is testable now. |
Hi @yajo , In this use case I get an error:
|
Hi @yajo , Thanks |
#174 (comment) happened when domain was empty, it should be fixed now. #174 (comment) happens because the incompatible |
…call autoscheduler
This should go 100% coverage now. |
…] Phonecall autoscheduler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work ok in runbot.
(I had to uninstall crm_phonecall_summary_predefined and the update this module to refresh the phonecall model)
@pedrobaeza @rafaelbn please update your reviews |
Hi @yajo: Imagine you have a Phone call Schedule for:
This are all the posibilities for Octobre 2017
And you would like you would like to plan call for every tuesday in october.
Thanks |
Day gap is only the amount of calendar days you are going to leave your target callee with no calls in between. The easiest way to fix all your concerns would be just adding 7 checkboxes (one per week day) and let the user choose what week days to include in the planning, since the working daytime is chosen by the user directly in the wizard (no need to consult company or user working schedule). However my concern is if this is a real use case... To begin, it makes no sense to record that your customer expects to be contacted on Sundays if you're never going to call him on Sundays, don't you think? |
So can this be merged as is and leave the rest of improvements for future iterations? |
crm_phonecall_planner/README.rst
Outdated
will try to schedule before all the partners that you never called under | ||
current **criteria combination**, but if none is found it will repeat calls for | ||
such **criteria combination** if last call was done before the minimum | ||
*Days gap* you specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't undestand this paragraph 😢
…r] Phonecall autoscheduler Reword weird paragraph
Better now @rafaelbn ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 ready thank!
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
* [ADD][crm_phonecall_planner] Phonecall autoscheduler A simple to use wizard that generates phonecall plannings under given criteria. * fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler * fixup! fixup! fixup! fixup! fixup! fixup! [ADD][crm_phonecall_planner] Phonecall autoscheduler Reword weird paragraph
A simple to use wizard that generates phonecall plannings under given criteria.
See README for further details.
WIP until:
@Tecnativa