[MERGE] with addons1

bzr revid: tfr@openerp.com-20101126095512-n859a08cz6bui5th
This commit is contained in:
Thibault Francois 2010-11-26 10:55:12 +01:00
commit b9add5f29e
59 changed files with 590 additions and 449 deletions

View File

@ -54,7 +54,7 @@ class account_payment_term(osv.osv):
_description = "Payment Term"
_columns = {
'name': fields.char('Payment Term', size=64, translate=True, required=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the payment term without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the payment term without removing it."),
'note': fields.text('Description', translate=True),
'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'),
}
@ -374,7 +374,7 @@ class account_account(osv.osv):
'note': fields.text('Note'),
'company_currency_id': fields.function(_get_company_currency, method=True, type='many2one', relation='res.currency', string='Company Currency'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'active': fields.boolean('Active', select=2, help="If the active field is set to true, it will allow you to hide the account without removing it."),
'active': fields.boolean('Active', select=2, help="If the active field is set to False, it will allow you to hide the account without removing it."),
'parent_left': fields.integer('Parent Left', select=1),
'parent_right': fields.integer('Parent Right', select=1),
@ -959,7 +959,7 @@ class account_journal_period(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', required=True, ondelete="cascade"),
'period_id': fields.many2one('account.period', 'Period', required=True, ondelete="cascade"),
'icon': fields.function(_icon_get, method=True, string='Icon', type='char', size=32),
'active': fields.boolean('Active', required=True, help="If the active field is set to true, it will allow you to hide the journal period without removing it."),
'active': fields.boolean('Active', required=True, help="If the active field is set to False, it will allow you to hide the journal period without removing it."),
'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'State', required=True, readonly=True,
help='When journal period is created. The state is \'Draft\'. If a report is printed it comes to \'Printed\' state. When all transactions are done, it comes in \'Done\' state.'),
'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear'),
@ -1669,7 +1669,7 @@ class account_tax(osv.osv):
'name': fields.char('Tax Name', size=64, required=True, translate=True, help="This name will be displayed on reports"),
'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the tax lines from the lowest sequences to the higher ones. The order is important if you have a tax with several tax children. In this case, the evaluation order is important."),
'amount': fields.float('Amount', required=True, digits_compute=get_precision_tax(), help="For taxes of type percentage, enter % ratio between 0-1."),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the tax without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the tax without removing it."),
'type': fields.selection( [('percent','Percentage'), ('fixed','Fixed Amount'), ('none','None'), ('code','Python Code'), ('balance','Balance')], 'Tax Type', required=True,
help="The computation method for the tax amount."),
'applicable_type': fields.selection( [('true','Always'), ('code','Given by Python Code')], 'Applicability', required=True,

View File

@ -27,7 +27,7 @@ class account_analytic_journal(osv.osv):
_columns = {
'name': fields.char('Journal Name', size=64, required=True),
'code': fields.char('Journal Code', size=8),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
'company_id': fields.many2one('res.company', 'Company', required=True),

View File

@ -217,7 +217,7 @@ class auction_lot_category(osv.osv):
_columns = {
'name': fields.char('Category Name', required=True, size=64),
'priority': fields.float('Priority'),
'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the auction lot category without removing it."),
'active' : fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the auction lot category without removing it."),
'aie_categ': fields.many2one('aie.category', 'Category', ondelete='cascade'),
}
_defaults = {

View File

@ -198,6 +198,8 @@ class audittrail_objects_proxy(osv_pool):
"""
if not context:
context = {}
if field_name in('__last_update','id'):
return values
pool = pooler.get_pool(cr.dbname)
field_pool = pool.get('ir.model.fields')
model_pool = pool.get('ir.model')
@ -248,6 +250,8 @@ class audittrail_objects_proxy(osv_pool):
log_line_pool = pool.get('audittrail.log.line')
#start Loop
for line in lines:
if line['name'] in('__last_update','id'):
continue
if obj_pool._inherits:
inherits_ids = model_pool.search(cr, uid, [('model', '=', obj_pool._inherits.keys()[0])])
field_ids = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', (model.id, inherits_ids[0]))])
@ -279,6 +283,7 @@ class audittrail_objects_proxy(osv_pool):
"field_description": field['field_description']
}
line_id = log_line_pool.create(cr, uid, vals)
cr.commit()
#End Loop
return True
@ -361,7 +366,7 @@ class audittrail_objects_proxy(osv_pool):
lines.append(line)
self.create_log_line(cr, uid, log_id, model, lines)
cr.commit()
cr.close()
return res

View File

@ -23,9 +23,9 @@
<field name="action_id" colspan="4" readonly="1" groups="base.group_extended"/>
<field name="state" select="1" readonly="1" />
<group colspan="2" col="2">
<button string="Subscribe" name="subscribe"
<button string="_Subscribe" name="subscribe" icon="gtk-ok"
type="object" states="draft" />
<button string="UnSubscribe" name="unsubscribe"
<button string="UnSubscribe" name="unsubscribe" icon="gtk-cancel"
type="object" states="subscribed" />
</group>
</form>
@ -40,18 +40,36 @@
<tree colors="blue:state in ('draft');black:state in ('subscribed')" string="AuditTrail Rules">
<field name="name" />
<field name="object_id"/>
<field name="user_id" />
<field name="log_read" />
<field name="log_write" />
<field name="log_unlink" />
<field name="log_create" />
<field name="log_action"/>
<field name="log_action"/>
<field name="log_workflow"/>
<field name="state" />
</tree>
</field>
</record>
<record id="view_audittrail_rule_search" model="ir.ui.view">
<field name="name">audittrail.rule.search</field>
<field name="model">audittrail.rule</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Audittrail Rule">
<group col="8" colspan="4">
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Rule"/>
<filter icon="terp-camera_test" string="Subscribed" domain="[('state','=','subscribed')]" help="Subscribed Rule"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="object_id"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="10" groups="base.group_extended">
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<!-- Action for audittrail rule -->
<record model="ir.actions.act_window" id="action_audittrail_rule_tree">
@ -60,22 +78,12 @@
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<!--<field name="view_id" ref="view_audittrail_rule_form" />-->
<field name="context">{'search_default_draft': 1}</field>
<field name="search_view_id" ref="view_audittrail_rule_search"/>
</record>
<menuitem name="Rules" id="menu_action_audittrail_rule_tree"
action="action_audittrail_rule_tree" parent="base.menu_audit" />
<record model="ir.actions.act_window" id="action_audittrail_rule_tree_sub">
<field name="name">Subscribed Rules</field>
<field name="res_model">audittrail.rule</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','subscribed')]</field>
<field name="filter" eval="True"/>
</record>
<!-- AuditTrail Log form -->
<record model="ir.ui.view" id="view_audittrail_log_form">
@ -119,7 +127,6 @@
<field name="new_value_text" nolabel="1"
colspan="2" readonly="1" />
</form>
<tree string="Log Lines">
<field name="field_description" />
<field name="old_value_text" />
@ -144,13 +151,35 @@
</tree>
</field>
</record>
<record id="view_audittrail_log_search" model="ir.ui.view">
<field name="name">audittrail.log.search</field>
<field name="model">audittrail.log</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Audittrail Log">
<group col="8" colspan="4">
<field name="name"/>
<field name="object_id"/>
<field name="user_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="10" groups="base.group_extended">
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Object" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'object_id'}"/>
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'timestamp'}"/>
</group>
</search>
</field>
</record>
<!-- Action for Audittrail Log -->
<record model="ir.actions.act_window" id="action_audittrail_log_tree">
<field name="name">Audit Logs</field>
<field name="res_model">audittrail.log</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="view_audittrail_log_search"/>
</record>
<menuitem name="Audit Logs" id="menu_action_audittrail_log_tree"
action="action_audittrail_log_tree" parent="base.menu_audit" />

View File

@ -58,7 +58,7 @@ class res_partner_contact(osv.osv):
'job_ids': fields.one2many('res.partner.job', 'contact_id', 'Functions and Addresses'),
'country_id': fields.many2one('res.country','Nationality'),
'birthdate': fields.date('Birth Date'),
'active': fields.boolean('Active', help="If the active field is set to true,\
'active': fields.boolean('Active', help="If the active field is set to False,\
it will allow you to hide the partner contact without removing it."),
'partner_id': fields.related('job_ids', 'address_id', 'partner_id', type='many2one',\
relation='res.partner', string='Main Employer'),

View File

@ -404,7 +404,7 @@ class report_creator(osv.osv):
_columns = {
'name': fields.char('Report Name', size=64, required=True),
'type': fields.selection([('list', 'Rows And Columns Report'), ], 'Report Type', required=True), #('sum','Summation Report')
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the report without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the report without removing it."),
'view_type1': fields.selection([('form', 'Form'),
('tree', 'Tree'),
('graph', 'Graph'),

View File

@ -22,10 +22,8 @@
from osv import osv
from openerp_sxw2rml import sxw2rml
from StringIO import StringIO
from report import interface
import base64
import pooler
import tools
import addons
class report_xml(osv.osv):

View File

@ -1,14 +1,13 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<record model="document.directory" id="document.dir_calendars">
<field name="name">Calendars</field>
<field name="calendar_collection">True</field>
</record>
</record>
<!-- Event attributes-->
<record model="basic.calendar.attributes" id="field_event_comment">
<field name="name">comment</field>
<field name="type">vevent</field>

View File

@ -56,7 +56,11 @@ class calendar_event_import(osv.osv_memory):
id2 = data_obj._get_id(cr, uid, 'caldav', 'view_calendar_event_import_display')
if id2:
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
vals = model_obj.import_cal(cr, uid, base64.decodestring(data['file_path']), context['active_id'], context)
vals = None
try:
vals = model_obj.import_cal(cr, uid, base64.decodestring(data['file_path']), context['active_id'], context)
except:
raise osv.except_osv(_('Warning !'),_('Invalid format of the ics, file can not be imported'))
global cnt
if vals:
cnt = len(vals)

View File

@ -150,7 +150,7 @@ class crm_case(object):
for case in self.browse(cr, uid, ids, context):
next_stage = False
data = {}
domain = [('object_id.model', '=', model)]
domain = [('object_id.model', '=', model),('section_ids', '=', case.section_id.id)]
if case.section_id and case.section_id.stage_ids:
domain.append(('id', 'in', map(lambda x: x.id, case.section_id.stage_ids)))
stages = stage_pool.search(cr, uid, domain, order='sequence')
@ -184,7 +184,7 @@ class crm_case(object):
for case in self.browse(cr, uid, ids, context):
prev_stage = False
data = {}
domain = [('object_id.model', '=', model)]
domain = [('object_id.model', '=', model),('section_ids', '=', case.section_id.id)]
if case.section_id and case.section_id.stage_ids:
domain.append(('id', 'in', map(lambda x: x.id, case.section_id.stage_ids)))
stages = stage_pool.search(cr, uid, domain, order='sequence')

View File

@ -192,7 +192,6 @@ class crm_lead(crm_case, osv.osv):
if not old_stage_id:
stage_id = super(crm_lead, self).stage_next(cr, uid, ids, *args)
if stage_id:
value.update({'stage_id': stage_id})
value.update(self.onchange_stage_id(cr, uid, ids, stage_id, context={})['value'])
value.update({'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
self.write(cr, uid, ids, value)
@ -282,35 +281,30 @@ class crm_lead(crm_case, osv.osv):
}
return value
def write(self, cr, uid, ids, vals, context={}):
if 'date_closed' in vals:
return super(crm_lead,self).write(cr, uid, ids, vals, context)
if 'stage_id' in vals and vals['stage_id']:
stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, vals['stage_id'], context=context)
self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
for case in self.browse(cr, uid, ids, context=context):
if case.type == 'lead':
message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
elif case.type == 'opportunity':
message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
self.log(cr, uid, case.id, message)
return super(crm_lead,self).write(cr, uid, ids, vals, context)
def stage_next(self, cr, uid, ids, context=None):
stage = super(crm_lead, self).stage_next(cr, uid, ids, context)
if stage:
stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
for case in self.browse(cr, uid, ids, context=context):
if case.type == 'lead':
message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
elif case.type == 'opportunity':
message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
self.log(cr, uid, case.id, message)
if stage_obj.on_change:
data = {'probability': stage_obj.probability}
self.write(cr, uid, ids, data)
return stage
def stage_previous(self, cr, uid, ids, context=None):
stage = super(crm_lead, self).stage_previous(cr, uid, ids, context)
if stage:
stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
for case in self.browse(cr, uid, ids, context=context):
if case.type == 'lead':
message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
elif case.type == 'opportunity':
message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
self.log(cr, uid, case.id, message)
return stage
def message_new(self, cr, uid, msg, context):
"""
Automatically calls when new email message arrives

View File

@ -188,7 +188,7 @@ class res_users(osv.osv):
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
'user_id': user_id}, context=context)
except ValueError:
except:
# Tolerate a missing shortcut. See product/product.py for similar code.
logging.getLogger('orm').warning('Skipped Products shortcut for user "%s"', data.get('name','<new'))

View File

@ -60,11 +60,7 @@ class crm_opportunity(osv.osv):
@param *args: Tuple Value for additional Params
"""
res = super(crm_opportunity, self).case_close(cr, uid, ids, args)
stage_id = super(crm_opportunity, self).stage_next(cr, uid, ids, context={'force_domain': [('probability', '=', 100)]})
if not stage_id:
raise osv.except_osv(_('Warning !'), _('There is no stage for won opportunities defined for this Sale Team.'))
value = self.onchange_stage_id(cr, uid, ids, stage_id, context={})['value']
value.update({'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'), 'stage_id': stage_id})
value = {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')}
self.write(cr, uid, ids, value)
for (id, name) in self.name_get(cr, uid, ids):
@ -83,12 +79,7 @@ class crm_opportunity(osv.osv):
@param *args: Tuple Value for additional Params
"""
res = super(crm_opportunity, self).case_close(cr, uid, ids, args)
stage_id = super(crm_opportunity, self).stage_next(cr, uid, ids, context={'force_domain': [('probability', '=', 0)]})
value = {}
if stage_id:
value = self.onchange_stage_id(cr, uid, ids, stage_id, context={}).get('value', {})
value['stage_id'] = stage_id
value.update({'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')})
value = {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')}
res = self.write(cr, uid, ids, value)
for (id, name) in self.name_get(cr, uid, ids):

View File

@ -33,7 +33,7 @@
<field name="user_id"/>
<field name="categ_id" string="Type"/>
<field name="create_date" invisible="1"/>
<button string="Opportunity"
<button string="Convert to Opportunity"
name="%(phonecall2opportunity_act)d"
states="draft,open,pending"
icon="gtk-index"
@ -213,7 +213,7 @@
icon="terp-call-start"
name="%(phonecall_to_phonecall_act)d"
type="action" />
<button string="Opportunity"
<button string="Convert to Opportunity"
name="%(phonecall2opportunity_act)d"
states="draft,open,pending"
icon="gtk-index"

View File

@ -1,165 +1,165 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<data noupdate="1">
<!-- Event Attribute mapping for Calendar-->
<!-- Event Attribute mapping for Calendar-->
<record model="basic.calendar" id="caldav.basic_calendar1">
<field name="name">Meetings</field>
<field name="name">Meetings</field>
<field name="collection_id" ref="document.dir_calendars"></field>
<field name="type">vevent</field>
</record>
</record>
<record model="basic.calendar.lines" id="base_calendar.calendar_lines_event">
<field name="name">vevent</field>
<field name="calendar_id" ref="caldav.basic_calendar1" />
<field name="object_id" search="[('model','=','crm.meeting')]" />
<field name="name">vevent</field>
<field name="calendar_id" ref="caldav.basic_calendar1" />
<field name="object_id" search="[('model','=','crm.meeting')]" />
<field name="domain">[('user_id','=', uid)]</field>
</record>
</record>
<record model="basic.calendar.lines" id="base_calendar.calendar_lines_alarm">
<field name="name">valarm</field>
<field name="calendar_id" ref="caldav.basic_calendar1" />
<field name="object_id" search="[('model','=','calendar.alarm')]" />
</record>
<field name="name">valarm</field>
<field name="calendar_id" ref="caldav.basic_calendar1" />
<field name="object_id" search="[('model','=','calendar.alarm')]" />
</record>
<record model="basic.calendar.lines" id="base_calendar.calendar_lines_attendee">
<field name="name">attendee</field>
<field name="calendar_id" ref="caldav.basic_calendar1" />
<field name="object_id" search="[('model','=','calendar.attendee')]" />
</record>
<record model="basic.calendar.lines" id="base_calendar.calendar_lines_attendee">
<field name="name">attendee</field>
<field name="calendar_id" ref="caldav.basic_calendar1" />
<field name="object_id" search="[('model','=','calendar.attendee')]" />
</record>
<record model="basic.calendar.fields" id="map_event_0">
<field name="name" ref="caldav.field_event_organizer"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','organizer'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','organizer'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_1">
<field name="name" ref="caldav.field_event_uid"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','id'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','id'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_2">
<field name="name" ref="caldav.field_event_recurrence-id"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','recurrent_id'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','recurrent_id'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_3">
<field name="name" ref="caldav.field_event_vtimezone"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','vtimezone'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','vtimezone'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_4">
<field name="name" ref="caldav.field_event_attendee" />
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','crm.meeting')]" />
<field name="fn">field</field>
</record>
<field name="name" ref="caldav.field_event_attendee" />
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','crm.meeting')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_5">
<field name="name" ref="caldav.field_event_rrule"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','rrule'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','rrule'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_6">
<field name="name" ref="caldav.field_event_dtend"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','date_deadline'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','date_deadline'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_7">
<field name="name" ref="caldav.field_event_valarm"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','base_calendar_alarm_id'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','base_calendar_alarm_id'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_9">
<field name="name" ref="caldav.field_event_location"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','location'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','location'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_10">
<field name="name" ref="caldav.field_event_exrule"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','exrule'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','exrule'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_11">
<field name="name" ref="caldav.field_event_status"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','crm.meeting')]" />
<field name="mapping">{'tentative': 'draft', 'confirmed': 'open', 'cancelled': 'cancel'}</field>
<field name="fn">field</field>
</record>
<field name="name" ref="caldav.field_event_status"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','crm.meeting')]" />
<field name="mapping">{'tentative': 'draft', 'confirmed': 'open', 'cancelled': 'cancel'}</field>
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_12">
<field name="name" ref="caldav.field_event_exdate"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','exdate'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','exdate'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_13">
<field name="name" ref="caldav.field_event_dtstamp"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','date'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','date'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_14">
<field name="name" ref="caldav.field_event_description"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_15">
<field name="name" ref="caldav.field_event_dtstart"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','date'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','date'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_16">
<field name="name" ref="caldav.field_event_class"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','class'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','class'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_18">
<field name="name" ref="caldav.field_event_created"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','create_date'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','create_date'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_19">
<field name="name" ref="caldav.field_event_url"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','base_calendar_url'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','base_calendar_url'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_event_20">
<field name="name" ref="caldav.field_event_summary"/>
<field name="type_id" ref="base_calendar.calendar_lines_event" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.event')]" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.event')]" />
<field name="fn">field</field>
</record>
@ -168,77 +168,77 @@
<record model="basic.calendar.fields" id="map_alarm_1">
<field name="name" ref="caldav.field_alarm_attendee"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_2">
<field name="name" ref="caldav.field_alarm_trigger_duration"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','trigger_duration'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','trigger_duration'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_3">
<field name="name" ref="caldav.field_alarm_description"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_4">
<field name="name" ref="caldav.field_alarm_attach"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','attach'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','attach'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_5">
<field name="name" ref="caldav.field_alarm_trigger_occurs"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','trigger_occurs'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','trigger_occurs'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_6">
<field name="name" ref="caldav.field_alarm_trigger_interval"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','trigger_interval'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','trigger_interval'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_7">
<field name="name" ref="caldav.field_alarm_summary"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_8">
<field name="name" ref="caldav.field_alarm_duration"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','duration'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','duration'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_9">
<field name="name" ref="caldav.field_alarm_repeat"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','repeat'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','repeat'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_10">
<field name="name" ref="caldav.field_alarm_action"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','action'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','action'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_11">
<field name="name" ref="caldav.field_alarm_trigger_related"/>
<field name="type_id" ref="base_calendar.calendar_lines_alarm" />
<field name="field_id" search="[('name','=','trigger_related'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','trigger_related'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
@ -246,81 +246,79 @@
<record model="basic.calendar.fields" id="map_attendee_1">
<field name="name" ref="caldav.field_attendee_cn"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','cn'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','cn'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_2">
<field name="name" ref="caldav.field_attendee_sent-by"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','sent_by'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','sent_by'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_3">
<field name="name" ref="caldav.field_attendee_language"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','language'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','language'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_4">
<field name="name" ref="caldav.field_attendee_delegated-from"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','delegated_from'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','delegated_from'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_5">
<field name="name" ref="caldav.field_attendee_member"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','member'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','member'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_6">
<field name="name" ref="caldav.field_attendee_cutype"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','cutype'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','cutype'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_7">
<field name="name" ref="caldav.field_attendee_role"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','role'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','role'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_8">
<field name="name" ref="caldav.field_attendee_partstat"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_9">
<field name="name" ref="caldav.field_attendee_delegated-to"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','delegated_to'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','delegated_to'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_10">
<field name="name" ref="caldav.field_attendee_dir"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','dir'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','dir'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_11">
<field name="name" ref="caldav.field_attendee_rsvp"/>
<field name="type_id" ref="base_calendar.calendar_lines_attendee" />
<field name="field_id" search="[('name','=','rsvp'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','rsvp'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
</data>
</data>
</openerp>

View File

@ -60,7 +60,7 @@ class delivery_carrier(osv.osv):
'product_id': fields.many2one('product.product', 'Delivery Product', required=True),
'grids_id': fields.one2many('delivery.grid', 'carrier_id', 'Delivery Grids'),
'price' : fields.function(get_price, method=True,string='Price'),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the delivery carrier without removing it.")
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the delivery carrier without removing it.")
}
_defaults = {
'active': lambda *args:1
@ -96,7 +96,7 @@ class delivery_grid(osv.osv):
'zip_from': fields.char('Start Zip', size=12),
'zip_to': fields.char('To Zip', size=12),
'line_ids': fields.one2many('delivery.grid.line', 'grid_id', 'Grid Line'),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the delivery grid without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the delivery grid without removing it."),
}
_defaults = {
'active': lambda *a: 1,

View File

@ -106,7 +106,7 @@
<field name="extension"/>
<field name="include_name"/>
<separator string="PDF Report" colspan="4"/>
<field name="report_id" domain="[('model_id','=',parent.ressource_type_id)]"/>
<field name="report_id" domain="[ ('type','=','ressource'),('model_id','=',parent.ressource_type_id)]"/>
</form>
<tree string="Contents">
<field name="sequence" string="Seq."/>
@ -148,6 +148,7 @@
<field name="name"/>
<field name="type"/>
<field name="user_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="storage_id"/>
<field name="create_date"/>
<field name="write_date"/>
@ -166,12 +167,16 @@
<separator orientation="vertical"/>
<field name="name" />
<field name="user_id" />
<field name="company_id" groups="base.group_multi_company"/>
<field name="storage_id" />
<newline/>
<group expand="0" string="Group By..." groups="base.group_extended">
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
<filter string="Owner" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Storage" domain="[]" context="{'group_by':'storage_id'}"/>
<separator orientation="vertical"/>
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
<filter string="Storage" domain="[]" icon="terp-accessories-archiver" context="{'group_by':'storage_id'}"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<filter string="Company" domain="[]" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>

View File

@ -96,8 +96,13 @@ class DocIndex(indexer):
def _doIndexFile(self,fname):
fp = Popen(['antiword', fname], shell=False, stdout=PIPE).stdout
return _to_unicode(fp.read())
try:
file_data = _to_unicode(fp.read())
finally:
fp.close()
return file_data
cntIndex.register(DocIndex())
class DocxIndex(indexer):
@ -158,7 +163,12 @@ class PdfIndex(indexer):
def _doIndexFile(self,fname):
fp = Popen(['pdftotext', '-enc', 'UTF-8', '-nopgbrk', fname, '-'], shell=False, stdout=PIPE).stdout
return _to_unicode( fp.read())
try:
file_data = _to_unicode( fp.read())
finally:
fp.close()
return file_data
cntIndex.register(PdfIndex())

View File

@ -271,6 +271,19 @@
for i in range(0, 200):
ftp.delete('test-name%s.txt' %i)
ftp.close()
-
I delete the "test.txt" and "test-renamed.txt" file
-
!python {model: ir.attachment}: |
from document_ftp import test_easyftp as te
from cStringIO import StringIO
ftp = te.get_ftp_folder(cr, uid, self, 'Documents')
# TODO speed
ftp.delete('test.txt')
ftp.delete('test-renamed.txt')
ftp.close()
-
I remove the 'Test-Folder2'
-

View File

@ -82,7 +82,7 @@
-
I create an ir.attachment, attached (not related) to Partner1
-
!record {model: ir.attachment, id: file_test1 }:
!record {model: ir.attachment, id: file_test1}:
name: File of pat1
res_model: res.partner
res_id: !eval ref("tpartner1")
@ -147,10 +147,32 @@
- |
Bonus Piste:
I create a 'Partner3' under 'all'
-
I delete the Partners Testing folder
I delete "pat1-dynamic.txt" File.
-
!python {model: ir.attachment}: |
from document_ftp import test_easyftp as te
from cStringIO import StringIO
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Partners Testing/Pat 1/Partners of Test/Partner 1')
ftp.delete('pat1-dynamic.txt')
ftp.close()
-
I delete the Partners Testing folder, "File of pat1" file, Partner and Partner category.
-
!python {model: document.directory}: |
attach_pool = self.pool.get('ir.attachment')
partner_categ_pool = self.pool.get('res.partner.category')
partner_pool = self.pool.get('res.partner')
self.unlink(cr, uid, [ref('dir_tests2')])
self.unlink(cr, uid, [ref('dir_respart1')])
cr.commit()
attach_pool.unlink(cr, uid, [ref('file_test1')])
partner_categ_pool.unlink(cr, uid, [ref('tpat_categ_none')])
partner_categ_pool.unlink(cr, uid, [ref('tpat_categ_pat1')])
partner_categ_pool.unlink(cr, uid, [ref('tpat_categ_all')])
partner_pool.unlink(cr, uid, [ref('tpartner1')])
partner_pool.unlink(cr, uid, [ref('tpartner_2')])
cr.commit()

View File

@ -9,18 +9,4 @@
</record>
</data>
<data noupdate="1">
<record id="seq_type_crm_case_code" model="ir.sequence.type">
<field name="name">CRM Case Code</field>
<field name="code">crm.case</field>
</record>
<record id="seq_sale_order" model="ir.sequence">
<field name="name">CRM Case</field>
<field name="code">crm.case</field>
<field name="prefix">CASE</field>
<field name="padding">3</field>
</record>
</data>
</openerp>

View File

@ -5,18 +5,18 @@
<record model="crm.case.section" id="section_meeting">
<field name="name">Shared Calendar Meetings</field>
<field name="code">shcal</field>
</record>
</record>
<record model="document.directory" id="document.dir_calendars">
<field name="name">Calendars</field>
</record>
</record>
<record model="document.directory.content" id="dir_content_calendar">
<field name="name">Calendars</field>
<field name="suffix">meetings</field>
<field name="directory_id" ref="document.dir_calendars"/>
<field name="extension">.ics</field>
<field name="include_name" eval="False"/>
<field name="directory_id" ref="document.dir_calendars"/>
<field name="object_id" ref="crm.model_crm_meeting"/>
<field name="ics_domain" eval="'[]'"/>
</record>

View File

@ -51,7 +51,8 @@
<field name="target">new</field>
</record>
register configuration wizard
<!-- register configuration wizard -->
<record id="config_wizard_step_case_section_menu" model="ir.actions.todo">
<field name="action_id" ref="action_view_document_ics_config_directories"/>
<field name="restart">always</field>

View File

@ -24,7 +24,7 @@
<field name="inherit_id" ref="view_document_directory_form_1"/>
<field name="arch" type="xml">
<field name="report_id" position="replace">
<field name="report_id" domain="[('model_id','=',parent.ressource_type_id)]"/>
<field name="report_id" domain="[('type', '=', 'ressource'),('model_id','=',parent.ressource_type_id)]"/>
<separator string="ICS Calendar" colspan="4"/>
<field name="ics_domain"/>
<field name="ics_field_ids" colspan="4">

View File

@ -731,7 +731,7 @@ class email_template_preview(osv.osv_memory):
ref_obj_id = self.pool.get('email.template').read(cr, uid, context['template_id'], ['object_name'], context)
ref_obj_name = self.pool.get('ir.model').read(cr, uid, ref_obj_id['object_name'][0], ['model'], context)['model']
model_obj = self.pool.get(ref_obj_name)
ref_obj_ids = model_obj.search(cr, uid, [], 0, 20, 'id desc', context=context)
ref_obj_ids = model_obj.search(cr, uid, [], 0, 20, 'id', context=context)
if not ref_obj_ids:
ref_obj_ids = []

View File

@ -84,6 +84,7 @@
</filter>
</field>
</record>
<record id="view_account_analytic_line_tree_inherit" model="ir.ui.view">
<field name="name">account.analytic.line.tree.to_invoice</field>
@ -96,8 +97,7 @@
</field>
</field>
</record>
<record id="view_account_analytic_line_form_inherit" model="ir.ui.view">
<record id="view_account_analytic_line_form_inherit" model="ir.ui.view">
<field name="name">account.analytic.line.form.to_invoice</field>
<field name="model">account.analytic.line</field>
<field name="type">form</field>

View File

@ -200,7 +200,8 @@ class mailgate_message(osv.osv):
action_data = action_pool.read(cr, uid, action_ids[0], context=context)
action_data.update({
'domain' : "[('id','=',%d)]"%(res_id),
'nodestroy': True
'nodestroy': True,
'context': {}
})
return action_data
@ -486,6 +487,8 @@ class mailgate_tool(osv.osv_memory):
if not msg_txt.is_multipart() or 'text/plain' in msg.get('Content-Type', ''):
encoding = msg_txt.get_content_charset()
body = msg_txt.get_payload(decode=True)
if 'text/html' in msg_txt.get('Content-Type', ''):
body = tools.html2plaintext(body)
msg['body'] = tools.ustr(body, encoding)
attachments = {}
@ -566,6 +569,7 @@ class mailgate_tool(osv.osv_memory):
message_id = msg.get('message-id'),
references = msg.get('references', False) or msg.get('in-reply-to', False),
attach = attachments.items(),
email_date = msg.get('date'),
context = context)
else:
self.history(cr, uid, model, res_ids, msg, attachment_ids, context=context)

View File

@ -26,7 +26,7 @@ class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'emails': fields.one2many('mailgate.message', 'partner_id',\
'Emails', readonly=True),
'Emails', readonly=True, domain=[('history','=',True)]),
}
res_partner()

View File

@ -11,7 +11,7 @@
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page string="History" position="inside">
<field name="emails" colspan="4" nolabel="1" domain="[('history', '=', True)]"/>
<field name="emails" colspan="4" nolabel="1"/>
</page>
</field>
</record>

View File

@ -69,7 +69,7 @@ class mrp_routing(osv.osv):
_description = 'Routing'
_columns = {
'name': fields.char('Name', size=64, required=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the routing without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the routing without removing it."),
'code': fields.char('Code', size=8),
'note': fields.text('Description'),
@ -178,7 +178,7 @@ class mrp_bom(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True),
'code': fields.char('Reference', size=16),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the bills of material without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the bills of material without removing it."),
'type': fields.selection([('normal','Normal BoM'),('phantom','Sets / Phantom')], 'BoM Type', required=True,
help= "If a sub-product is used in several products, it can be useful to create its own BoM. "\
"Though if you don't want separated production orders for this sub-product, select Set/Phantom as BoM type. "\

View File

@ -3,8 +3,11 @@ OpenERP Outlook PLUG-IN Installation Guide
Pre requirements :
======================================================================================
1.Python 2.6+ . python can be downloaded from http://www.python.org/download/releases/ .
2.Python for Windows extensions - PyWin32 this module for python must be installed for appropriate version of the Python. It can be downloaded from http://sourceforge.net/projects/pywin32/files/ or http://starship.python.net/crew/mhammond/win32/
3.If you are using MS Outlook 2007 than you are required to install "Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 (CDO 1.21)". It can be downloaded from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e17e7f31-079a-43a9-bff2-0a110307611e&displaylang=en
2.Python for Windows extensions - PyWin32 this module for python must be installed for appropriate version of the Python. It can be downloaded from
http://sourceforge.net/projects/pywin32/ or
http://starship.python.net/crew/mhammond/win32/
3.If you are using MS Outlook 2007 than you are required to install "Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 (CDO 1.21)". It can be downloaded from
http://www.microsoft.com/downloads/en/details.aspx?familyid=2714320d-c997-4de1-986f-24f081725d36&displaylang=en
How to install openerp-outlook plug-in?
======================================================================================

View File

@ -50,12 +50,14 @@ def GetConn():
d=Dispatch("Python.OpenERP.XMLRpcConn")
return d
class Configuration:
def OnClick(self, button, cancel):
import win32ui
try:
mngr = manager.GetManager()
mngr.ShowManager()
except Exception,e:
win32ui.MessageBox("Fail to Initialize dialog.\n"+str(e),"OpenERP Configuration", win32con.MB_ICONERROR)
win32ui.MessageBox("Fail to Initialize dialog.\n"+str(e),"OpenERP Configuration", win32con.MB_ICONERROR)
return cancel
#
class ViewPartners:
@ -63,7 +65,7 @@ class ViewPartners:
from win32com.client import Dispatch
import win32con
mngr = manager.GetManager()
data=mngr.LoadConfig()
data = mngr.LoadConfig()
outlook = Dispatch("Outlook.Application")
ex = outlook.ActiveExplorer()
if ex:
@ -78,31 +80,31 @@ class ViewPartners:
return cancel
#
class OpenPartner:
def OnClick(self, button, cancel):
mngr = manager.GetManager()
data=mngr.LoadConfig()
outlook = Dispatch("Outlook.Application")
ex = outlook.ActiveExplorer()
if ex:
is_login = str(data['login'])
if is_login == 'False':
win32ui.MessageBox("Please login to the database first", "OpenERP Connection", win32con.MB_ICONEXCLAMATION)
elif ex.Selection.Count == 1:
mngr = manager.GetManager()
mngr.ShowManager("IDD_OPEN_PARTNER_DIALOG")
elif ex.Selection.Count == 0:
win32ui.MessageBox("No mail selected to push to OpenERP","Push to OpenERP",win32con.MB_ICONINFORMATION)
elif ex.Selection.Count > 1:
win32ui.MessageBox("Multiple selection not allowed. Please select only one mail at a time.","Push to OpenERP",win32con.MB_ICONINFORMATION)
return cancel
def OnClick(self, button, cancel):
import win32ui
mngr = manager.GetManager()
data = mngr.LoadConfig()
outlook = Dispatch("Outlook.Application")
ex = outlook.ActiveExplorer()
if ex:
is_login = str(data['login'])
if is_login == 'False':
win32ui.MessageBox("Please login to the database first", "OpenERP Connection", win32con.MB_ICONEXCLAMATION)
elif ex.Selection.Count == 1:
mngr = manager.GetManager()
mngr.ShowManager("IDD_OPEN_PARTNER_DIALOG")
elif ex.Selection.Count == 0:
win32ui.MessageBox("No mail selected to push to OpenERP","Push to OpenERP",win32con.MB_ICONINFORMATION)
elif ex.Selection.Count > 1:
win32ui.MessageBox("Multiple selection not allowed. Please select only one mail at a time.","Push to OpenERP",win32con.MB_ICONINFORMATION)
return cancel
#
class OpenDocument:
def OnClick(self, button, cancel):
from win32com.client import Dispatch
import win32con
import win32ui
mngr = manager.GetManager()
data=mngr.LoadConfig()
data = mngr.LoadConfig()
outlook = Dispatch("Outlook.Application")
ex = outlook.ActiveExplorer()
if ex:
@ -222,18 +224,18 @@ class OutlookAddin:
item.TooltipText = "Click to Open Document that has been pushed to server."
item.Enabled = True
def OnDisconnection(self, mode, custom):
self.item.close()
mngr = manager.GetManager()
mngr.config['login'] = False
mngr.SaveConfig()
print "OnDisconnection"
pass
def OnAddInsUpdate(self, custom):
print "OnAddInsUpdate", custom
pass
def OnStartupComplete(self, custom):
print "OnStartupComplete", custom
pass
def OnBeginShutdown(self, custom):
print "OnBeginShutdown", custom
pass
def GetAppDataPath(self):
mngr = manager.GetManager()
return mngr.data_directory

View File

@ -272,15 +272,15 @@ class OKButtonProcessor(ButtonProcessor):
return
setConnAttribs(server, port, self.mngr)
if str(NewConn.getitem('_running')) == 'False':
msg = "No server running on host '%s' at port '%d'. Press ignore to still continue with this configuration?"%(server,port)
r=win32ui.MessageBox(msg, "OpenERP Connection", win32con.MB_ABORTRETRYIGNORE | win32con.MB_ICONQUESTION)
if r==3:
resetConnAttribs(self.window)
return
elif r==4:
self.OnClicked(id)
elif r==5:
setConnAttribs(server, port, self.mngr)
msg = "No server running on host '%s' at port '%d'. Press ignore to still continue with this configuration?"%(server,port)
r=win32ui.MessageBox(msg, "OpenERP Connection", win32con.MB_ABORTRETRYIGNORE | win32con.MB_ICONQUESTION)
if r==3:
resetConnAttribs(self.window)
return
elif r==4:
self.OnClicked(id)
elif r==5:
setConnAttribs(server, port, self.mngr)
win32gui.EndDialog(self.window.hwnd, id)
class DoneButtonProcessor(ButtonProcessor):
@ -661,7 +661,6 @@ def CreateCase(btnProcessor,*args):
if not section:
win32ui.MessageBox("Documents can not be created.", "Documents Setting", flag_excl)
return
hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
partner_ids=[]
r = GetSelectedItems(hwndList)
@ -1412,7 +1411,6 @@ def SerachOpenDocuemnt(txtProcessor,*args):
txtProcessor.init_done=True
return
linktodoc = ""
message_id = None
try:
session = win32com.client.Dispatch("MAPI.session")

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,6 @@ import sys
import chilkat
import os
from manager import ustr
import win32ui
import email
cemail = chilkat.CkEmail()
dt = chilkat.SYSTEMTIME()
@ -34,7 +33,6 @@ def generateEML(mail):
body = mail.Body.encode("utf-8")
recipients = mail.Recipients
sender_email = mail.SenderEmailAddress
sender_name = mail.SenderEmailAddress
attachments=mail.Attachments
cemail = chilkat.CkEmail()
@ -50,8 +48,7 @@ def generateEML(mail):
eml_name= ustr(sub).encode('iso-8859-1')+'-'+str(mail.EntryID)[-9:]
ls = ['*', '/', '\\', '<', '>', ':', '?', '"', '|', '\t', '\n']
#mails_folder_path = os.path.abspath("%temp%\\dialogs\\resources\\mails\\")
mails_folder_path = os.path.abspath("C:\\printing")
mails_folder_path = os.path.abspath("%temp%\\dialogs\\resources\\mails\\")
attachments_folder_path = mails_folder_path + "\\attachments\\"
if not os.path.exists(attachments_folder_path):
os.makedirs(attachments_folder_path)
@ -70,7 +67,6 @@ def generateEML(mail):
att_file = os.path.join(attachments_folder_path, fn)
if os.path.exists(att_file):
os.remove(att_file)
f1 = att_file
attachments[i].SaveAsFile(att_file)
contentType = cemail.addFileAttachment(att_file)
if (contentType == None ):
@ -94,4 +90,4 @@ def generateEML(mail):
if (success == False):
print cemail.lastErrorText()
sys.exit()
return new_mail
return new_mail, eml_path

View File

@ -104,10 +104,9 @@ class OpenERPManager:
self.application_directory = os.path.dirname(this_filename)
self.windows_data_directory = self.LocateDataDirectory()
self.data_directory = self.windows_data_directory
self.default_objects = [('Partners','res.partner',''),('Partner Address','res.partner.address',''), \
('Account Invoices','account.invoice',''), ('Accounts','account.account',''), \
('Projects', 'project.project',''),('Sale Orders','sale.order',''), \
('Project Tasks','project.task',''), ('Products', 'product.product', '')]
self.default_objects = [('Partners','res.partner',''),('Account Invoices','account.invoice',''), \
('Products', 'product.product',''),('Sale Orders','sale.order',''), \
('Leads','crm.lead','')]
self.config=self.LoadConfig()

View File

@ -27,7 +27,7 @@ import time
from manager import ustr
from win32com.mapi import mapitags
import pythoncom
import win32com
import win32com
import win32ui
waittime = 10
wait_count = 0
@ -80,25 +80,25 @@ class XMLRpcConn(object):
self.protocol=None
def getitem(self, attrib):
v=self.__getattribute__(attrib)
return str(v)
v=self.__getattribute__(attrib)
return str(v)
def setitem(self, attrib, value):
return self.__setattr__(attrib, value)
def GetDBList(self):
conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/db')
try:
db_list = execute(conn, 'list')
if db_list == False:
self._running=False
return []
else:
self._running=True
except:
db_list=-1
self._running=True
return db_list
conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/db')
try:
db_list = execute(conn, 'list')
if db_list == False:
self._running=False
return []
else:
self._running=True
except:
db_list=-1
self._running=True
return db_list
def login(self,dbname, user, pwd):
self._dbname = dbname
@ -133,35 +133,36 @@ class XMLRpcConn(object):
break
def ArchiveToOpenERP(self, recs, mail):
import win32con
import win32con
import win32ui
conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/object')
flag = False
new_msg = ext_msg =""
message_id = referances = None
try:
session = win32com.client.Dispatch("MAPI.session")
session.Logon('Outlook')
objMessage = session.GetMessage(mail.EntryID, mail.Parent.StoreID)
objFields = objMessage.Fields
strheader = objFields.Item(mapitags.PR_TRANSPORT_MESSAGE_HEADERS)
strheader = ustr(strheader).encode('iso-8859-1')
headers = {}
strheader = strheader.replace("\n ", " ").splitlines()
for line in strheader:
split_here = line.find(":")
headers[line[:split_here]] = line[split_here:]
temp1 = headers.get('Message-ID')
temp2 = headers.get('Message-Id')
referances = headers.get('References')
if temp1 == None: message_id = temp2
if temp2 == None: message_id = temp1
startCut = message_id.find("<")
endCut = message_id.find(">")
message_id = message_id[startCut:endCut+1]
if not referances == None:
startCut = referances.find("<")
endCut = referances.find(">")
referances = referances[startCut:endCut+1]
session = win32com.client.Dispatch("MAPI.session")
session.Logon('Outlook')
objMessage = session.GetMessage(mail.EntryID, mail.Parent.StoreID)
objFields = objMessage.Fields
strheader = objFields.Item(mapitags.PR_TRANSPORT_MESSAGE_HEADERS)
strheader = ustr(strheader).encode('iso-8859-1')
headers = {}
strheader = strheader.replace("\n ", " ").splitlines()
for line in strheader:
split_here = line.find(":")
headers[line[:split_here]] = line[split_here:]
temp1 = headers.get('Message-ID')
temp2 = headers.get('Message-Id')
referances = headers.get('References')
if temp1 == None: message_id = temp2
if temp2 == None: message_id = temp1
startCut = message_id.find("<")
endCut = message_id.find(">")
message_id = message_id[startCut:endCut+1]
if not referances == None:
startCut = referances.find("<")
endCut = referances.find(">")
referances = referances[startCut:endCut+1]
except Exception,e:
win32ui.MessageBox(str(e),"Archive To OpenERP")
return
@ -195,11 +196,12 @@ class XMLRpcConn(object):
}
obj_list= ['crm.lead','project.issue','hr.applicant','res.partner']
if rec[0] not in obj_list:
ids = self.CreateEmailAttachment(rec,mail)
self.CreateEmailAttachment(rec,mail)
result = {}
if attachments:
result = self.MakeAttachment([rec], mail)
attachment_ids = result.get(model, {}).get(res_id, [])
execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'email.server.tools','history',model, res_id, msg, attachment_ids)
new_msg += """- {0} : {1}\n""".format(object_name,str(rec[2]))
flag = True
@ -267,36 +269,36 @@ class XMLRpcConn(object):
flag = False
id = -1
try:
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
email=eml.generateEML(mail)
message_id = None
session = win32com.client.Dispatch("MAPI.session")
session.Logon('Outlook')
objMessage = session.GetMessage(mail.EntryID, mail.Parent.StoreID)
objFields = objMessage.Fields
strheader = objFields.Item(mapitags.PR_TRANSPORT_MESSAGE_HEADERS)
strheader = ustr(strheader).encode('iso-8859-1')
headers = {}
strheader = strheader.replace("\n ", " ").splitlines()
for line in strheader:
split_here = line.find(":")
headers[line[:split_here]] = line[split_here:]
temp1 = headers.get('Message-ID')
temp2 = headers.get('Message-Id')
if temp1 == None: message_id = temp2
if temp2 == None: message_id = temp1
startCut = message_id.find("<")
endCut = message_id.find(">")
message_id = message_id[startCut:endCut+1]
email.replace_header('Message-Id',message_id)
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'email.server.tools','process_email',section, str(email))
if id > 0:
flag = True
return flag
else:
flag = False
return flag
except Exception,e:
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
email, path = eml.generateEML(mail)
message_id = None
session = win32com.client.Dispatch("MAPI.session")
session.Logon('Outlook')
objMessage = session.GetMessage(mail.EntryID, mail.Parent.StoreID)
objFields = objMessage.Fields
strheader = objFields.Item(mapitags.PR_TRANSPORT_MESSAGE_HEADERS)
strheader = ustr(strheader).encode('iso-8859-1')
headers = {}
strheader = strheader.replace("\n ", " ").splitlines()
for line in strheader:
split_here = line.find(":")
headers[line[:split_here]] = line[split_here:]
temp1 = headers.get('Message-ID')
temp2 = headers.get('Message-Id')
if temp1 == None: message_id = temp2
if temp2 == None: message_id = temp1
startCut = message_id.find("<")
endCut = message_id.find(">")
message_id = message_id[startCut:endCut+1]
email.replace_header('Message-Id',message_id)
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'email.server.tools','process_email',section, str(email))
if id > 0:
flag = True
return flag
else:
flag = False
return flag
except Exception,e:
win32ui.MessageBox("Create Case\n"+str(e),"Mail Reading Error")
return flag
@ -446,11 +448,21 @@ class XMLRpcConn(object):
return True
def SearchEmailResources(self, message_id):
import win32ui
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
res_vals = []
mail_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mailgate.message', 'search', [('message_id','=',message_id)])
ref_mail_id = None
if not mail_id:
return None
ref_mail_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mailgate.message', 'search', [('references','=',message_id)])
if ref_mail_id:
win32ui.MessageBox(str(ref_mail_id),"ref_mail_id")
address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mailgate.message','read',ref_mail_id[0],['model','res_id'])
win32ui.MessageBox(str(address),"address")
for key, vals in address.items():
res_vals.append([key,vals])
return res_vals
return None
address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mailgate.message','read',mail_id[0],['model','res_id'])
for key, vals in address.items():
res_vals.append([key,vals])
@ -506,6 +518,8 @@ class XMLRpcConn(object):
return country
def CreateEmailAttachment(self, rec, mail):
import eml
email, path = eml.generateEML(mail)
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
obj = rec[0]
obj_id = rec[1]
@ -523,16 +537,12 @@ class XMLRpcConn(object):
l = 64 - len(fn)
f = fn.split('.')
fn = f[0][0:l] + '.' + f[-1]
fn = fn[:-4]+'.txt'
f = open(fn,"w")
body = mail.Body.encode("utf-8")
f.writelines(body)
f.close()
f=open(fn,"rb")
fn = fn[:-4]+".eml"
f = open(path)
content = "".join(f.readlines()).encode('base64')
f.close()
res['name'] = ustr((mail.Subject).replace(' ',''))
res['datas_fname'] = ustr(fn)
res['name'] = fn
res['datas_fname'] = fn
res['datas'] = content
res['res_id'] = obj_id
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.attachment','create',res)

View File

@ -43,7 +43,7 @@ class process_process(osv.osv):
_description = "Process"
_columns = {
'name': fields.char('Name', size=30,required=True, translate=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the process without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the process without removing it."),
'model_id': fields.many2one('ir.model', 'Object', ondelete='set null'),
'note': fields.text('Notes', translate=True),
'node_ids': fields.one2many('process.node', 'process_id', 'Nodes')

View File

@ -491,7 +491,7 @@ class stock_warehouse_orderpoint(osv.osv):
_columns = {
'name': fields.char('Name', size=32, required=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the orderpoint without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the orderpoint without removing it."),
'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True),
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True, ondelete="cascade"),
'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="cascade"),

View File

@ -97,7 +97,7 @@ class product_pricelist(osv.osv):
_description = "Pricelist"
_columns = {
'name': fields.char('Pricelist Name',size=64, required=True, translate=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the pricelist without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the pricelist without removing it."),
'type': fields.selection(_pricelist_type_get, 'Pricelist Type', required=True),
'version_id': fields.one2many('product.pricelist.version', 'pricelist_id', 'Pricelist Versions'),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),

View File

@ -427,7 +427,7 @@ class product_product(osv.osv):
'code': fields.function(_product_code, method=True, type='char', string='Reference'),
'partner_ref' : fields.function(_product_partner_ref, method=True, type='char', string='Customer ref'),
'default_code' : fields.char('Reference', size=64),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the product without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the product without removing it."),
'variants': fields.char('Variants', size=64),
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"),
'ean13': fields.char('EAN13', size=13),

View File

@ -127,7 +127,7 @@ class project(osv.osv):
_columns = {
'complete_name': fields.function(_complete_name, method=True, string="Project Name", type='char', size=250),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the project without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the project without removing it."),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of Projects."),
'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc.", ondelete="cascade", required=True),
'priority': fields.integer('Sequence', help="Gives the sequence order when displaying a list of task"),
@ -153,6 +153,7 @@ class project(osv.osv):
store = {
'project.project': (lambda self, cr, uid, ids, c={}: ids, ['tasks'], 10),
'project.task': (_get_project_task, ['planned_hours', 'effective_hours', 'remaining_hours', 'total_hours', 'progress', 'delay_hours','state'], 10),
'project.task.work': (_get_project_work, ['hours'], 10),
}),
'warn_customer': fields.boolean('Warn Partner', help="If you check this, the user will have a popup when closing a task that propose a message to send by email to the customer.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
'warn_header': fields.text('Mail Header', help="Header added at the beginning of the email for the warning message sent to the customer when a task is closed.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),

View File

@ -223,20 +223,17 @@
widget="float_time"
attrs="{'readonly':[('state','!=','draft')]}"
on_change="onchange_planned(planned_hours, effective_hours)"/>
<field name="effective_hours" widget="float_time"/>
</group>
<group col="3" colspan="2">
<field name="remaining_hours" widget="float_time" attrs="{'readonly':[('state','!=','draft')]}" colspan="2"/>
<button name="%(action_project_task_reevaluate)d" string="Reevaluate" type="action" colspan="1" target="new" states="open,pending" icon="gtk-edit"/>
<field name="delay_hours" widget="float_time"/>
</group>
<field colspan="4" name="description" nolabel="1" attrs="{'readonly':[('state','=','done')]}" widget="text_wiki"/>
<field colspan="4" name="work_ids" nolabel="1" attrs="{'readonly':[('state','in',['draft','done'])]}">
<tree string="Task Work" editable="top">
<field name="name" />
<field name="hours" widget="float_time" />
<field name="hours" widget="float_time" sum="Spent Hours"/>
<field name="user_id" />
<field name="date" />
</tree>
@ -310,7 +307,8 @@
<field name="project_id" icon="gtk-indent" domain="['|',('user_id','=',uid),('members','=',uid)]" invisible="context.get('user_invisible', False)"/>
<field name="user_id" invisible="context.get('user_invisible', False)"/>
<field name="delegated_user_id" invisible="context.get('show_delegated', True)"/>
<field name="remaining_hours" widget="float_time" sum="Remaining Hours" on_change="onchange_remaining(remaining_hours,planned_hours)"/>
<field name="effective_hours" widget="float_time" sum="Spent Hours"/>
<field name="remaining_hours" widget="float_time" sum="Remaining Hours" on_change="onchange_remaining(remaining_hours,planned_hours)"/>
<field name="date_deadline" invisible="context.get('deadline_visible',True)"/>
<field name="type_id" groups="base.group_extended" invisible="context.get('set_visible',False)"/>
<button name="next_type" invisible="context.get('set_visible',False)"

View File

@ -21,6 +21,7 @@
from lxml import etree
import tools
from tools.translate import _
from osv import fields, osv
@ -48,20 +49,21 @@ class project_task_delegate(osv.osv_memory):
record_id = context and context.get('active_id', False) or False
task_pool = self.pool.get('project.task')
task = task_pool.browse(cr, uid, record_id, context=context)
task_name =tools.ustr(task.name)
if 'name' in fields:
if task.name.startswith(_('CHECK: ')):
newname = str(task.name).replace(_('CHECK: '), '')
if task_name.startswith(_('CHECK: ')):
newname = str(task_name).replace(_('CHECK: '), '')
else:
newname = task.name or ''
newname = task_name or ''
res.update({'name': newname})
if 'planned_hours' in fields:
res.update({'planned_hours': task.remaining_hours or 0.0})
if 'prefix' in fields:
if task.name.startswith(_('CHECK: ')):
newname = str(task.name).replace(_('CHECK: '), '')
if task_name.startswith(_('CHECK: ')):
newname = str(task_name).replace(_('CHECK: '), '')
else:
newname = task.name or ''
newname = task_name or ''
prefix = _('CHECK: ') + newname
res.update({'prefix': prefix})
if 'new_task_description' in fields:
@ -103,6 +105,7 @@ class project_task_delegate(osv.osv_memory):
task_id = context.get('active_id', False)
task_pool = self.pool.get('project.task')
delegate_data = self.read(cr, uid, ids, context=context)[0]
delegate_data['name'] = tools.ustr(delegate_data['name'])
task_pool.do_delegate(cr, uid, task_id, delegate_data, context=context)
return {}

View File

@ -1,64 +1,64 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<data noupdate="1">
<record model="basic.calendar" id="caldav.basic_calendar2">
<field name="name">Tasks</field>
<field name="collection_id" ref="document.dir_calendars"></field>
<field name="type">vtodo</field>
</record>
<field name="name">Tasks</field>
<field name="collection_id" ref="document.dir_calendars"></field>
<field name="type">vtodo</field>
</record>
<record model="basic.calendar.lines" id="caldav.calendar_lines_todo">
<field name="name">vtodo</field>
<field name="calendar_id" ref="caldav.basic_calendar2" />
<field name="object_id" search="[('model','=','project.task')]" />
<field name="name">vtodo</field>
<field name="calendar_id" ref="caldav.basic_calendar2" />
<field name="object_id" search="[('model','=','project.task')]" />
<field name="domain">[('user_id','=', uid)]</field>
</record>
<record model="basic.calendar.fields" id="map_todo_1">
<field name="name" ref="caldav.field_todo_status" />
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','project.task')]" />
<field name="mapping">{'needs-action': 'draft', 'completed': 'done', 'in-process': 'open', 'cancelled': 'cancelled'}</field>
<field name="fn">field</field>
</record>
</record>
<record model="basic.calendar.fields" id="map_todo_1">
<field name="name" ref="caldav.field_todo_status" />
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','project.task')]" />
<field name="mapping">{'needs-action': 'draft', 'completed': 'done', 'in-process': 'open', 'cancelled': 'cancelled'}</field>
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_2">
<field name="name" ref="caldav.field_todo_exdate"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','exdate'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','exdate'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_3">
<field name="name" ref="caldav.field_todo_attendee" />
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','project.task')]" />
<field name="fn">field</field>
</record>
<field name="name" ref="caldav.field_todo_attendee" />
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','project.task')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_4">
<field name="name" ref="caldav.field_todo_valarm"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','base_calendar_alarm_id'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','base_calendar_alarm_id'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_5">
<field name="name" ref="caldav.field_todo_description"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<!-- Sequence is not impemented right.
See http://tools.ietf.org/html/rfc5545#section-3.8.7.4
Disabling..
See http://tools.ietf.org/html/rfc5545#section-3.8.7.4
Disabling..
<record model="basic.calendar.fields" id="map_todo_6">
<field name="name" ref="caldav.field_todo_seq"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','sequence'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','sequence'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
-->
@ -66,176 +66,176 @@
<record model="basic.calendar.fields" id="map_todo_7">
<field name="name" ref="caldav.field_todo_url"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','base_calendar_url'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','base_calendar_url'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_9">
<field name="name" ref="caldav.field_todo_percent"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','progress'),('model_id.model','=','project.task')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_10">
<field name="name" ref="caldav.field_todo_percent"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','progress'),('model_id.model','=','project.task')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_10">
<field name="name" ref="caldav.field_todo_vtimezone"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','vtimezone'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','vtimezone'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
</record>
<record model="basic.calendar.fields" id="map_todo_11">
<field name="name" ref="caldav.field_todo_summary"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_12">
<field name="name" ref="caldav.field_event_priority"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','priority'),('model_id.model','=','project.task')]" />
<field name="fn">field</field>
<field name="mapping">{'1': '0', '2': '1', '3': '1','4': '1', '5': '2', '6': '3', '7': '3', '8': '3', '9': '4'}</field>
</record>
<field name="name" ref="caldav.field_event_priority"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','priority'),('model_id.model','=','project.task')]" />
<field name="fn">field</field>
<field name="mapping">{'1': '0', '2': '1', '3': '1','4': '1', '5': '2', '6': '3', '7': '3', '8': '3', '9': '4'}</field>
</record>
<record model="basic.calendar.fields" id="map_todo_13">
<field name="name" ref="caldav.field_todo_location"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','location'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','location'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_14">
<field name="name" ref="caldav.field_todo_exrule"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','exrule'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','exrule'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_15">
<field name="name" ref="caldav.field_todo_duration"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','planned_hours'),('model_id.model','=','project.task')]" />
<field name="fn">hours</field>
</record>
<field name="name" ref="caldav.field_todo_duration"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','planned_hours'),('model_id.model','=','project.task')]" />
<field name="fn">hours</field>
</record>
<record model="basic.calendar.fields" id="map_todo_16">
<field name="name" ref="caldav.field_todo_dtstart"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','date'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','date'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_17">
<field name="name" ref="caldav.field_todo_rrule"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','rrule'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','rrule'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_18">
<field name="name" ref="caldav.field_todo_class"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','class'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','class'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_19">
<field name="name" ref="caldav.field_todo_uid"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','id'),('model_id.model','=','calendar.todo')]" />
<field name="field_id" search="[('name','=','id'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
</record>
<record model="basic.calendar.lines" id="caldav.calendar_lines_alarm2">
<field name="name">valarm</field>
<field name="calendar_id" ref="caldav.basic_calendar2" />
<field name="object_id" search="[('model','=','calendar.alarm')]" />
</record>
<record model="basic.calendar.lines" id="caldav.calendar_lines_attendee2">
<field name="name">attendee</field>
<field name="calendar_id" ref="caldav.basic_calendar2" />
<field name="object_id" search="[('model','=','calendar.attendee')]" />
</record>
<field name="name">valarm</field>
<field name="calendar_id" ref="caldav.basic_calendar2" />
<field name="object_id" search="[('model','=','calendar.alarm')]" />
</record>
<record model="basic.calendar.lines" id="caldav.calendar_lines_attendee2">
<field name="name">attendee</field>
<field name="calendar_id" ref="caldav.basic_calendar2" />
<field name="object_id" search="[('model','=','calendar.attendee')]" />
</record>
<record model="basic.calendar.fields" id="map_alarm_1">
<field name="name" ref="caldav.field_alarm_attendee"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','attendee_ids'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_2">
<field name="name" ref="caldav.field_alarm_trigger_duration"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','trigger_duration'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','trigger_duration'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_3">
<field name="name" ref="caldav.field_alarm_description"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','description'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_4">
<field name="name" ref="caldav.field_alarm_attach"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','attach'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','attach'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_5">
<field name="name" ref="caldav.field_alarm_trigger_occurs"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','trigger_occurs'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','trigger_occurs'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_6">
<field name="name" ref="caldav.field_alarm_trigger_interval"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','trigger_interval'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','trigger_interval'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_7">
<field name="name" ref="caldav.field_alarm_summary"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','name'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_8">
<field name="name" ref="caldav.field_alarm_duration"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','duration'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','duration'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_9">
<field name="name" ref="caldav.field_alarm_repeat"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','repeat'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','repeat'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_10">
<field name="name" ref="caldav.field_alarm_action"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','action'),('model_id.model','=','calendar.alarm')]" />
<field name="field_id" search="[('name','=','action'),('model_id.model','=','calendar.alarm')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_alarm_11">
<field name="name" ref="caldav.field_alarm_trigger_related"/>
<field name="type_id" ref="caldav.calendar_lines_alarm2" />
<field name="field_id" search="[('name','=','trigger_related'),('model_id.model','=','res.alarm')]" />
<field name="field_id" search="[('name','=','trigger_related'),('model_id.model','=','res.alarm')]" />
<field name="fn">field</field>
</record>
@ -243,79 +243,79 @@
<record model="basic.calendar.fields" id="map_attendee_1">
<field name="name" ref="caldav.field_attendee_cn"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','cn'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','cn'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_2">
<field name="name" ref="caldav.field_attendee_sent-by"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','sent_by'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','sent_by'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_3">
<field name="name" ref="caldav.field_attendee_language"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','language'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','language'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_4">
<field name="name" ref="caldav.field_attendee_delegated-from"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','delegated_from'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','delegated_from'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_5">
<field name="name" ref="caldav.field_attendee_member"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','member'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','member'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_6">
<field name="name" ref="caldav.field_attendee_cutype"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','cutype'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','cutype'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_7">
<field name="name" ref="caldav.field_attendee_role"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','role'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','role'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_8">
<field name="name" ref="caldav.field_attendee_partstat"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','state'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_9">
<field name="name" ref="caldav.field_attendee_delegated-to"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','delegated_to'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','delegated_to'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_10">
<field name="name" ref="caldav.field_attendee_dir"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','dir'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','dir'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_attendee_11">
<field name="name" ref="caldav.field_attendee_rsvp"/>
<field name="type_id" ref="caldav.calendar_lines_attendee2" />
<field name="field_id" search="[('name','=','rsvp'),('model_id.model','=','calendar.attendee')]" />
<field name="field_id" search="[('name','=','rsvp'),('model_id.model','=','calendar.attendee')]" />
<field name="fn">field</field>
</record>
</data>
</data>
</openerp>

View File

@ -376,7 +376,9 @@
res_model="project.task"
src_model="project.phase"
view_mode="tree,form"
context="{'search_default_phase_id': [active_id]}"/>
context="{'search_default_phase_id': [active_id]}"
domain="[('phase_id', '=', active_id)]"
/>
<act_window
context="{'search_default_project_id': [active_id]}"

View File

@ -43,7 +43,7 @@ project_scrum_project()
class project_scrum_sprint(osv.osv):
_name = 'project.scrum.sprint'
_description = 'Project Scrum Sprint'
_order = 'date_start'
_order = 'date_start desc'
def _compute(self, cr, uid, ids, fields, arg, context=None):
res = {}.fromkeys(ids, 0.0)
progress = {}

View File

@ -112,7 +112,7 @@
</notebook>
<group col="8" colspan="4">
<field name="state" select="1" readonly="1"/>
<button type="object" string="Cancel" name="button_cancel" states="open,pending" icon="gtk-stop"/>
<button type="object" string="Cancel" name="button_cancel" states="draft,open,pending" icon="gtk-stop"/>
<button type="object" string="Open" name="button_open" states="draft,pending" icon="terp-camera_test"/>
<button type="action" string="Convert to Task" name="%(action_scrum_backlog_to_task)d" states="pending" icon="gtk-execute"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>

View File

@ -31,7 +31,39 @@
</xpath>
</field>
</record>
<record id="view_account_analytic_line_search_account_inherit" model="ir.ui.view">
<field name="name">account.analytic.line.search.account_id</field>
<field name="model">account.analytic.line</field>
<field name="type">search</field>
<field name="inherit_id" ref="account.view_account_analytic_line_filter"/>
<field name="arch" type="xml">
<field name="account_id" position="replace">
<field name="account_id" string="Project" />
</field>
</field>
</record>
<record id="view_account_analytic_line_form_inherit_account_id" model="ir.ui.view">
<field name="name">account.analytic.line.form.account_id</field>
<field name="model">account.analytic.line</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.view_account_analytic_line_form"/>
<field name="arch" type="xml">
<field name="account_id" position="replace">
<field name="account_id" string="Project"/>
</field>
</field>
</record>
<record id="view_account_analytic_line_tree_inherit_account_id" model="ir.ui.view">
<field name="name">account.analytic.line.tree.account_id</field>
<field name="model">account.analytic.line</field>
<field name="type">tree</field>
<field name="inherit_id" ref="account.view_account_analytic_line_tree"/>
<field name="arch" type="xml">
<field name="account_id" position="replace">
<field name="account_id" string="Project"/>
</field>
</field>
</record>
<menuitem id="menu_project_billing" name="Invoicing"
parent="base.menu_main_pm" sequence="5"/>
<menuitem id="menu_project_billing_line" name="Invoice Tasks Work"

View File

@ -31,17 +31,29 @@
<field name="arch" type="xml">
<search string="Tasks by User">
<group colspan="4" col="3">
<filter icon="terp-go-year" string="This Year" domain="[('year','=',time.strftime('%%Y'))]" />
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" />
<filter icon="terp-go-year" string=" Year "
name="year"
domain="[('name','&lt;=', time.strftime('%%Y-%%m-%%d')),('name','&gt;=',time.strftime('%%Y-01-01'))]"
help="Task Hours in current year"/>
<filter icon="terp-go-month" string=" Month "
name="month"
domain="[('name','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('name','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
help="Task Hours in current month"/>
<filter icon="terp-go-month"
string=" Month-1 "
domain="[('name','&lt;=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('name','&gt;=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
help="Task hours of last month"/>
<separator orientation="vertical"/>
<field name="user_id" select="1" widget="selection"/>
<field name="user_id"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="3">
<filter string="User" icon="terp-personal" context="{'group_by':'user_id'}" default="1" />
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" />
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" />
</group>
<filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}" default="1" />
<separator orientation="vertical"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/>
</group>
</search>
</field>
</record>
@ -64,8 +76,7 @@
<field name="res_model">report.timesheet.task.user</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_report_timesheet_task_user_search"/>
<field name="context">{'search_default_month':1, 'search_default_group_user_id':1}</field>
</record>
<menuitem id="menu_timesheet_task_user" parent="hr_timesheet.menu_hr_reporting_timesheet"
action="action_report_timesheet_task_user" sequence="1"/>

View File

@ -224,7 +224,7 @@ class resource_resource(osv.osv):
_columns = {
'name' : fields.char("Name", size=64, required=True),
'code': fields.char('Code', size=16),
'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the resource record without removing it."),
'active' : fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the resource record without removing it."),
'company_id' : fields.many2one('res.company', 'Company'),
'resource_type': fields.selection([('user','Human'),('material','Material')], 'Resource Type', required=True),
'user_id' : fields.many2one('res.users', 'User', help='Related user name for the resource to manage its access.'),

View File

@ -26,7 +26,7 @@ class sale_journal_invoice_type(osv.osv):
_description = 'Invoice Types'
_columns = {
'name': fields.char('Invoice Type', size=64, required=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the invoice type without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the invoice type without removing it."),
'note': fields.text('Note'),
'invoicing_method': fields.selection([('simple', 'Non grouped'), ('grouped', 'Grouped')], 'Invoicing method', required=True),
}

View File

@ -67,7 +67,7 @@ class subscription_subscription(osv.osv):
_description = "Subscription"
_columns = {
'name': fields.char('Name', size=60, required=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the subscription without removing it."),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the subscription without removing it."),
'partner_id': fields.many2one('res.partner', 'Partner'),
'notes': fields.text('Notes'),
'user_id': fields.many2one('res.users', 'User', required=True),

View File

@ -148,6 +148,7 @@ class thunderbird_partner(osv.osv_memory):
dictcreate = dict(vals)
ref_ids = str(dictcreate.get('ref_ids')).split(';')
msg = dictcreate.get('message')
mail = msg
msg = self.pool.get('email.server.tools').parse_message(msg)
server_tools_pool = self.pool.get('email.server.tools')
message_id = msg.get('message-id', False)
@ -183,11 +184,11 @@ class thunderbird_partner(osv.osv_memory):
l = 64 - len(fn)
f = fn.split('.')
fn = f[0][0:l] + '.' + f[-1]
fn = fn[:-4]+'.txt'
fn = fn[:-4]+'.eml'
res['res_model'] = model
res['name'] = msg.get('subject','NO-SUBJECT')
res['name'] = msg.get('subject','NO-SUBJECT')+".eml"
res['datas_fname'] = fn
res['datas'] = base64.b64encode(msg.get('body'))
res['datas'] = base64.b64encode(mail)
res['res_id'] = res_id
obj_attch.create(cr, uid, res)
server_tools_pool.history_message(cr, uid, model, res_id, msg_new)
@ -203,8 +204,15 @@ class thunderbird_partner(osv.osv_memory):
def search_message(self, cr, uid, message, context=None):
#@param message: string of mail which is read from EML File
#@return model,res_id
references = []
dictcreate = dict(message)
message_id = dictcreate.get('message_id')
msg = dictcreate.get('message')
msg = self.pool.get('email.server.tools').parse_message(msg)
message_id = msg.get('message-id')
refs = msg.get('references',False)
references = False
if refs:
references = refs.split()
msg_pool = self.pool.get('mailgate.message')
model = ''
res_id = 0
@ -214,6 +222,13 @@ class thunderbird_partner(osv.osv_memory):
msg = msg_pool.browse(cr, uid, msg_ids[0])
model = msg.model
res_id = msg.res_id
else:
if references :
msg_ids = msg_pool.search(cr, uid, [('message_id','in',references)])
if msg_ids and len(msg_ids):
msg = msg_pool.browse(cr, uid, msg_ids[0])
model = msg.model
res_id = msg.res_id
return (model,res_id)

View File

@ -24,9 +24,9 @@ pref("extensions.tiny.partnername","");
pref("extensions.tiny.officeno","");
pref("extensions.tiny.phoneno","");
pref("extensions.tiny.address","");
pref("extensions.tiny.listobject","Partner,Partner Address,Accout Invoice,Project,Product,Account,Sale Order,Project Task");
pref("extensions.tiny.object","res.partner,res.partner.address,account.invoice,project.project,product.product,account.account,sale.order,project.task");
pref("extensions.tiny.imagename","chrome://openerp_plugin/skin/Partner.png,chrome://openerp_plugin/skin/Contact.png,chrome://openerp_plugin/skin/Invoice.png,chrome://openerp_plugin/skin/Project.png,chrome://openerp_plugin/skin/Product.png,chrome://openerp_plugin/skin/Account.png,chrome://openerp_plugin/skin/Sale.png,chrome://openerp_plugin/skin/Case.png,chrome://openerp_plugin/skin/Task.png");
pref("extensions.tiny.listobject","Partner,Accout Invoice,Product,Sale Order,Lead and opportunities");
pref("extensions.tiny.object","res.partner,account.invoice,product.product,sale.order,crm.lead");
pref("extensions.tiny.imagename","chrome://openerp_plugin/skin/Partner.png,chrome://openerp_plugin/skin/Invoice.png,chrome://openerp_plugin/skin/Product.png,chrome://openerp_plugin/skin/Sale.png,chrome://openerp_plugin/skin/Case.png");
pref("extensions.tiny.attachmentlength","");
pref("extensions.tiny.attachment","");
pref("extensions.tiny.db_list","false");

View File

@ -0,0 +1,12 @@
# Use this Shell Script for Cleaning & Compressing the chnages in Plugin
# Run this script using jar command.
rm chrome/openerp_plugin.jar
rm ../openerp_plugin.xpi
cd chrome/openerp_plugin/
jar cvf openerp_plugin.jar *
cd ..
mv openerp_plugin/openerp_plugin.jar openerp_plugin.jar
cd ..
zip -r ../openerp_plugin.xpi *