diff --git a/__init__.py b/__init__.py
index 845ac1b..dc01ee6 100644
--- a/__init__.py
+++ b/__init__.py
@@ -13,6 +13,7 @@ from . import opportunity
from . import company
from . import dash
from . import commission
+from . import chart
def register():
@@ -43,6 +44,7 @@ def register():
dash.AppCRMService,
dash.AppCRMMarketing,
commission.Agent,
+ chart.CRMChart,
module='crm', type_='model')
Pool.register(
customer_service.CustomerServiceReport,
diff --git a/chart.py b/chart.py
new file mode 100644
index 0000000..e5b5fd2
--- /dev/null
+++ b/chart.py
@@ -0,0 +1,18 @@
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
+from trytond.pool import PoolMeta
+
+
+class CRMChart(metaclass=PoolMeta):
+ __name__ = "crm.opportunity"
+
+ @classmethod
+ def report_opportunity_by_agent(cls, args):
+ # Dash Report
+ value = cls._get_check_rooms('departure')
+ today = date.today()
+ res = {
+ 'value': value,
+ 'header_meta': str(today),
+ }
+ return res
diff --git a/dash.xml b/dash.xml
index 7719847..37d233c 100644
--- a/dash.xml
+++ b/dash.xml
@@ -3,43 +3,50 @@
this repository contains the full copyright notices and license terms. -->
-
-
- 1
- th
- internal
-
-
- CRM Sales
- dash.app.crm_sales,1
- True
- crm_sales
-
+
+
+ 1
+ th
+ internal
+
+
+ CRM Sales
+ dash.app.crm_sales,1
+ True
+ crm_sales
+
-
- 1
- key
- internal
-
-
- CRM Service
- dash.app.crm_service,1
- True
- crm_service
-
+
+ 1
+ key
+ internal
+
+
+ CRM Service
+ dash.app.crm_service,1
+ True
+ crm_service
+
-
- 1
- key
- external
-
-
- CRM Marketing
- dash.app.crm_marketing,1
- True
- crm_marketing
-
+
+ 1
+ key
+ external
+
+
+ CRM Marketing
+ dash.app.crm_marketing,1
+ True
+ crm_marketing
+
-
+
+ Opportunity By Agent
+ crm.opportunity
+ table
+ report_opportunity_by_agent
+
+
+
diff --git a/opportunity.py b/opportunity.py
index 4ebddd4..72fc57f 100644
--- a/opportunity.py
+++ b/opportunity.py
@@ -679,9 +679,7 @@ class CrmOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
_history = True
_states = {
'readonly': Eval('opportunity_state').in_([
- 'lead',
- 'opportunity',
- 'accepted',
+ 'won',
'lost',
'cancelled']),
}
diff --git a/tryton.cfg b/tryton.cfg
index 8959e83..439bdd6 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=6.0.12
+version=6.0.13
depends:
party
sale
diff --git a/view/opportunity_line_form.xml b/view/opportunity_line_form.xml
index d375007..6fe5c56 100644
--- a/view/opportunity_line_form.xml
+++ b/view/opportunity_line_form.xml
@@ -5,7 +5,7 @@ this repository contains the full copyright notices and license terms. -->
-
+