[MERGE] trunk-addons1

bzr revid: tfr@openerp.com-20110117222546-3dt8h2taqxkjlymk
This commit is contained in:
Thibault Francois 2011-01-17 23:25:46 +01:00
commit 3f8ee8018a
22 changed files with 79 additions and 54 deletions

View File

@ -53,7 +53,7 @@
<field name="name">account.analytic.account.tree</field>
<field name="model">account.analytic.account</field>
<field name="type">tree</field>
<field name="field_parent">child_ids</field>
<field name="field_parent">child_complete_ids</field>
<field name="arch" type="xml">
<tree colors="red:(date&lt;current_date);black:(date&gt;=current_date);black:(date==False)" string="Analytic account" toolbar="1">
<field name="name"/>

View File

@ -109,6 +109,20 @@ class account_analytic_account(osv.osv):
def _complete_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict):
res = self.name_get(cr, uid, ids)
return dict(res)
def _child_compute(self, cr, uid, ids, name, arg, context=None):
result = {}
if context is None:
context = {}
for account in self.browse(cr, uid, ids, context=context):
for child in account.child_ids:
if child.state == 'template':
account.child_ids.pop(account.child_ids.index(child))
result[account.id] = map(lambda x: x.id, account.child_ids)
return result
_columns = {
'name': fields.char('Account Name', size=128, required=True),
@ -118,6 +132,7 @@ class account_analytic_account(osv.osv):
'description': fields.text('Description'),
'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2),
'child_ids': fields.one2many('account.analytic.account', 'parent_id', 'Child Accounts'),
'child_complete_ids': fields.function(_child_compute, relation='account.analytic.account', method=True, string="Account Hierarchy", type='many2many'),
'line_ids': fields.one2many('account.analytic.line', 'account_id', 'Analytic Entries'),
'balance': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Balance', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')),
'debit': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Debit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')),

View File

@ -19,7 +19,6 @@
#
##############################################################################
from lxml import etree
from osv import fields, osv
class base_contact_installer(osv.osv_memory):

View File

@ -23,9 +23,7 @@ import pydot
import base64
import report
from osv import fields, osv, orm
import tools
from tools.translate import _
from osv import fields, osv
import addons
class module(osv.osv):

View File

@ -19,8 +19,6 @@
#
##############################################################################
from osv import fields,osv
import tools
import re
import time
class base_synchro_server(osv.osv):

View File

@ -176,7 +176,7 @@ configuration
_columns = {
'url' : fields.char('Caldav Server', size=264, required=True, help="Url of the caldav server, use for synchronization"),
'caldav_doc_file':fields.binary('Caldav Document', readonly=True, help="download full caldav Documentation."),
#'doc_link':fields.char('Caldav Documentation', size="264", help="The link to Caldav Online Documentation.", readonly=True),
'description':fields.text('Description', readonly=True)
}
@ -218,7 +218,7 @@ configuration
file = open(addons.get_module_resource('caldav','doc', 'caldav_doc.pdf'),'rb')
res['caldav_doc_file'] = base64.encodestring(file.read())
#res['doc_link'] = 'http://doc.openerp.com/'
res['url'] = prefix+url
return res
@ -237,7 +237,7 @@ class user_preference(osv.osv_memory):
'collection' :fields.many2one('document.directory', "Calendar Collection", required=True, domain = [('calendar_collection', '=', True)]),
'calendar' :fields.many2one('basic.calendar', 'Calendar', required=True),
'service': fields.selection([('webdav','CalDAV')], "Services"),
'device' : fields.selection([('other', 'Other'), ('iphone', 'iPhone'), ('android', 'Android based device'),('thunderbird', 'Sunbird/Thunderbird'), ('evolution','Evolution')], "Software/Devices")
'device' : fields.selection([('other', 'Other'), ('iphone', 'iPhone'), ('android', 'Android based device'),('thunderbird', 'Sunbird/Thunderbird'), ('evolution','Evolution')], "Software/Devices"),
}
def _get_default_calendar(self, cr, uid, context):
@ -260,7 +260,8 @@ class user_preference(osv.osv_memory):
'service': 'webdav',
'collection' : _get_default_collection,
'calendar' : _get_default_calendar,
'device' : 'other'
'device' : 'other',
}
def open_window(self, cr, uid, ids, context=None):

View File

@ -15,11 +15,8 @@
<separator string="Description" colspan="4"/>
<field name="description" colspan="4" nolabel="1"/>
<separator colspan="4"/>
<field name="caldav_doc_file" colspan="4" />
<group col="4" colspan="4">
<label string="" colspan="2"/>
<button name="browse_caldav" string="_Ok" type="object" icon="gtk-ok"/>
</group>
</group>
</form>
</field>
@ -37,6 +34,7 @@
<field name="calendar" colspan="4" width="250" domain="[('collection_id','=', collection)]" readonly="1"/>
<field name="device" colspan="4" width="250" />
<separator colspan="4"/>
<group col="4" colspan="4">
<label string="" colspan="2"/>
<button special="cancel" string="_Cancel" icon="gtk-cancel"/>

View File

@ -9,7 +9,7 @@
<form string="Import ICS">
<group colspan="4" >
<separator string="Select ICS file"/>
<field name="file_path" colspan="4" width="300" nolabel="1"/>
<field name="file_path" colspan="4" width="500" nolabel="1"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">

View File

@ -301,9 +301,9 @@ class crm_lead(crm_case, osv.osv):
message=''
for case in self.browse(cr, uid, ids, context=context):
if case.type == 'lead' or context.get('stage_type',False)=='lead':
message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
elif case.type == 'opportunity':
message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
self.log(cr, uid, case.id, message)
return super(crm_lead,self).write(cr, uid, ids, vals, context)

View File

@ -52,7 +52,8 @@
<field name="view_id" ref="crm_case_calendar_view_meet"/>
<field name="context">{"search_default_user_id":uid, 'search_default_section_id': section_id}</field>
<field name="search_view_id" ref="view_crm_case_meetings_filter"/>
<field name="help">The meeting calendar is shared between the sales teams and fully integrated with other applications such as the employee holidays or the business opportunities. You can also synchronize meetings with your mobile phone using the caldav interface.</field>
<field name="help">The meeting calendar is shared between the sales teams and fully integrated with other applications such as the employee holidays or the business opportunities. You can also synchronize meetings with your mobile phone using the caldav interface.
</field>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_meet">

View File

@ -52,7 +52,7 @@ class crm_lead_report(osv.osv):
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True, select=True),
'day': fields.char('Day', size=128, readonly=True),
'email': fields.integer('# Emails', size=128, readonly=True),
'delay_open': fields.float('Delay to Open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
@ -65,9 +65,9 @@ class crm_lead_report(osv.osv):
domain="['|',('section_id','=',False),('section_id','=',section_id)]" , readonly=True),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', readonly=True, domain="('type', '=', 'lead')]"),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'opening_date': fields.date('Opening Date', readonly=True),
'creation_date': fields.date('Creation Date', readonly=True),
'date_closed': fields.date('Close Date', readonly=True),
'opening_date': fields.date('Opening Date', readonly=True, select=True),
'creation_date': fields.date('Creation Date', readonly=True, select=True),
'date_closed': fields.date('Close Date', readonly=True, select=True),
'nbr': fields.integer('# of Cases', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),

View File

@ -52,7 +52,7 @@ class crm_phonecall_report(osv.osv):
('07', 'July'), ('08', 'August'),\
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True, select=True),
'day': fields.char('Day', size=128, readonly=True),
'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'duration': fields.float('Duration', digits=(16,2),readonly=True, group_operator="avg"),
@ -62,9 +62,9 @@ class crm_phonecall_report(osv.osv):
('object_id.model', '=', 'crm.phonecall')]"),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'opening_date': fields.date('Opening Date', readonly=True),
'creation_date': fields.date('Creation Date', readonly=True),
'date_closed': fields.date('Close Date', readonly=True),
'opening_date': fields.date('Opening Date', readonly=True, select=True),
'creation_date': fields.date('Creation Date', readonly=True, select=True),
'date_closed': fields.date('Close Date', readonly=True, select=True),
}
def init(self, cr):

View File

@ -59,7 +59,7 @@ class crm_claim_report(osv.osv):
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True, select=True),
'day': fields.char('Day', size=128, readonly=True),
'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'stage_id': fields.many2one ('crm.case.stage', 'Stage', readonly=True, domain="[('type','=','claim')]"),
@ -71,8 +71,8 @@ class crm_claim_report(osv.osv):
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Priority'),
'type_action': fields.selection([('correction','Corrective Action'),('prevention','Preventive Action')], 'Action Type'),
'date_closed': fields.date('Close Date', readonly=True),
'date_deadline': fields.date('Deadline', readonly=True),
'date_closed': fields.date('Close Date', readonly=True, select=True),
'date_deadline': fields.date('Deadline', readonly=True, select=True),
'delay_expected': fields.float('Overpassed Deadline',digits=(16,2),readonly=True, group_operator="avg"),
'email': fields.integer('# Emails', size=128, readonly=True),
'probability': fields.float('Probability',digits=(16,2),readonly=True, group_operator="avg")

View File

@ -50,7 +50,7 @@ class crm_fundraising_report(osv.osv):
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True, select=True),
'day': fields.char('Day', size=128, readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="[('section_id','=',section_id),\

View File

@ -53,7 +53,7 @@ class crm_helpdesk_report(osv.osv):
'delay_close': fields.float('Delay to Close',digits=(16,2),readonly=True, group_operator="avg"),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'date_deadline': fields.date('Deadline'),
'date_deadline': fields.date('Deadline', select=True),
'priority': fields.selection([('5', 'Lowest'), ('4', 'Low'), \
('3', 'Normal'), ('2', 'High'), ('1', 'Highest')], 'Priority'),
'canal_id': fields.many2one('res.partner.canal', 'Channel'),
@ -61,8 +61,8 @@ class crm_helpdesk_report(osv.osv):
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.helpdesk')]"),
'planned_cost': fields.float('Planned Costs'),
'create_date': fields.date('Creation Date' , readonly=True),
'date_closed': fields.date('Close Date', readonly=True),
'create_date': fields.date('Creation Date' , readonly=True, select=True),
'date_closed': fields.date('Close Date', readonly=True, select=True),
'delay_expected': fields.float('Overpassed Deadline',digits=(16,2),readonly=True, group_operator="avg"),
'day': fields.char('Day', size=128, readonly=True),
'email': fields.integer('# Emails', size=128, readonly=True),

View File

@ -28,7 +28,7 @@ class report_vote(osv.osv):
_auto = False
_rec_name = 'date'
_columns = {
'date': fields.date('Date Order', readonly=True),
'date': fields.date('Date Order', readonly=True, select=True),
'year': fields.char('Year', size=4, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
@ -75,4 +75,4 @@ class report_vote(osv.osv):
""")
report_vote()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -28,7 +28,7 @@ class report_lunch_order(osv.osv):
_auto = False
_rec_name = 'date'
_columns = {
'date': fields.date('Date Order', readonly=True),
'date': fields.date('Date Order', readonly=True, select=True),
'year': fields.char('Year', size=4, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
@ -63,4 +63,4 @@ class report_lunch_order(osv.osv):
lo.date,lo.user_id,cm.name
)
""")
report_lunch_order()
report_lunch_order()

View File

@ -52,7 +52,7 @@ class campaign_analysis(osv.osv):
('10','October'), ('11','November'), ('12','December')],
'Month', readonly=True),
'day': fields.char('Day', size=10, readonly=True),
'date': fields.date('Date', readonly=True),
'date': fields.date('Date', readonly=True, select=True),
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
readonly=True),
'activity_id': fields.many2one('marketing.campaign.activity', 'Activity',

View File

@ -55,14 +55,15 @@ class outlook_installer(osv.osv_memory):
Pre-requirements :
1. Python 2.6+ .
2. Python for Windows extensions - PyWin32 this module for python must be installed for appropriate version of the Python.
3. If With MS Outlook 2007 it is required to install externally "Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 (CDO 1.21)".
and With MS Outlook2003 Install inbuilt Collaboration Data Objects(CDO) while installing Outlook.
3.1 If With MS Outlook 2007 it is required to install externally "Collaboration Data Objects, version 1.2.1".
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=2714320D-C997-4DE1-986F-24F081725D36&displaylang=en
3.2 With MS Outlook2003 Install inbuilt Collaboration Data Objects(CDO) while installing Outlook.
How to install openerp-outlook plug-in?
1. Save the executable plug-in file.
2. Close Outlook Application if Running.
3. Run executable plug-in file and the folllow the instruction.
Note :
Please refer README file for dependecies external link, openobject-addons/outlook/README.
"""

View File

@ -400,10 +400,10 @@ class task(osv.osv):
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
\n If the task is over, the states is set to \'Done\'.'),
'create_date': fields.datetime('Create Date', readonly=True),
'date_start': fields.datetime('Starting Date'),
'date_end': fields.datetime('Ending Date'),
'date_deadline': fields.date('Deadline'),
'create_date': fields.datetime('Create Date', readonly=True,select=True),
'date_start': fields.datetime('Starting Date',select=True),
'date_end': fields.datetime('Ending Date',select=True),
'date_deadline': fields.date('Deadline',select=True),
'project_id': fields.many2one('project.project', 'Project', ondelete='cascade'),
'parent_ids': fields.many2many('project.task', 'project_task_parent_rel', 'task_id', 'parent_id', 'Parent Tasks'),
'child_ids': fields.many2many('project.task', 'project_task_parent_rel', 'parent_id', 'task_id', 'Delegated Tasks'),

View File

@ -169,7 +169,7 @@ class project_issue(crm.crm_case, osv.osv):
'id': fields.integer('ID'),
'name': fields.char('Issue', size=128, required=True),
'active': fields.boolean('Active', required=False),
'create_date': fields.datetime('Creation Date', readonly=True),
'create_date': fields.datetime('Creation Date', readonly=True,select=True),
'write_date': fields.datetime('Update Date', readonly=True),
'date_deadline': fields.date('Deadline'),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
@ -188,9 +188,9 @@ class project_issue(crm.crm_case, osv.osv):
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'email_cc': fields.char('Watchers Emails', size=256, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'date_open': fields.datetime('Opened', readonly=True),
'date_open': fields.datetime('Opened', readonly=True,select=True),
# Project Issue fields
'date_closed': fields.datetime('Closed', readonly=True),
'date_closed': fields.datetime('Closed', readonly=True,select=True),
'date': fields.datetime('Date'),
'canal_id': fields.many2one('res.partner.canal', 'Channel', help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),

View File

@ -364,7 +364,12 @@ def Phase_%d():
# Allocating Memory for the required Project and Pahses and Resources
exec(func_str)
Phase = eval('Phase_%d' % phase.id)
phase = Task.BalancedProject(Phase)
phase = None
try:
phase = Task.BalancedProject(Phase)
except :
raise osv.except_osv(_('Error !'),_('Phase Scheduling is not possible.\nProject should have the Start date and member for scheduling.'))
for task_id in task_ids:
task = eval("phase.Task_%d" % task_id)
@ -510,7 +515,8 @@ def Project_%d():
try:
project = Task.BalancedProject(Project)
except :
raise osv.except_osv(_('Error !'),_('Invalid resource allocation, Phase Scheduling is not possible.\nPlease check project member resource.'))
raise osv.except_osv(_('Error !'),_('Phase Scheduling is not possible.\nProject should have the Start date and member for scheduling.'))
for phase_id in phase_ids:
act_phase = phase_pool.browse(cr, uid, phase_id, context=context)
resources = act_phase.resource_ids
@ -573,7 +579,10 @@ def Project_%d():
#Creating resources using the member of the Project
u_ids = [i.id for i in project.members]
resource_objs = resource_pool.generate_resources(cr, uid, u_ids, calendar_id, context=context)
start_date = datetime.strftime((datetime.strptime(start_date, "%Y-%m-%d")), "%Y-%m-%d")
try:
start_date = datetime.strftime((datetime.strptime(start_date, "%Y-%m-%d")), "%Y-%m-%d")
except:
raise osv.except_osv(_('Error !'),_('Task Scheduling is not possible.\nProject should have the Start date for scheduling.'))
func_str = ''
start = start_date
minimum_time_unit = 1
@ -634,7 +643,12 @@ def Project_%d():
# Allocating Memory for the required Project and Pahses and Resources
exec(func_str)
Project = eval('Project_%d' % project.id)
project = Task.BalancedProject(Project)
project = None
try:
project = Task.BalancedProject(Project)
except :
raise osv.except_osv(_('Error !'),_('Phase Scheduling is not possible.\nProject should have the Start date and member for scheduling.'))
for task_id in task_ids:
task = eval("project.Task_%d" % task_id)
start_date = task.start.to_datetime()