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 e434f28d947..ee1bbbbcc4b 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -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/crm/crm.py b/addons/crm/crm.py index bd366fff5c3..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 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_lead.py b/addons/crm/crm_lead.py index 3a358ddf649..c1060f3e658 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -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 8a1c7e0e51b..78437ee411f 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -72,7 +72,7 @@ - + @@ -161,16 +161,21 @@ - - + + + + + + + +