diff --git a/addons/auction/wizard/auction_lots_able_view.xml b/addons/auction/wizard/auction_lots_able_view.xml
new file mode 100644
index 00000000000..96135460c72
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_able_view.xml
@@ -0,0 +1,30 @@
+
+
+
+
+ auction.lots.able.form
+ auction.lots.able
+ form
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_lots_auction_move_view.xml b/addons/auction/wizard/auction_lots_auction_move_view.xml
new file mode 100644
index 00000000000..dd116a8bc6c
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_auction_move_view.xml
@@ -0,0 +1,32 @@
+
+
+
+
+ auction.lots.auction.move.form
+ auction.lots.auction.move
+ form
+
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_lots_enable_view.xml b/addons/auction/wizard/auction_lots_enable_view.xml
new file mode 100644
index 00000000000..8384524dad2
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_enable_view.xml
@@ -0,0 +1,34 @@
+
+
+
+
+ auction.lots.enable.form
+ auction.lots.enable
+ form
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_lots_make_invoice_buyer_view.xml b/addons/auction/wizard/auction_lots_make_invoice_buyer_view.xml
new file mode 100644
index 00000000000..ba4aac79ca6
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_make_invoice_buyer_view.xml
@@ -0,0 +1,36 @@
+
+
+
+
+ auction.lots.make.invoice.buyer.form
+ auction.lots.make.invoice.buyer
+ form
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_lots_make_invoice_view.xml b/addons/auction/wizard/auction_lots_make_invoice_view.xml
new file mode 100644
index 00000000000..29ef3e09348
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_make_invoice_view.xml
@@ -0,0 +1,33 @@
+
+
+
+
+ auction.lots.make.invoice.form
+ auction.lots.make.invoice
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_lots_sms_send_view.xml b/addons/auction/wizard/auction_lots_sms_send_view.xml
new file mode 100644
index 00000000000..22aa9d681ac
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_sms_send_view.xml
@@ -0,0 +1,35 @@
+
+
+
+
+ auction.lots.sms.send.form
+ auction.lots.sms.send
+ form
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_pay_buy_view.xml b/addons/auction/wizard/auction_pay_buy_view.xml
new file mode 100644
index 00000000000..0a9a3a6dcee
--- /dev/null
+++ b/addons/auction/wizard/auction_pay_buy_view.xml
@@ -0,0 +1,37 @@
+
+
+
+
+ auction.pay.buy.form
+ auction.pay.buy
+ form
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_pay_sel_view.xml b/addons/auction/wizard/auction_pay_sel_view.xml
new file mode 100644
index 00000000000..2570b7a7a0a
--- /dev/null
+++ b/addons/auction/wizard/auction_pay_sel_view.xml
@@ -0,0 +1,35 @@
+
+
+
+
+ auction.pay.sel.form
+ auction.pay.sel
+ form
+
+
+
+
+
+
+ Pay objects of the seller
+ auction.pay.sel
+ form
+ tree,form
+
+ new
+
+
+
+
diff --git a/addons/auction/wizard/auction_payer_sel_view.xml b/addons/auction/wizard/auction_payer_sel_view.xml
new file mode 100644
index 00000000000..57c43df8fe4
--- /dev/null
+++ b/addons/auction/wizard/auction_payer_sel_view.xml
@@ -0,0 +1,43 @@
+
+
+
+
+ auction.payer.form
+ auction.payer
+ form
+
+
+
+
+
+
+ auction.payer.sel.form
+ auction.payer.sel
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_taken_view.xml b/addons/auction/wizard/auction_taken_view.xml
new file mode 100644
index 00000000000..626caa473ad
--- /dev/null
+++ b/addons/auction/wizard/auction_taken_view.xml
@@ -0,0 +1,42 @@
+
+
+
+
+ auction.taken.form
+ auction.taken
+ form
+
+
+
+
+
+
+ Gestion emporte
+ auction.taken
+ form
+ tree,form
+
+ new
+
+
+
+
+
+
diff --git a/addons/board_crm_configuration/__terp__.py b/addons/board_crm_configuration/__terp__.py
index 3c303ee2d1c..09bd6e25bc1 100644
--- a/addons/board_crm_configuration/__terp__.py
+++ b/addons/board_crm_configuration/__terp__.py
@@ -34,7 +34,7 @@ This module implements a dashboard for CRM that includes:
* Jobs Tracking (graph)
""",
'author': 'Tiny',
- 'depends': ['board', 'crm', 'report_crm'],
+ 'depends': ['board', 'crm'],
'update_xml': ['board_crm_statistical_view.xml', 'board_crm_view.xml'],
'demo_xml': ['board_crm_demo.xml'],
'installable': True,
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 4c1baf99c97..860cd1dba1e 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -621,7 +621,7 @@ class crm_case(osv.osv):
@email: Partner's email ID
"""
if not add:
- return {'value': {'email_from': False, 'partner_name2': False}}
+ return {'value': {'email_from': False}}
address = self.pool.get('res.partner.address').browse(cr, uid, add)
return {'value': {'email_from': address.email}}
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 31a0c4b9f0c..9b034890fed 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -24,7 +24,7 @@ from datetime import datetime, timedelta
import crm
import math
import time
-from mx import DateTime
+import mx.DateTime
from tools.translate import _
class crm_lead(osv.osv):
@@ -32,7 +32,7 @@ class crm_lead(osv.osv):
_name = "crm.lead"
_description = "Leads Cases"
- _order = "priority desc, id desc"
+ _order = "priority, id desc"
_inherit = ['res.partner.address', 'crm.case']
def case_open(self, cr, uid, ids, *args):
@@ -55,36 +55,52 @@ class crm_lead(osv.osv):
@param ids: List of Openday’s IDs
@return: difference between current date and log date
@param context: A standard dictionary for contextual values
- """
- log_obj = self.pool.get('crm.case.log')
- model_obj = self.pool.get('ir.model')
- cal_obj = self.pool.get('resource.calendar')
-
- model_ids = model_obj.search(cr, uid, [('model', '=', self._name)])
- model_id = False
- if len(model_ids):
- model_id = model_ids[0]
+ """
+ cal_obj = self.pool.get('resource.calendar')
+ res_obj = self.pool.get('resource.resource')
res = {}
for lead in self.browse(cr, uid, ids , context):
for field in fields:
res[lead.id] = {}
duration = 0
+ ans = False
if field == 'day_open':
if lead.date_open:
date_create = datetime.strptime(lead.create_date, "%Y-%m-%d %H:%M:%S")
date_open = datetime.strptime(lead.date_open, "%Y-%m-%d %H:%M:%S")
-
ans = date_open - date_create
- duration = float(ans.days) + (float(ans.seconds) / 86400)
-
+ date_until = lead.date_open
elif field == 'day_close':
if lead.date_closed:
date_create = datetime.strptime(lead.create_date, "%Y-%m-%d %H:%M:%S")
date_close = datetime.strptime(lead.date_closed, "%Y-%m-%d %H:%M:%S")
-
+ date_until = lead.date_closed
ans = date_close - date_create
- duration = float(ans.days) + (float(ans.seconds) / 86400)
+ if ans:
+ resource_id = False
+ if lead.user_id:
+ resource_ids = res_obj.search(cr, uid, [('user_id','=',lead.user_id.id)])
+ resource_id = len(resource_ids) or resource_ids[0]
+
+ duration = float(ans.days)
+ if lead.section_id.resource_calendar_id:
+ duration = float(ans.days) * 24
+ new_dates = cal_obj.interval_get(cr,
+ uid,
+ lead.section_id.resource_calendar_id and lead.section_id.resource_calendar_id.id or False,
+ mx.DateTime.strptime(lead.create_date, '%Y-%m-%d %H:%M:%S'),
+ duration,
+ resource=resource_id
+ )
+ no_days = []
+ date_until = mx.DateTime.strptime(date_until, '%Y-%m-%d %H:%M:%S')
+ for in_time, out_time in new_dates:
+ if in_time.date not in no_days:
+ no_days.append(in_time.date)
+ if out_time > date_until:
+ break
+ duration = len(no_days)
res[lead.id][field] = abs(int(duration))
return res
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index dd8373538ba..8ecebf27ec8 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -140,6 +140,7 @@
+
diff --git a/addons/crm/crm_opportunity.py b/addons/crm/crm_opportunity.py
index 58d490346f8..7150abc9de6 100644
--- a/addons/crm/crm_opportunity.py
+++ b/addons/crm/crm_opportunity.py
@@ -24,6 +24,7 @@ from osv import fields,osv,orm
from tools.translate import _
import crm
import time
+import mx.DateTime
AVAILABLE_STATES = [
('draft','New'),
@@ -38,7 +39,7 @@ class crm_opportunity(osv.osv):
_name = "crm.opportunity"
_description = "Opportunity Cases"
- _order = "id desc"
+ _order = "priority,id desc"
_inherit = 'crm.case'
def case_open(self, cr, uid, ids, *args):
@@ -61,36 +62,52 @@ class crm_opportunity(osv.osv):
@param ids: List of Openday’s IDs
@return: difference between current date and log date
@param context: A standard dictionary for contextual values
- """
- log_obj = self.pool.get('crm.case.log')
- model_obj = self.pool.get('ir.model')
- cal_obj = self.pool.get('resource.calendar')
-
- model_ids = model_obj.search(cr, uid, [('model', '=', self._name)])
- model_id = False
- if len(model_ids):
- model_id = model_ids[0]
+ """
+ cal_obj = self.pool.get('resource.calendar')
+ res_obj = self.pool.get('resource.resource')
res = {}
for opportunity in self.browse(cr, uid, ids , context):
for field in fields:
res[opportunity.id] = {}
duration = 0
+ ans = False
if field == 'day_open':
if opportunity.date_open:
date_create = datetime.strptime(opportunity.create_date, "%Y-%m-%d %H:%M:%S")
date_open = datetime.strptime(opportunity.date_open, "%Y-%m-%d %H:%M:%S")
-
ans = date_open - date_create
- duration = float(ans.days) + (float(ans.seconds) / 86400)
-
+ date_until = opportunity.date_open
elif field == 'day_close':
if opportunity.date_closed:
date_create = datetime.strptime(opportunity.create_date, "%Y-%m-%d %H:%M:%S")
date_close = datetime.strptime(opportunity.date_closed, "%Y-%m-%d %H:%M:%S")
-
+ date_until = opportunity.date_closed
ans = date_close - date_create
- duration = float(ans.days) + (float(ans.seconds) / 86400)
+ if ans:
+ resource_id = False
+ if opportunity.user_id:
+ resource_ids = res_obj.search(cr, uid, [('user_id','=',opportunity.user_id.id)])
+ resource_id = len(resource_ids) or resource_ids[0]
+
+ duration = float(ans.days)
+ if opportunity.section_id.resource_calendar_id:
+ duration = float(ans.days) * 24
+ new_dates = cal_obj.interval_get(cr,
+ uid,
+ opportunity.section_id.resource_calendar_id and opportunity.section_id.resource_calendar_id.id or False,
+ mx.DateTime.strptime(opportunity.create_date, '%Y-%m-%d %H:%M:%S'),
+ duration,
+ resource=resource_id
+ )
+ no_days = []
+ date_until = mx.DateTime.strptime(date_until, '%Y-%m-%d %H:%M:%S')
+ for in_time, out_time in new_dates:
+ if in_time.date not in no_days:
+ no_days.append(in_time.date)
+ if out_time > date_until:
+ break
+ duration = len(no_days)
res[opportunity.id][field] = abs(int(duration))
return res
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index e6694215bee..f36f11dfe74 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -220,6 +220,7 @@
+