Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions crm_proposal_due_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
=====================
CRM Proposal Due Date
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e4f8d992995dbb6fc626f546a69e38a83fbfc0c108851156018579a7aec8a2d6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github
:target: https://github.com/OCA/crm/tree/16.0/crm_proposal_due_date
:alt: OCA/crm
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/crm-16-0/crm-16-0-crm_proposal_due_date
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/crm&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the CRM *Opportunity* form with an **Expected
Proposal Submission Date** field (``proposal_due_date``).

Whenever this date is set or changed on an opportunity, an activity of
type *"Remettre la proposition"* is automatically scheduled with the
same deadline, giving the responsible salesperson a visible reminder in
their activity feed. If the date is cleared the corresponding activity
is automatically removed.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Usage
=====

1. Open an opportunity in the CRM pipeline.
2. Fill in the **Expected Proposal Submission Date** field.
3. Save the record — a *"Submit Proposal"* activity is automatically
created in the chatter. Its deadline can be adjusted independently.
4. Clearing the date removes the activity.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/crm/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/crm/issues/new?body=module:%20crm_proposal_due_date%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Ctrl-a

Contributors
------------

- Simon Maillard simon@ogesta.fr

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/crm <https://github.com/OCA/crm/tree/16.0/crm_proposal_due_date>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions crm_proposal_due_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2026 Ctrl-a
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

from . import models
22 changes: 22 additions & 0 deletions crm_proposal_due_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2026 Ctrl-a
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

{
"name": "CRM Proposal Due Date",
"summary": "Track proposal submission date and auto-schedule a dedicated activity",
"version": "16.0.1.0.0",
"development_status": "Alpha",
"category": "Sales/CRM",
"website": "https://github.com/OCA/crm",
"author": "Ctrl-a, Odoo Community Association (OCA)",
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": [
"crm",
],
"data": [
"data/mail_activity_type.xml",
"views/crm_lead_view.xml",
],
}
10 changes: 10 additions & 0 deletions crm_proposal_due_date/data/mail_activity_type.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2026 Ctrl-a
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo noupdate="1">
<record id="mail_activity_type_proposal" model="mail.activity.type">
<field name="name">Submit Proposal</field>
<field name="icon">fa-file-text-o</field>
<field name="res_model">crm.lead</field>
</record>
</odoo>
32 changes: 32 additions & 0 deletions crm_proposal_due_date/i18n/crm_proposal_due_date.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_proposal_due_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: crm_proposal_due_date
#: model:ir.model.fields,field_description:crm_proposal_due_date.field_crm_lead__proposal_due_date
msgid "Expected Proposal Submission Date"
msgstr ""

#. module: crm_proposal_due_date
#: model:ir.model,name:crm_proposal_due_date.model_crm_lead
msgid "Lead/Opportunity"
msgstr ""

#. module: crm_proposal_due_date
#. odoo-python
#: code:addons/crm_proposal_due_date/models/crm_lead.py:0
#: model:mail.activity.type,name:crm_proposal_due_date.mail_activity_type_proposal
#, python-format
msgid "Submit Proposal"
msgstr ""
36 changes: 36 additions & 0 deletions crm_proposal_due_date/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_proposal_due_date
#
# Translators:
# Simon Maillard <simon@ogesta.fr>, 2026
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Simon Maillard <simon@ogesta.fr>\n"
"Language-Team: French <fr@li.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: crm_proposal_due_date
#: model:ir.model.fields,field_description:crm_proposal_due_date.field_crm_lead__proposal_due_date
msgid "Expected Proposal Submission Date"
msgstr "Date prévue de remise de la proposition"

#. module: crm_proposal_due_date
#: model:ir.model,name:crm_proposal_due_date.model_crm_lead
msgid "Lead/Opportunity"
msgstr "Piste/Opportunité"

#. module: crm_proposal_due_date
#. odoo-python
#: code:addons/crm_proposal_due_date/models/crm_lead.py:0
#: model:mail.activity.type,name:crm_proposal_due_date.mail_activity_type_proposal
#, python-format
msgid "Submit Proposal"
msgstr "Remettre la proposition"
4 changes: 4 additions & 0 deletions crm_proposal_due_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2026 Ctrl-a
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

from . import crm_lead
75 changes: 75 additions & 0 deletions crm_proposal_due_date/models/crm_lead.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright 2026 Ctrl-a
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

from odoo import _, api, fields, models

_ACTIVITY_XMLID = "crm_proposal_due_date.mail_activity_type_proposal"


class CrmLead(models.Model):
_inherit = "crm.lead"

proposal_due_date = fields.Date(
string="Expected Proposal Submission Date",
tracking=True,
index=True,
)

# ------------------------------------------------------------------
# CRUD
# ------------------------------------------------------------------

@api.model_create_multi
def create(self, vals_list):
records = super().create(vals_list)
for record in records:
if record.proposal_due_date:
record._sync_proposal_activity()
return records

def write(self, vals):
if "proposal_due_date" not in vals:
return super().write(vals)
# Track which records already had a date before writing
already_set_ids = set(self.filtered("proposal_due_date").ids)
res = super().write(vals)
for record in self:
record._sync_proposal_activity(was_already_set=record.id in already_set_ids)
return res

# ------------------------------------------------------------------
# Helpers
# ------------------------------------------------------------------

def _sync_proposal_activity(self, was_already_set=False):
"""Create or remove the 'Submit Proposal' activity.

The activity deadline is managed independently by the user and is
never overwritten when ``proposal_due_date`` changes.

- First time ``proposal_due_date`` is set: schedule a new activity.
- ``proposal_due_date`` changed (was already set): leave the existing
activity untouched.
- ``proposal_due_date`` cleared: remove any automated activity of this
type.
"""
self.ensure_one()
activity_type = self.env.ref(_ACTIVITY_XMLID, raise_if_not_found=False)
if not activity_type:
return

existing = self.activity_ids.filtered(
lambda a: a.activity_type_id == activity_type and a.automated
)

if not self.proposal_due_date:
existing.unlink()
return

if not existing and not was_already_set:
# Only schedule when the date is set for the first time
self.activity_schedule(
act_type_xmlid=_ACTIVITY_XMLID,
date_deadline=self.proposal_due_date,
summary=_("Submit Proposal"),
)
1 change: 1 addition & 0 deletions crm_proposal_due_date/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Simon Maillard <simon@ogesta.fr>
7 changes: 7 additions & 0 deletions crm_proposal_due_date/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This module extends the CRM *Opportunity* form with an **Expected Proposal
Submission Date** field (``proposal_due_date``).

Whenever this date is set or changed on an opportunity, an activity of type
*"Remettre la proposition"* is automatically scheduled with the same deadline,
giving the responsible salesperson a visible reminder in their activity feed.
If the date is cleared the corresponding activity is automatically removed.
5 changes: 5 additions & 0 deletions crm_proposal_due_date/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Open an opportunity in the CRM pipeline.
2. Fill in the **Expected Proposal Submission Date** field.
3. Save the record — a *"Submit Proposal"* activity is automatically
created in the chatter. Its deadline can be adjusted independently.
4. Clearing the date removes the activity.
Loading
Loading