[FIX]CRM Action new model methods to allow back to draft and set done
This commit is contained in:
parent
afbe61ed79
commit
7af4d4a609
@ -18,7 +18,7 @@
|
|||||||
{
|
{
|
||||||
'name': 'CRM Actions',
|
'name': 'CRM Actions',
|
||||||
'summary': 'Action management, instead of new activity, in CRM',
|
'summary': 'Action management, instead of new activity, in CRM',
|
||||||
'version': '10.0.1.2.1',
|
'version': '10.0.1.2.2',
|
||||||
'category': 'Sales',
|
'category': 'Sales',
|
||||||
'author': 'Fabien BOURGEOIS - Yaltik',
|
'author': 'Fabien BOURGEOIS - Yaltik',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
|
@ -74,6 +74,15 @@ class CrmAction(models.Model):
|
|||||||
details = u' '.join(action.details.split()[:5]) + details
|
details = u' '.join(action.details.split()[:5]) + details
|
||||||
action.display_name = u'[{}]{}'.format(action.action_type_name,
|
action.display_name = u'[{}]{}'.format(action.action_type_name,
|
||||||
details)
|
details)
|
||||||
|
@api.multi
|
||||||
|
def set_to_draft(self):
|
||||||
|
""" Set actions to draft """
|
||||||
|
self.write({'state': 'draft'})
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def set_to_done(self):
|
||||||
|
""" Set actions to done """
|
||||||
|
self.write({'state': 'done'})
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def create_linked_event(self):
|
def create_linked_event(self):
|
||||||
|
@ -52,4 +52,4 @@ class CrmLead(models.Model):
|
|||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
lead = self[0]
|
lead = self[0]
|
||||||
if lead.next_action_id:
|
if lead.next_action_id:
|
||||||
lead.next_action_id.confirm()
|
lead.next_action_id.set_to_done()
|
||||||
|
@ -80,7 +80,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<field name="lead_id" />
|
<field name="lead_id" />
|
||||||
<field name="partner_id" />
|
<field name="partner_id" />
|
||||||
<field name="user_id" />
|
<field name="user_id" />
|
||||||
<button icon="fa-check" name="confirm" type="object"
|
<button icon="fa-check" name="set_to_done" type="object"
|
||||||
string="Mark as Done" states="draft" />
|
string="Mark as Done" states="draft" />
|
||||||
<button icon="fa-undo" name="set_to_draft" type="object"
|
<button icon="fa-undo" name="set_to_draft" type="object"
|
||||||
string="Back to Todo" states="done" />
|
string="Back to Todo" states="done" />
|
||||||
|
Loading…
Reference in New Issue
Block a user