diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 4af3b43d54c..d8205ababa7 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -951,23 +951,8 @@ class account_invoice(osv.osv): return taxes.values() def _log_event(self, cr, uid, ids, factor=1.0, name='Open Invoice'): - invs = self.read(cr, uid, ids, ['type','partner_id','amount_untaxed']) - for inv in invs: - part=inv['partner_id'] and inv['partner_id'][0] - pc = pr = 0.0 - cr.execute('select sum(quantity*price_unit) from account_invoice_line where invoice_id=%s', (inv['id'],)) - total = inv['amount_untaxed'] - if inv['type'] in ('in_invoice','in_refund'): - partnertype='supplier' - eventtype = 'purchase' - pc = total*factor - else: - partnertype = 'customer' - eventtype = 'sale' - pr = total*factor - if self.pool.get('res.partner.event.type').check(cr, uid, 'invoice_open'): - self.pool.get('res.partner.event').create(cr, uid, {'name':'Invoice: '+name, 'som':False, 'description':name+' '+str(inv['id']), 'document':name, 'partner_id':part, 'date':time.strftime('%Y-%m-%d %H:%M:%S'), 'canal_id':False, 'user_id':uid, 'partner_type':partnertype, 'probability':1.0, 'planned_revenue':pr, 'planned_cost':pc, 'type':eventtype}) - return len(invs) + #TODO: implement messages system + return True def name_get(self, cr, uid, ids, context=None): if not len(ids): diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index 286d0f1d79e..e1e43420d6e 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -74,13 +74,13 @@ - + - + @@ -132,11 +132,13 @@ form - - - - - + + + + + + + diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml index ce07647dc92..2bd56a3b513 100644 --- a/addons/base_action_rule/base_action_rule_view.xml +++ b/addons/base_action_rule/base_action_rule_view.xml @@ -56,15 +56,15 @@ - + - + - + @@ -73,7 +73,7 @@ - + @@ -82,9 +82,9 @@ diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index bf93c9c775d..8a9764bff63 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -410,7 +410,10 @@ property or property parameter."), event.add('location').value = event_obj.location if event_obj.rrule: event.add('rrule').value = event_obj.rrule - + if event_obj.user_id: + event_org = event.add('organizer') + event_org.params['CN'] = [event_obj.user_id.name] + event_org.value = 'MAILTO:' + (event_obj.user_id.user_email or event_obj.user_id.name) if event_obj.alarm_id: # computes alarm data valarm = event.add('valarm') @@ -440,7 +443,7 @@ property or property parameter."), attendee_add.params['CUTYPE'] = [str(attendee.cutype)] attendee_add.params['ROLE'] = [str(attendee.role)] attendee_add.params['RSVP'] = [str(attendee.rsvp)] - attendee_add.value = 'MAILTO:' + attendee.email + attendee_add.value = 'MAILTO:' + (attendee.email or '') res = cal.serialize() return res @@ -480,8 +483,8 @@ property or property parameter."), 'company': company } body = html_invitation % body_vals - attach = self.get_ics_file(cr, uid, res_obj, context=context) if mail_to and email_from: + attach = self.get_ics_file(cr, uid, res_obj, context=context) tools.email_send( email_from, mail_to, diff --git a/addons/caldav/security/ir.model.access.csv b/addons/caldav/security/ir.model.access.csv index 4dd04fa4c68..fa7b85a39f1 100644 --- a/addons/caldav/security/ir.model.access.csv +++ b/addons/caldav/security/ir.model.access.csv @@ -10,3 +10,4 @@ "access_calendar_event_export","calendar.event.export","model_calendar_event_export","base.group_user",1,1,1,1 "access_calendar_event_import","calendar.event.import","model_calendar_event_import","base.group_user",1,1,1,1 "access_calendar_event_subscribe","calendar.event.subscribe","model_calendar_event_subscribe","base.group_user",1,1,1,1 +"access_basic_calendar","basic.calendar","model_basic_calendar","base.group_user",1,1,1,1 diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 386387b1157..ea5cf3f6ef2 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -108,13 +108,13 @@ between mails and Open ERP.""", 'crm_phonecall_demo.xml' ], 'test': [ -# 'test/test_crm_lead.yml', -# 'test/test_crm_meeting.yml', -# 'test/test_crm_opportunity.yml', -# 'test/test_crm_phonecall.yml', - ], - 'installable': True, - 'active': False, + 'test/test_crm_lead.yml', + 'test/test_crm_meeting.yml', + 'test/test_crm_opportunity.yml', + 'test/test_crm_phonecall.yml', + ], + 'installable': True, + 'active': False, 'certificate': '0079056041421', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm.py b/addons/crm/crm.py index ba45efd4b3b..d3c640efca3 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -203,9 +203,13 @@ class crm_case(object): address = self.pool.get('res.partner.address').browse(cr, uid, add) return {'value': {'email_from': address.email}} - def _history(self, cr, uid, cases, keyword, history=False, email=False, details=None, email_from=False, message_id=False, context={}): + def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}): mailgate_pool = self.pool.get('mailgate.thread') - return mailgate_pool._history(cr, uid, cases, keyword, history=history, email=email, details=details, email_from=email_from, message_id=message_id, context=context) + return mailgate_pool._history(cr, uid, cases, keyword, history=history,\ + subject=subject, email=email, \ + details=details, email_from=email_from,\ + message_id=message_id, attach=attach, \ + context=context) def case_open(self, cr, uid, ids, *args): """Opens Case @@ -438,6 +442,7 @@ class crm_case_section(osv.osv): 'child_ids': fields.one2many('crm.case.section', 'parent_id', 'Child Teams'), 'resource_calendar_id': fields.many2one('resource.calendar', "Resource's Calendar"), 'note': fields.text('Description'), + 'working_hours': fields.float('Working Hours', digits=(16,2 )), } _defaults = { diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 3a14659672a..9092efef8e8 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -82,23 +82,9 @@ this if you want the rule to send an email to the partner."), if hasattr(obj, 'categ_id'): ok = ok and (not action.trg_categ_id or action.trg_categ_id.id==obj.categ_id.id) -# TODO: history_line is removed -# if hasattr(obj, 'history_line'): -# ok = ok and (not action.trg_max_history or action.trg_max_history<=(len(obj.history_line)+1)) -# reg_history = action.regex_history -# result_history = True -# if reg_history: -# ptrn = re.compile(str(reg_history)) -# if obj.history_line: -# _result = ptrn.search(str(obj.history_line[0].description)) -# if not _result: -# result_history = False - regex_h = not reg_history or result_history - ok = ok and regex_h return ok def do_action(self, cr, uid, action, model_obj, obj, context={}): - """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @@ -118,7 +104,7 @@ this if you want the rule to send an email to the partner."), write['email_cc'] = obj.email_cc+','+obj.act_email_cc else: write['email_cc'] = obj.act_email_cc - + model_obj.write(cr, uid, [obj.id], write, context) emails = [] diff --git a/addons/crm/crm_data.xml b/addons/crm/crm_data.xml index cfff95888cc..1873f53f573 100644 --- a/addons/crm/crm_data.xml +++ b/addons/crm/crm_data.xml @@ -1,59 +1,11 @@ - - - - CRM: Create Case - crm_case_draft - - - - CRM: Open Case - crm_case_open - - - - CRM: Pending Case - crm_case_pending - - - - CRM: Cancel Case - crm_case_cancel - - - - CRM: Close Case - crm_case_done - - - - Sales Department Sales - - - - - - - - - - - - - - - - - - - Check cases rules diff --git a/addons/crm/crm_installer.py b/addons/crm/crm_installer.py index 1d9235feac6..8fb7c02ff85 100644 --- a/addons/crm/crm_installer.py +++ b/addons/crm/crm_installer.py @@ -39,7 +39,8 @@ class crm_installer(osv.osv_memory): 'crm_caldav': fields.boolean('Calendar Synchronizing', help="Help you to synchronize the meetings with other calender clients(e.g.: Sunbird)."), 'sale_crm': fields.boolean('Create Quotation from Opportunity', help="This module relates sale to opportunity cases in the CRM."), 'fetchmail': fields.boolean('Fetch Emails', help="Fetchmail Server."), - 'thunderbird': fields.boolean('Thunderbird', help="Thunderbird Interface."), + 'thunderbird': fields.boolean('Thunderbird', help="Thunderbird Interface."), + 'wiki_sale_faq': fields.boolean('Sale FAQ', help="Sale FAQ."), } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml index 370285352d1..e0d84c6eed2 100644 --- a/addons/crm/crm_installer_view.xml +++ b/addons/crm/crm_installer_view.xml @@ -35,7 +35,8 @@ - + + diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index a9e8d1c000f..c1060f3e658 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -108,8 +108,8 @@ class crm_lead(osv.osv, crm_case): 'email_cc': fields.text('Watchers Emails', size=252 , help="These \ people will receive a copy of the future communication between partner \ and users by email"), - 'description': fields.text('Description'), - 'write_date': fields.datetime('Update Date' , readonly=True), + 'description': fields.text('Notes'), + 'write_date': fields.datetime('Update Date' , readonly=True), # Lead fields 'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False), @@ -137,7 +137,6 @@ and users by email"), method=True, multi='day_open', type="float", store=True), 'day_close': fields.function(_compute_day, string='Days to Close', \ method=True, multi='day_close', type="float", store=True), - 'function_name': fields.char('Function', size=64), 'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True, help='The state is set to \'Draft\', when a case is created.\ \nIf the case is in progress the state is set to \'Open\'.\ diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 9c24e306154..31872e27ef4 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -47,7 +47,7 @@ name="convert_opportunity" string="Convert" help="Convert to Opportunity" - icon="gtk-index" + icon="gtk-index" type="object"/> - + @@ -160,16 +160,21 @@ - - + + + + + + + +