[MERGE] merged from trunk-dev-addons2
bzr revid: hmo@tinyerp.com-20100927140436-ywejvgzc4kfchzwf
This commit is contained in:
commit
2e41da18b3
|
@ -20,7 +20,6 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
import pooler
|
|
||||||
|
|
||||||
class profile_association_config_install_modules_wizard(osv.osv_memory):
|
class profile_association_config_install_modules_wizard(osv.osv_memory):
|
||||||
_name='profile.association.config.install_modules_wizard'
|
_name='profile.association.config.install_modules_wizard'
|
||||||
|
|
|
@ -19,10 +19,6 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from osv import osv, fields
|
|
||||||
from tools.translate import _
|
|
||||||
import pooler
|
|
||||||
import tools
|
|
||||||
import time
|
import time
|
||||||
from document import nodes
|
from document import nodes
|
||||||
import StringIO
|
import StringIO
|
||||||
|
@ -141,7 +137,6 @@ class node_calendar(nodes.node_class):
|
||||||
return str(result)
|
return str(result)
|
||||||
|
|
||||||
def _get_dav_dropbox_home_URL(self, cr):
|
def _get_dav_dropbox_home_URL(self, cr):
|
||||||
import xml.dom.minidom
|
|
||||||
import urllib
|
import urllib
|
||||||
uid = self.context.uid
|
uid = self.context.uid
|
||||||
ctx = self.context.context.copy()
|
ctx = self.context.context.copy()
|
||||||
|
@ -153,7 +148,6 @@ class node_calendar(nodes.node_class):
|
||||||
return url
|
return url
|
||||||
|
|
||||||
def _get_dav_notification_URL(self, cr):
|
def _get_dav_notification_URL(self, cr):
|
||||||
import xml.dom.minidom
|
|
||||||
import urllib
|
import urllib
|
||||||
uid = self.context.uid
|
uid = self.context.uid
|
||||||
ctx = self.context.context.copy()
|
ctx = self.context.context.copy()
|
||||||
|
@ -308,7 +302,8 @@ class node_calendar(nodes.node_class):
|
||||||
calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx)
|
calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx)
|
||||||
return calendar.description
|
return calendar.description
|
||||||
|
|
||||||
def _get_dav_principal_collection_set(self, uri):
|
def _get_dav_principal_collection_set(self, cr):
|
||||||
|
import xml
|
||||||
import urllib
|
import urllib
|
||||||
uid = self.context.uid
|
uid = self.context.uid
|
||||||
ctx = self.context.context.copy()
|
ctx = self.context.context.copy()
|
||||||
|
@ -341,7 +336,6 @@ class node_calendar(nodes.node_class):
|
||||||
|
|
||||||
def _get_caldav_calendar_user_address_set(self, cr):
|
def _get_caldav_calendar_user_address_set(self, cr):
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
dirobj = self.context._dirobj
|
|
||||||
uid = self.context.uid
|
uid = self.context.uid
|
||||||
ctx = self.context.context.copy()
|
ctx = self.context.context.copy()
|
||||||
ctx.update(self.dctx)
|
ctx.update(self.dctx)
|
||||||
|
@ -410,7 +404,6 @@ class res_node_calendar(nodes.node_class):
|
||||||
self.res_id = res_id
|
self.res_id = res_id
|
||||||
|
|
||||||
def open(self, cr, mode=False):
|
def open(self, cr, mode=False):
|
||||||
uid = self.context.uid
|
|
||||||
if self.type in ('collection','database'):
|
if self.type in ('collection','database'):
|
||||||
return False
|
return False
|
||||||
s = StringIO.StringIO(self.get_data(cr))
|
s = StringIO.StringIO(self.get_data(cr))
|
||||||
|
|
|
@ -293,7 +293,6 @@ class CalDAV(object):
|
||||||
|
|
||||||
att_data = []
|
att_data = []
|
||||||
exdates = []
|
exdates = []
|
||||||
_server_tzinfo = pytz.timezone(tools.get_server_timezone())
|
|
||||||
|
|
||||||
for cal_data in child.getChildren():
|
for cal_data in child.getChildren():
|
||||||
if cal_data.name.lower() == 'organizer':
|
if cal_data.name.lower() == 'organizer':
|
||||||
|
@ -521,7 +520,7 @@ class CalDAV(object):
|
||||||
ical = vobject.iCalendar()
|
ical = vobject.iCalendar()
|
||||||
self.create_ics(cr, uid, datas, vobj, ical, context=context)
|
self.create_ics(cr, uid, datas, vobj, ical, context=context)
|
||||||
return ical
|
return ical
|
||||||
except Exception, e:
|
except:
|
||||||
raise # osv.except_osv(('Error !'), (str(e)))
|
raise # osv.except_osv(('Error !'), (str(e)))
|
||||||
|
|
||||||
def import_cal(self, cr, uid, content, data_id=None, context=None):
|
def import_cal(self, cr, uid, content, data_id=None, context=None):
|
||||||
|
@ -654,7 +653,7 @@ class Calendar(CalDAV, osv.osv):
|
||||||
data_id = self.search(cr, uid, [])[0]
|
data_id = self.search(cr, uid, [])[0]
|
||||||
cal = self.browse(cr, uid, data_id, context=context)
|
cal = self.browse(cr, uid, data_id, context=context)
|
||||||
cal_children = {}
|
cal_children = {}
|
||||||
count = 0
|
|
||||||
for line in cal.line_ids:
|
for line in cal.line_ids:
|
||||||
cal_children[line.name] = line.object_id.model
|
cal_children[line.name] = line.object_id.model
|
||||||
objs = []
|
objs = []
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from datetime import datetime
|
|
||||||
from datetime import timedelta
|
|
||||||
import base64
|
import base64
|
||||||
import tools
|
import tools
|
||||||
from osv import fields
|
from osv import fields
|
||||||
|
@ -431,7 +429,7 @@ class crm_case(object):
|
||||||
|
|
||||||
# Send an email
|
# Send an email
|
||||||
subject = "Reminder: [%s] %s" % (str(case.id), case.name, )
|
subject = "Reminder: [%s] %s" % (str(case.id), case.name, )
|
||||||
flag = tools.email_send(
|
tools.email_send(
|
||||||
src,
|
src,
|
||||||
[dest],
|
[dest],
|
||||||
subject,
|
subject,
|
||||||
|
|
|
@ -20,12 +20,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
from operator import itemgetter
|
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
import netsvc
|
|
||||||
import os
|
|
||||||
import pooler
|
|
||||||
import tools
|
|
||||||
|
|
||||||
class crm_installer(osv.osv_memory):
|
class crm_installer(osv.osv_memory):
|
||||||
_name = 'crm.installer'
|
_name = 'crm.installer'
|
||||||
|
|
|
@ -45,7 +45,6 @@ class crm_lead_report(osv.osv):
|
||||||
@param context: A standard dictionary for contextual values """
|
@param context: A standard dictionary for contextual values """
|
||||||
|
|
||||||
res = {}
|
res = {}
|
||||||
state_perc = 0.0
|
|
||||||
avg_ans = 0.0
|
avg_ans = 0.0
|
||||||
|
|
||||||
for case in self.browse(cr, uid, ids, context):
|
for case in self.browse(cr, uid, ids, context):
|
||||||
|
|
|
@ -204,7 +204,7 @@
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="context">{'search_default_filter_lead': 1, 'search_default_lead':1, "search_default_user":1,"search_default_this_month":1,'group_by_no_leaf':1,'group_by':[]}</field>
|
<field name="context">{'search_default_filter_lead': 1, 'search_default_lead':1, "search_default_user":1,"search_default_this_month":1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||||
<field name="view_mode">tree,graph</field>
|
<field name="view_mode">tree,graph</field>
|
||||||
<field name="domain">[]</field>
|
<field name="domain">[('type', '=', 'lead')]</field>
|
||||||
<field name="help">Leads Analysis allows you to consult different informations relative to CRM. Check for treatments delays, number of responses given and emails send. You can sort out your leads analysis on different groups to get fine grained analysis.</field>
|
<field name="help">Leads Analysis allows you to consult different informations relative to CRM. Check for treatments delays, number of responses given and emails send. You can sort out your leads analysis on different groups to get fine grained analysis.</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="context">{"search_default_filter_opportunity":1, "search_default_opportunity": 1, "search_default_user":1,"search_default_this_month":1,'group_by_no_leaf':1,'group_by':[]}</field>
|
<field name="context">{"search_default_filter_opportunity":1, "search_default_opportunity": 1, "search_default_user":1,"search_default_this_month":1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||||
<field name="view_mode">tree,graph</field>
|
<field name="view_mode">tree,graph</field>
|
||||||
<field name="domain">[]</field>
|
<field name="domain">[('type', '=', 'opportunity')]</field>
|
||||||
<field name="help">Opportunities Analysis menu gives you an instant access to your opportunities like expected revenue, planned cost, overpassed deadline or the number of exchanges by opportunity.</field>
|
<field name="help">Opportunities Analysis menu gives you an instant access to your opportunities like expected revenue, planned cost, overpassed deadline or the number of exchanges by opportunity.</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from mx.DateTime import now
|
|
||||||
from osv import osv, fields
|
from osv import osv, fields
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
|
|
||||||
|
@ -70,8 +69,6 @@ class crm_lead2opportunity(osv.osv_memory):
|
||||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||||
|
|
||||||
lead = lead_obj.browse(cr, uid, record_id, context=context)
|
lead = lead_obj.browse(cr, uid, record_id, context=context)
|
||||||
model_ids = model_obj.search(cr, uid, [('model', '=', 'crm.lead')])
|
|
||||||
|
|
||||||
|
|
||||||
for this in self.browse(cr, uid, ids, context=context):
|
for this in self.browse(cr, uid, ids, context=context):
|
||||||
vals ={
|
vals ={
|
||||||
|
@ -144,7 +141,6 @@ Leads Could not convert into Opportunity"))
|
||||||
@return : default values of fields.
|
@return : default values of fields.
|
||||||
"""
|
"""
|
||||||
lead_obj = self.pool.get('crm.lead')
|
lead_obj = self.pool.get('crm.lead')
|
||||||
rec_ids = context and context.get('active_ids', [])
|
|
||||||
data = context and context.get('active_ids', []) or []
|
data = context and context.get('active_ids', []) or []
|
||||||
res = super(crm_lead2opportunity, self).default_get(cr, uid, fields, context=context)
|
res = super(crm_lead2opportunity, self).default_get(cr, uid, fields, context=context)
|
||||||
for lead in lead_obj.browse(cr, uid, data, context=context):
|
for lead in lead_obj.browse(cr, uid, data, context=context):
|
||||||
|
@ -181,7 +177,6 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
||||||
lead_obj = self.pool.get('crm.lead')
|
lead_obj = self.pool.get('crm.lead')
|
||||||
partner_obj = self.pool.get('res.partner')
|
partner_obj = self.pool.get('res.partner')
|
||||||
contact_obj = self.pool.get('res.partner.address')
|
contact_obj = self.pool.get('res.partner.address')
|
||||||
rec_ids = context and context.get('active_ids', [])
|
|
||||||
partner_id = False
|
partner_id = False
|
||||||
|
|
||||||
data = context and context.get('active_ids', []) or []
|
data = context and context.get('active_ids', []) or []
|
||||||
|
@ -219,7 +214,6 @@ class crm_lead2opportunity_partner(osv.osv_memory):
|
||||||
partner_ids = self._create_partner(cr, uid, ids, context)
|
partner_ids = self._create_partner(cr, uid, ids, context)
|
||||||
mod_obj = self.pool.get('ir.model.data')
|
mod_obj = self.pool.get('ir.model.data')
|
||||||
result = mod_obj._get_id(cr, uid, 'base', 'view_res_partner_filter')
|
result = mod_obj._get_id(cr, uid, 'base', 'view_res_partner_filter')
|
||||||
res = mod_obj.read(cr, uid, result, ['res_id'])
|
|
||||||
value = {}
|
value = {}
|
||||||
data_obj = self.pool.get('ir.model.data')
|
data_obj = self.pool.get('ir.model.data')
|
||||||
data_id = data_obj._get_id(cr, uid, 'crm', 'view_crm_lead2opportunity_action')
|
data_id = data_obj._get_id(cr, uid, 'crm', 'view_crm_lead2opportunity_action')
|
||||||
|
|
|
@ -131,8 +131,8 @@ class crm_send_new_email(osv.osv_memory):
|
||||||
x_headers=x_headers
|
x_headers=x_headers
|
||||||
)
|
)
|
||||||
|
|
||||||
if not flag:
|
# if not flag:
|
||||||
raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))
|
# raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))
|
||||||
|
|
||||||
msg_dict = {'new': 'Send', 'reply': 'Reply', 'forward': 'Forward'}
|
msg_dict = {'new': 'Send', 'reply': 'Reply', 'forward': 'Forward'}
|
||||||
case_pool.history(cr, uid, [case], _(msg_dict[context.get('mail', 'new')]), history=True, \
|
case_pool.history(cr, uid, [case], _(msg_dict[context.get('mail', 'new')]), history=True, \
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from osv import fields, osv, orm
|
from osv import fields, osv
|
||||||
from crm import crm
|
from crm import crm
|
||||||
|
|
||||||
class crm_fundraising(crm.crm_case, osv.osv):
|
class crm_fundraising(crm.crm_case, osv.osv):
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<field name="user_id" position="after">
|
<field name="user_id" position="after">
|
||||||
<group colspan="4" col="4">
|
<group colspan="4" col="4">
|
||||||
<separator colspan="4" string="Invoicing Data"/>
|
<separator colspan="4" string="Invoicing Data"/>
|
||||||
<field name="pricelist_id"/>
|
<field name="pricelist_id" domain="[('type','=','sale')]" widget="selection"/>
|
||||||
<field name="to_invoice" widget="selection" />
|
<field name="to_invoice" widget="selection" />
|
||||||
<field name="amount_max"/>
|
<field name="amount_max"/>
|
||||||
<field name="amount_invoiced"/>
|
<field name="amount_invoiced"/>
|
||||||
|
|
|
@ -28,7 +28,6 @@ from itertools import groupby
|
||||||
from tools.misc import flatten
|
from tools.misc import flatten
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
from tools import email_send as email
|
|
||||||
|
|
||||||
|
|
||||||
class project_task_type(osv.osv):
|
class project_task_type(osv.osv):
|
||||||
|
@ -245,7 +244,6 @@ class project(osv.osv):
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
|
|
||||||
task_obj = self.pool.get('project.task')
|
|
||||||
proj = self.browse(cr, uid, id, context=context)
|
proj = self.browse(cr, uid, id, context=context)
|
||||||
default = default or {}
|
default = default or {}
|
||||||
context['active_test'] = False
|
context['active_test'] = False
|
||||||
|
@ -261,7 +259,6 @@ class project(osv.osv):
|
||||||
context = {}
|
context = {}
|
||||||
project_obj = self.pool.get('project.project')
|
project_obj = self.pool.get('project.project')
|
||||||
data_obj = self.pool.get('ir.model.data')
|
data_obj = self.pool.get('ir.model.data')
|
||||||
task_obj = self.pool.get('project.task')
|
|
||||||
result = []
|
result = []
|
||||||
for proj in self.browse(cr, uid, ids, context=context):
|
for proj in self.browse(cr, uid, ids, context=context):
|
||||||
parent_id = context.get('parent_id', False)
|
parent_id = context.get('parent_id', False)
|
||||||
|
@ -279,8 +276,7 @@ class project(osv.osv):
|
||||||
'date':new_date_end,
|
'date':new_date_end,
|
||||||
'parent_id':parent_id}, context=context)
|
'parent_id':parent_id}, context=context)
|
||||||
result.append(new_id)
|
result.append(new_id)
|
||||||
cr.execute('select id from project_task where project_id=%s', (proj.id,))
|
|
||||||
res = cr.fetchall()
|
|
||||||
child_ids = self.search(cr, uid, [('parent_id','=', proj.analytic_account_id.id)], context=context)
|
child_ids = self.search(cr, uid, [('parent_id','=', proj.analytic_account_id.id)], context=context)
|
||||||
parent_id = self.read(cr, uid, new_id, ['analytic_account_id'])['analytic_account_id'][0]
|
parent_id = self.read(cr, uid, new_id, ['analytic_account_id'])['analytic_account_id'][0]
|
||||||
if child_ids:
|
if child_ids:
|
||||||
|
@ -320,7 +316,7 @@ class project(osv.osv):
|
||||||
if child_ids:
|
if child_ids:
|
||||||
self.setActive(cr, uid, child_ids, value, context=None)
|
self.setActive(cr, uid, child_ids, value, context=None)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
project()
|
project()
|
||||||
|
|
||||||
class users(osv.osv):
|
class users(osv.osv):
|
||||||
|
|
|
@ -59,7 +59,13 @@
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
<page string="Members">
|
<page string="Members">
|
||||||
<field colspan="4" name="members" nolabel="1"/>
|
<field colspan="4" name="members" nolabel="1">
|
||||||
|
<tree string="Members">
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="user_email"/>
|
||||||
|
<field name="address_id"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
</page>
|
</page>
|
||||||
<page groups="base.group_extended" string="Partner Info">
|
<page groups="base.group_extended" string="Partner Info">
|
||||||
<field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id)" select="1"/>
|
<field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id)" select="1"/>
|
||||||
|
|
|
@ -19,11 +19,9 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import time
|
|
||||||
|
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
|
import tools
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
from tools import email_send as email
|
|
||||||
|
|
||||||
class project_task_close(osv.osv_memory):
|
class project_task_close(osv.osv_memory):
|
||||||
"""
|
"""
|
||||||
|
@ -47,7 +45,6 @@ class project_task_close(osv.osv_memory):
|
||||||
context = {}
|
context = {}
|
||||||
record_id = context and context.get('active_id', False) or False
|
record_id = context and context.get('active_id', False) or False
|
||||||
task_pool = self.pool.get('project.task')
|
task_pool = self.pool.get('project.task')
|
||||||
project_pool = self.pool.get('project.project')
|
|
||||||
|
|
||||||
res = super(project_task_close, self).default_get(cr, uid, fields, context=context)
|
res = super(project_task_close, self).default_get(cr, uid, fields, context=context)
|
||||||
task = task_pool.browse(cr, uid, record_id, context=context)
|
task = task_pool.browse(cr, uid, record_id, context=context)
|
||||||
|
@ -77,41 +74,41 @@ class project_task_close(osv.osv_memory):
|
||||||
return {}
|
return {}
|
||||||
task = task_pool.browse(cr, uid, task_id, context=context)
|
task = task_pool.browse(cr, uid, task_id, context=context)
|
||||||
for data in self.browse(cr, uid, ids, context=context):
|
for data in self.browse(cr, uid, ids, context=context):
|
||||||
if res:
|
# Send Warn Message by Email to Manager and Customer
|
||||||
# Send Warn Message by Email to Manager and Customer
|
if data.manager_warn and not data.manager_email:
|
||||||
if data.manager_warn and not data.manager_email:
|
raise osv.except_osv(_('Error'), _("Please specify the email address of Project Manager."))
|
||||||
raise osv.except_osv(_('Error'), _("Please specify the email address of Project Manager."))
|
|
||||||
|
|
||||||
elif data.partner_warn and not data.partner_email:
|
elif data.partner_warn and not data.partner_email:
|
||||||
raise osv.except_osv(_('Error'), _("Please specify the email address of Customer."))
|
raise osv.except_osv(_('Error'), _("Please specify the email address of Customer."))
|
||||||
|
|
||||||
elif data.manager_warn or data.partner_warn:
|
elif data.manager_warn or data.partner_warn:
|
||||||
project = task.project_id
|
project = task.project_id
|
||||||
subject = _("Task '%s' Closed") % task.name
|
subject = _("Task '%s' Closed") % task.name
|
||||||
if task.user_id and task.user_id.address_id and task.user_id.address_id.email:
|
if task.user_id and task.user_id.address_id and task.user_id.address_id.email:
|
||||||
from_adr = task.user_id.address_id.email
|
from_adr = task.user_id.address_id.email
|
||||||
signature = task.user_id.signature
|
signature = task.user_id.signature
|
||||||
else:
|
else:
|
||||||
raise osv.except_osv(_('Error'), _("Couldn't send mail because your email address is not configured!"))
|
raise osv.except_osv(_('Error'), _("Couldn't send mail because your email address is not configured!"))
|
||||||
val = {
|
val = {
|
||||||
'name': task.name,
|
'name': task.name,
|
||||||
'user_id': task.user_id.name,
|
'user_id': task.user_id.name,
|
||||||
'task_id': "%d/%d" % (project.id, task.id),
|
'task_id': "%d/%d" % (project.id, task.id),
|
||||||
'date_start': task.date_start,
|
'date_start': task.date_start,
|
||||||
'date_end': task.date_end,
|
'date_end': task.date_end,
|
||||||
'state': task.state
|
'state': task.state
|
||||||
}
|
}
|
||||||
|
|
||||||
header = (project.warn_header or '') % val
|
to_adr = []
|
||||||
footer = (project.warn_footer or '') % val
|
header = (project.warn_header or '') % val
|
||||||
body = u'%s\n%s\n%s\n\n-- \n%s' % (header, description, footer, signature)
|
footer = (project.warn_footer or '') % val
|
||||||
if data.manager_warn and data.manager_email:
|
body = u'%s\n%s\n%s\n\n-- \n%s' % (header, task.description, footer, signature)
|
||||||
to_adr.append(data.manager_email)
|
if data.manager_warn and data.manager_email:
|
||||||
if data.partner_warn and data.partner_email:
|
to_adr.append(data.manager_email)
|
||||||
to_adr.append(data.partner_email)
|
if data.partner_warn and data.partner_email:
|
||||||
mail_id = email(from_adr, to_adr, subject, tools.ustr(body), email_bcc=[from_adr])
|
to_adr.append(data.partner_email)
|
||||||
if not mail_id:
|
mail_id = tools.email_send(from_adr, to_adr, subject, tools.ustr(body), email_bcc=[from_adr])
|
||||||
raise osv.except_osv(_('Error'), _("Couldn't send mail! Check the email ids and smtp configuration settings"))
|
if not mail_id:
|
||||||
|
raise osv.except_osv(_('Error'), _("Couldn't send mail! Check the email ids and smtp configuration settings"))
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
project_task_close()
|
project_task_close()
|
||||||
|
|
|
@ -48,9 +48,6 @@ class project_task_delegate(osv.osv_memory):
|
||||||
record_id = context and context.get('active_id', False) or False
|
record_id = context and context.get('active_id', False) or False
|
||||||
task_pool = self.pool.get('project.task')
|
task_pool = self.pool.get('project.task')
|
||||||
task = task_pool.browse(cr, uid, record_id, context=context)
|
task = task_pool.browse(cr, uid, record_id, context=context)
|
||||||
project = task.project_id
|
|
||||||
manager = project.user_id or False
|
|
||||||
partner = task.partner_id or task.project_id.partner_id
|
|
||||||
|
|
||||||
if 'name' in fields:
|
if 'name' in fields:
|
||||||
if task.name.startswith(_('CHECK: ')):
|
if task.name.startswith(_('CHECK: ')):
|
||||||
|
|
|
@ -22,16 +22,9 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
import ir
|
|
||||||
import tools
|
import tools
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
|
|
||||||
try:
|
|
||||||
from lxml import etree
|
|
||||||
except ImportError:
|
|
||||||
sys.stderr.write("ERROR: Import lxml module\n")
|
|
||||||
sys.stderr.write("ERROR: Try to install the python-lxml package\n")
|
|
||||||
|
|
||||||
class project_gtd_context(osv.osv):
|
class project_gtd_context(osv.osv):
|
||||||
_name = "project.gtd.context"
|
_name = "project.gtd.context"
|
||||||
_description = "Context"
|
_description = "Context"
|
||||||
|
|
|
@ -19,21 +19,15 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import base64
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import time
|
|
||||||
from datetime import datetime, timedelta
|
|
||||||
import binascii
|
|
||||||
import collections
|
|
||||||
|
|
||||||
import tools
|
|
||||||
from crm import crm
|
from crm import crm
|
||||||
from osv import fields,osv,orm
|
from datetime import datetime
|
||||||
from osv.orm import except_orm
|
from osv import fields,osv
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
|
import binascii
|
||||||
|
import time
|
||||||
import tools
|
import tools
|
||||||
|
|
||||||
|
|
||||||
class project_issue(crm.crm_case, osv.osv):
|
class project_issue(crm.crm_case, osv.osv):
|
||||||
_name = "project.issue"
|
_name = "project.issue"
|
||||||
_description = "Project Issue"
|
_description = "Project Issue"
|
||||||
|
|
|
@ -44,7 +44,6 @@ class project_issue_report(osv.osv):
|
||||||
@param context: A standard dictionary for contextual values """
|
@param context: A standard dictionary for contextual values """
|
||||||
|
|
||||||
res = {}
|
res = {}
|
||||||
avg_ans = 0.0
|
|
||||||
|
|
||||||
for report in self.browse(cr, uid, ids, context):
|
for report in self.browse(cr, uid, ids, context):
|
||||||
res[report.id]= {
|
res[report.id]= {
|
||||||
|
|
|
@ -19,8 +19,7 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import time
|
from datetime import datetime
|
||||||
from datetime import date, datetime, timedelta
|
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
from resource.faces import task as Task
|
from resource.faces import task as Task
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import datetime
|
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
|
|
||||||
|
@ -38,7 +37,6 @@ class project_compute_phases(osv.osv_memory):
|
||||||
}
|
}
|
||||||
|
|
||||||
def check_selection(self, cr, uid, ids, context=None):
|
def check_selection(self, cr, uid, ids, context=None):
|
||||||
data_select = self.read(cr, uid, ids, ['target_project'])[0]
|
|
||||||
return self.compute_date(cr, uid, ids, context=context)
|
return self.compute_date(cr, uid, ids, context=context)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,8 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
from tools.translate import _
|
|
||||||
from osv import osv, fields
|
from osv import osv, fields
|
||||||
|
|
||||||
|
|
||||||
class project_compute_tasks(osv.osv_memory):
|
class project_compute_tasks(osv.osv_memory):
|
||||||
_name = 'project.compute.tasks'
|
_name = 'project.compute.tasks'
|
||||||
_description = 'Project Compute Tasks'
|
_description = 'Project Compute Tasks'
|
||||||
|
|
|
@ -19,9 +19,8 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import datetime
|
|
||||||
from tools.translate import _
|
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
|
|
||||||
class project_schedule_task(osv.osv_memory):
|
class project_schedule_task(osv.osv_memory):
|
||||||
_name = "project.schedule.tasks"
|
_name = "project.schedule.tasks"
|
||||||
_description = 'project.schedule.tasks'
|
_description = 'project.schedule.tasks'
|
||||||
|
|
|
@ -18,14 +18,13 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import time
|
|
||||||
from mx import DateTime
|
from mx import DateTime
|
||||||
|
from osv import fields, osv
|
||||||
import netsvc
|
|
||||||
from osv import fields, osv, orm
|
|
||||||
import re
|
|
||||||
import tools
|
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
|
import re
|
||||||
|
import time
|
||||||
|
import tools
|
||||||
|
|
||||||
|
|
||||||
class project_scrum_project(osv.osv):
|
class project_scrum_project(osv.osv):
|
||||||
_inherit = 'project.project'
|
_inherit = 'project.project'
|
||||||
|
@ -333,7 +332,6 @@ class project_scrum_meeting(osv.osv):
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
meeting_id = self.browse(cr, uid, ids)[0]
|
meeting_id = self.browse(cr, uid, ids)[0]
|
||||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
|
||||||
if meeting_id and meeting_id.sprint_id.scrum_master_id.user_email:
|
if meeting_id and meeting_id.sprint_id.scrum_master_id.user_email:
|
||||||
res = self.email_send(cr, uid, ids, meeting_id.sprint_id.scrum_master_id.user_email)
|
res = self.email_send(cr, uid, ids, meeting_id.sprint_id.scrum_master_id.user_email)
|
||||||
if not res:
|
if not res:
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
""",
|
""",
|
||||||
'author': 'OpenERP SA',
|
'author': 'OpenERP SA',
|
||||||
'website': 'http://www.openerp.com',
|
'website': 'http://www.openerp.com',
|
||||||
'depends': ['base', 'project', 'hr_timesheet_sheet'],
|
'depends': ['base', 'project', 'hr_timesheet_sheet', 'hr_timesheet_invoice'],
|
||||||
'init_xml': [],
|
'init_xml': [],
|
||||||
'update_xml': ["security/ir.model.access.csv","process/project_timesheet_process.xml", "report/task_report_view.xml"],
|
'update_xml': ["security/ir.model.access.csv","process/project_timesheet_process.xml", "report/task_report_view.xml", "project_timesheet_view.xml"],
|
||||||
'demo_xml': [],
|
'demo_xml': [],
|
||||||
'test': [
|
'test': [
|
||||||
'test/worktask_entry_to_timesheetline_entry.yml',
|
'test/worktask_entry_to_timesheetline_entry.yml',
|
||||||
|
|
|
@ -205,21 +205,4 @@ class task(osv.osv):
|
||||||
return super(task,self).write(cr, uid, ids, vals, context)
|
return super(task,self).write(cr, uid, ids, vals, context)
|
||||||
|
|
||||||
task()
|
task()
|
||||||
|
|
||||||
class project_project(osv.osv):
|
|
||||||
_inherit = "project.project"
|
|
||||||
|
|
||||||
def name_get(self, cr, user, ids, context=None):
|
|
||||||
if context is None:
|
|
||||||
context = {}
|
|
||||||
result = []
|
|
||||||
if ids and not isinstance(ids, list):
|
|
||||||
ids = [ids]
|
|
||||||
for project in self.browse(cr, user, ids, context):
|
|
||||||
name = "[%s] %s" % (project.analytic_account_id and project.analytic_account_id.code or '?', project.name)
|
|
||||||
result.append((project.id, name))
|
|
||||||
return result
|
|
||||||
|
|
||||||
project_project()
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<openerp>
|
||||||
|
<data>
|
||||||
|
<record id="project_invoice_form" model="ir.ui.view">
|
||||||
|
<field name="name">Inherit project form : Invoicing Data</field>
|
||||||
|
<field name="model">project.project</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="inherit_id" ref="project.edit_project"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="warn_customer" position="after">
|
||||||
|
<group colspan="4" col="4">
|
||||||
|
<separator colspan="4" string="Invoicing Data"/>
|
||||||
|
<field name="pricelist_id" domain="[('type','=','sale')]" widget="selection"/>
|
||||||
|
<field name="to_invoice" widget="selection"/>
|
||||||
|
<field name="amount_max"/>
|
||||||
|
<field name="amount_invoiced"/>
|
||||||
|
</group>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="project_invoice_search" model="ir.ui.view">
|
||||||
|
<field name="name">Inherit project search view : Invoicing Data</field>
|
||||||
|
<field name="model">project.project</field>
|
||||||
|
<field name="type">search</field>
|
||||||
|
<field name="inherit_id" ref="project.view_project_project_filter"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr='//filter[@string="Member"]' position='after'>
|
||||||
|
<separator orientation="vertical"/>
|
||||||
|
<filter icon="terp-camera_test" string="Billable" domain="[('to_invoice','!=', False)]" help="Billable Project"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</openerp>
|
|
@ -20,13 +20,12 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import time
|
|
||||||
import math
|
import math
|
||||||
from faces import *
|
from faces import *
|
||||||
from new import classobj
|
from new import classobj
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
import tools
|
|
||||||
class resource_calendar(osv.osv):
|
class resource_calendar(osv.osv):
|
||||||
_name = "resource.calendar"
|
_name = "resource.calendar"
|
||||||
_description = "Resource Calendar"
|
_description = "Resource Calendar"
|
||||||
|
@ -63,7 +62,6 @@ class resource_calendar(osv.osv):
|
||||||
dt_leave = self._get_leaves(cr, uid, id, resource)
|
dt_leave = self._get_leaves(cr, uid, id, resource)
|
||||||
dt_leave.reverse()
|
dt_leave.reverse()
|
||||||
todo = hours
|
todo = hours
|
||||||
cycle = 0
|
|
||||||
result = []
|
result = []
|
||||||
maxrecur = 100
|
maxrecur = 100
|
||||||
current_hour = dt_from.hour
|
current_hour = dt_from.hour
|
||||||
|
@ -100,7 +98,6 @@ class resource_calendar(osv.osv):
|
||||||
return [(dt_from, dt_from + timedelta(hours=td))]
|
return [(dt_from, dt_from + timedelta(hours=td))]
|
||||||
dt_leave = self._get_leaves(cr, uid, id, resource)
|
dt_leave = self._get_leaves(cr, uid, id, resource)
|
||||||
todo = hours
|
todo = hours
|
||||||
cycle = 0
|
|
||||||
result = []
|
result = []
|
||||||
maxrecur = 100
|
maxrecur = 100
|
||||||
current_hour = dt_from.hour
|
current_hour = dt_from.hour
|
||||||
|
@ -131,7 +128,6 @@ class resource_calendar(osv.osv):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def interval_hours_get(self, cr, uid, id, dt_from, dt_to, resource=False):
|
def interval_hours_get(self, cr, uid, id, dt_from, dt_to, resource=False):
|
||||||
result = []
|
|
||||||
if not id:
|
if not id:
|
||||||
return 0.0
|
return 0.0
|
||||||
dt_leave = self._get_leaves(cr, uid, id, resource)
|
dt_leave = self._get_leaves(cr, uid, id, resource)
|
||||||
|
|
|
@ -19,15 +19,14 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import time
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
|
|
||||||
import netsvc
|
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
from tools import config
|
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
import decimal_precision as dp
|
import decimal_precision as dp
|
||||||
|
import netsvc
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
class sale_shop(osv.osv):
|
class sale_shop(osv.osv):
|
||||||
_name = "sale.shop"
|
_name = "sale.shop"
|
||||||
|
@ -533,7 +532,6 @@ class sale_order(osv.osv):
|
||||||
def action_cancel(self, cr, uid, ids, context=None):
|
def action_cancel(self, cr, uid, ids, context=None):
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
ok = True
|
|
||||||
sale_order_line_obj = self.pool.get('sale.order.line')
|
sale_order_line_obj = self.pool.get('sale.order.line')
|
||||||
for sale in self.browse(cr, uid, ids, context=context):
|
for sale in self.browse(cr, uid, ids, context=context):
|
||||||
for pick in sale.picking_ids:
|
for pick in sale.picking_ids:
|
||||||
|
@ -562,7 +560,6 @@ class sale_order(osv.osv):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def action_wait(self, cr, uid, ids, *args):
|
def action_wait(self, cr, uid, ids, *args):
|
||||||
product_obj = self.pool.get('product.product')
|
|
||||||
for o in self.browse(cr, uid, ids):
|
for o in self.browse(cr, uid, ids):
|
||||||
if (o.order_policy == 'manual'):
|
if (o.order_policy == 'manual'):
|
||||||
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': time.strftime('%Y-%m-%d')})
|
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': time.strftime('%Y-%m-%d')})
|
||||||
|
@ -637,7 +634,6 @@ class sale_order(osv.osv):
|
||||||
if line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu'):
|
if line.product_id and line.product_id.product_tmpl_id.type in ('product', 'consu'):
|
||||||
location_id = order.shop_id.warehouse_id.lot_stock_id.id
|
location_id = order.shop_id.warehouse_id.lot_stock_id.id
|
||||||
if not picking_id:
|
if not picking_id:
|
||||||
loc_dest_id = order.partner_id.property_stock_customer.id
|
|
||||||
pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out')
|
pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out')
|
||||||
picking_id = self.pool.get('stock.picking').create(cr, uid, {
|
picking_id = self.pool.get('stock.picking').create(cr, uid, {
|
||||||
'name': pick_name,
|
'name': pick_name,
|
||||||
|
@ -1044,7 +1040,6 @@ class sale_order_line(osv.osv):
|
||||||
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
|
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
|
||||||
if update_tax: #The quantity only have changed
|
if update_tax: #The quantity only have changed
|
||||||
result['delay'] = (product_obj.sale_delay or 0.0)
|
result['delay'] = (product_obj.sale_delay or 0.0)
|
||||||
partner = partner_obj.browse(cr, uid, partner_id)
|
|
||||||
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)
|
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)
|
||||||
result.update({'type': product_obj.procure_method})
|
result.update({'type': product_obj.procure_method})
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,6 @@ class crm_make_sale(osv.osv_memory):
|
||||||
if not context:
|
if not context:
|
||||||
context = {}
|
context = {}
|
||||||
|
|
||||||
mod_obj = self.pool.get('ir.model.data')
|
|
||||||
case_obj = self.pool.get('crm.lead')
|
case_obj = self.pool.get('crm.lead')
|
||||||
sale_obj = self.pool.get('sale.order')
|
sale_obj = self.pool.get('sale.order')
|
||||||
partner_obj = self.pool.get('res.partner')
|
partner_obj = self.pool.get('res.partner')
|
||||||
|
|
Loading…
Reference in New Issue