diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 572cb9d04fd..e0d31b9cf18 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -159,7 +159,7 @@ class account_bank_statement(osv.osv):
'period_id': _get_period,
}
- def button_confirm(self, cr, uid, ids, context={}):
+ def button_confirm_bank(self, cr, uid, ids, context={}):
done = []
res_currency_obj = self.pool.get('res.currency')
res_users_obj = self.pool.get('res.users')
diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py
index 8380a19b411..896b71e9f25 100644
--- a/addons/account/account_cash_statement.py
+++ b/addons/account/account_cash_statement.py
@@ -67,19 +67,25 @@ class account_cash_statement(osv.osv):
_inherit = 'account.bank.statement'
- def _get_starting_balance(self, cr, uid, ids, name, arg, context=None):
+ def _get_starting_balance(self, cr, uid, ids, context=None):
- """ Find starting balance "
+ """ Find starting balance
@param name: Names of fields.
@param arg: User defined arguments
@return: Dictionary of values.
- """
+ """
res ={}
for statement in self.browse(cr, uid, ids):
amount_total=0.0
+
+ if statement.journal_id.type not in('cash'):
+ continue
+
for line in statement.starting_details_ids:
amount_total+= line.pieces * line.number
- res[statement.id]=amount_total
+ res[statement.id] = {
+ 'balance_start':amount_total
+ }
return res
def _balance_end_cash(self, cr, uid, ids, name, arg, context=None):
@@ -116,7 +122,7 @@ class account_cash_statement(osv.osv):
""" To get default journal for the object"
@param name: Names of fields.
@return: journal
- """
+ """
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
journal = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
if journal:
@@ -166,11 +172,10 @@ class account_cash_statement(osv.osv):
company_id = company_pool.search(cr, uid, [])[0]
return company_id
-
+
_columns = {
'company_id':fields.many2one('res.company', 'Company', required=False),
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
- 'balance_start': fields.function(_get_starting_balance, store=True, method=True, string='Opening Balance', type='float',digits=(16,2), help="Opening balance based on cashBox"),
'balance_end_real': fields.float('Closing Balance', digits=(16,2), states={'confirm':[('readonly', True)]}, help="closing balance entered by the cashbox verifier"),
'state': fields.selection(
[('draft', 'Draft'),
@@ -178,7 +183,7 @@ class account_cash_statement(osv.osv):
('open','Open')], 'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"),
'total_entry_encoding':fields.function(_get_sum_entry_encoding, method=True, store=True, string="Cash Transaction", help="Total cash transactions"),
'closing_date':fields.datetime("Closed On"),
- 'balance_end': fields.function(_end_balance, method=True, store=True, string='Balance', help="Closing balance based on transactions"),
+ 'balance_end': fields.function(_end_balance, method=True, store=True, string='Balance', help="Closing balance based on Opening Balance and Transactions"),
'balance_end_cash': fields.function(_balance_end_cash, method=True, store=True, string='Balance', help="Closing balance based on cashBox"),
'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'),
'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),
@@ -205,8 +210,31 @@ class account_cash_statement(osv.osv):
for i in starting_details_ids:
if i and i[0] and i[1]:
i[0], i[1] = 0, 0
- res = super(account_cash_statement, self).create(cr, uid, vals, context=context)
- return res
+ res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context)
+ res = self._get_starting_balance(cr, uid, [res_id])
+ for rs in res:
+ super(account_cash_statement, self).write(cr, uid, rs, res.get(rs))
+ return res_id
+
+ def write(self, cr, uid, ids, vals, context=None):
+ """
+ Update redord(s) comes in {ids}, with new value comes as {vals}
+ return True on success, False otherwise
+
+ @param cr: cursor to database
+ @param user: id of current user
+ @param ids: list of record ids to be update
+ @param vals: dict of new values to be set
+ @param context: context arguments, like lang, time zone
+
+ @return: True on success, False otherwise
+ """
+
+ super(account_cash_statement, self).write(cr, uid, ids, vals)
+ res = self._get_starting_balance(cr, uid, ids)
+ for rs in res:
+ super(account_cash_statement, self).write(cr, uid, rs, res.get(rs))
+ return True
def onchange_journal_id(self, cr, uid, statement_id, journal_id, context={}):
""" Changes balance start and starting details if journal_id changes"
@@ -285,7 +313,7 @@ class account_cash_statement(osv.osv):
self.write(cr, uid, ids, vals)
return True
- def button_confirm(self, cr, uid, ids, context={}):
+ def button_confirm_cash(self, cr, uid, ids, context={}):
""" Check the starting and ending detail of statement
@return: True
@@ -296,20 +324,24 @@ class account_cash_statement(osv.osv):
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
account_bank_statement_line_obj = self.pool.get('account.bank.statement.line')
-
+
company_currency_id = res_users_obj.browse(cr, uid, uid, context=context).company_id.currency_id.id
for st in self.browse(cr, uid, ids, context):
+
+ self.write(cr, uid, [st.id], {'balance_end_real':st.balance_end})
+ st.balance_end_real = st.balance_end
+
if not st.state == 'open':
continue
if not self._equal_balance(cr, uid, ids, st, context):
- raise osv.except_osv(_('Error !'), _('Cash balance is not matching with closing balance !'))
-
- if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
- raise osv.except_osv(_('Error !'),
- _('The statement balance is incorrect !\n') +
- _('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
+ raise osv.except_osv(_('Error !'), _('CashBox Balance is not matching with Calculated Balance !'))
+
+# if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
+# raise osv.except_osv(_('Error !'),
+# _('The statement balance is incorrect !\n') +
+# _('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
if (not st.journal_id.default_credit_account_id) \
or (not st.journal_id.default_debit_account_id):
raise osv.except_osv(_('Configuration Error !'),
@@ -435,7 +467,7 @@ class account_cash_statement(osv.osv):
if move.reconcile_id and move.reconcile_id.line_ids:
torec += map(lambda x: x.id, move.reconcile_id.line_ids)
- #try:
+
if abs(move.reconcile_amount-move.amount)<0.0001:
writeoff_acc_id = False
@@ -447,13 +479,16 @@ class account_cash_statement(osv.osv):
account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context)
else:
account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context)
- #except:
- # raise osv.except_osv(_('Error !'), _('Unable to reconcile entry "%s": %.2f') % (move.name, move.amount))
if st.journal_id.entry_posted:
account_move_obj.write(cr, uid, [move_id], {'state':'posted'})
done.append(st.id)
- self.write(cr, uid, done, {'state':'confirm'}, context=context)
+
+ vals = {
+ 'state':'confirm',
+ 'closing_date':time.strftime("%Y-%m-%d %H:%M:%S")
+ }
+ self.write(cr, uid, done, vals, context=context)
return True
def button_cancel(self, cr, uid, ids, context={}):
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 80fb20e1fad..de8bc843faa 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -427,6 +427,9 @@
+
+
+
@@ -465,7 +468,7 @@
-
+
@@ -505,7 +508,7 @@
-
+
@@ -518,6 +521,18 @@
tree,form
[('journal_id.type', '=', 'bank')]
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
@@ -2267,7 +2282,7 @@
-
+
@@ -2285,7 +2300,7 @@
-
+
@@ -2318,7 +2333,7 @@
-
+
@@ -2349,7 +2364,7 @@
-
+
@@ -2360,18 +2375,18 @@
-
+
-
-
+
+
-
+
diff --git a/addons/account_cancel/account_cancel_view.xml b/addons/account_cancel/account_cancel_view.xml
index bcb9fb4d34e..5f63b6cf6d7 100644
--- a/addons/account_cancel/account_cancel_view.xml
+++ b/addons/account_cancel/account_cancel_view.xml
@@ -1,16 +1,17 @@
-
+
account.journal.form
account.journal
form
-
+
+
-
+
-
-
-
\ No newline at end of file
+
+
+
diff --git a/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py b/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py
index 2bfffb372b7..ef30e1af69f 100644
--- a/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py
+++ b/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py
@@ -49,7 +49,7 @@ class account_voucher_unreconcile(osv.osv_memory):
recs = [line.reconcile_id.id]
for rec in recs:
- obj_reconcile.unlink(cr, uid, rec)
+ reconcile_pool.unlink(cr, uid, rec)
if res.remove:
wf_service = netsvc.LocalService("workflow")
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index be1a53046a7..79b883c0236 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -22,7 +22,8 @@
from datetime import datetime
from osv import fields, osv, orm
from tools.translate import _
-import mx.DateTime
+from datetime import datetime
+from datetime import timedelta
import pooler
import re
import time
@@ -105,7 +106,9 @@ the rule to mark CC(mail to any other person defined in actions)."),
'act_mail_to_email': fields.char('Mail to these Emails', size=128, \
help="Email-id of the persons whom mail is to be sent"),
'act_mail_body': fields.text('Mail body', help="Content of mail"),
- 'regex_name': fields.char('Regular Expression on Model Name', size=128),
+ 'regex_name': fields.char('Regex on Resource Name', size=128, help="Regular expression for mathching name of the resource\
+\ne.g.: urgent.* will search for records having name starting with urgent\
+\nNote: This is case sensitive search."),
'server_action_id': fields.many2one('ir.actions.server', 'Server Action', help="Describes the action name.\neg:on which object which action to be taken on basis of which condition"),
'filter_id':fields.many2one('ir.filters', 'Filter', required=False),
'domain':fields.char('Domain', size=124, required=False, readonly=False),
@@ -352,23 +355,23 @@ the rule to mark CC(mail to any other person defined in actions)."),
base = False
if hasattr(obj, 'create_date') and action.trg_date_type=='create':
- base = mx.DateTime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S')
+ base = datetime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S')
elif hasattr(obj, 'create_date') and action.trg_date_type=='action_last':
if hasattr(obj, 'date_action_last') and obj.date_action_last:
- base = mx.DateTime.strptime(obj.date_action_last, '%Y-%m-%d %H:%M:%S')
+ base = datetime.strptime(obj.date_action_last, '%Y-%m-%d %H:%M:%S')
else:
- base = mx.DateTime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S')
+ base = datetime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S')
elif hasattr(obj, 'date_deadline') and action.trg_date_type=='deadline' \
and obj.date_deadline:
- base = mx.DateTime.strptime(obj.date_deadline, '%Y-%m-%d %H:%M:%S')
+ base = datetime.strptime(obj.date_deadline, '%Y-%m-%d %H:%M:%S')
elif hasattr(obj, 'date') and action.trg_date_type=='date' and obj.date:
- base = mx.DateTime.strptime(obj.date, '%Y-%m-%d %H:%M:%S')
+ base = datetime.strptime(obj.date, '%Y-%m-%d %H:%M:%S')
if base:
fnct = {
- 'minutes': lambda interval: mx.DateTime.RelativeDateTime(minutes=interval),
- 'day': lambda interval: mx.DateTime.RelativeDateTime(days=interval),
- 'hour': lambda interval: mx.DateTime.RelativeDateTime(hours=interval),
- 'month': lambda interval: mx.DateTime.RelativeDateTime(months=interval),
+ 'minutes': lambda interval: timedelta(minutes=interval),
+ 'day': lambda interval: timedelta(days=interval),
+ 'hour': lambda interval: timedelta(hours=interval),
+ 'month': lambda interval: timedelta(months=interval),
}
d = base + fnct[action.trg_date_range_type](action.trg_date_range)
dt = d.strftime('%Y-%m-%d %H:%M:%S')
diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml
index c9164962439..36140e62649 100644
--- a/addons/base_action_rule/base_action_rule_view.xml
+++ b/addons/base_action_rule/base_action_rule_view.xml
@@ -24,7 +24,7 @@
-
+
diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml
index 7e2368658df..bb0412a2247 100644
--- a/addons/base_calendar/base_calendar_view.xml
+++ b/addons/base_calendar/base_calendar_view.xml
@@ -103,7 +103,7 @@
separator="1" help="Declined Invitations" />
-
+
diff --git a/addons/crm/board_crm_statistical_view.xml b/addons/crm/board_crm_statistical_view.xml
index 1baf673990d..b23fdeac1cd 100644
--- a/addons/crm/board_crm_statistical_view.xml
+++ b/addons/crm/board_crm_statistical_view.xml
@@ -4,53 +4,69 @@
-
- Leads By Stage - Graph
- crm.lead.report
- graph
-
-
-
-
-
-
-
-
- report.crm.opportunity.categ.graph
+
+ Opportunities By Categories - Graph
crm.lead.report
graph
-
+
-
+
+ Opportunities By Stage - Graph
+ crm.lead.report
+ graph
+
+
+
+
+
+
+
+
+
+ Opportunities By Stage Per User - Graph
+ crm.lead.report
+ graph
+
+
+
+
+
+
+
+
-
+
+ Opportunities By Categories
crm.lead.report
form
graph,tree,form
-
+
[('state','!=','done'),('state','!=','cancel')]
-
+
+ crm.lead.report
+ form
+ graph,tree,form
+
+ [('state','!=','done'),('state','!=','cancel')]
+
+
+
+ Number of Opportunities by stage
+ crm.lead.report
+ form
+ graph,tree,form
+
+ [('state','!=','cancel')]
+
CRM - Statistical Dashboard Form
@@ -68,8 +84,8 @@
width="250"/>
@@ -77,8 +93,8 @@
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index 5cee0052297..575c2a8a3e3 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -268,12 +268,13 @@ class crm_case(object):
"""
cases = self.browse(cr, uid, ids)
for case in cases:
- data = {'active': True, 'user_id': False}
+ data = {'active': True}
if case.section_id.parent_id:
data['section_id'] = case.section_id.parent_id.id
- if case.section_id.parent_id.user_id:
- data['user_id'] = case.section_id.parent_id.user_id.id
+ if case.section_id.parent_id.change_responsible:
+ if case.section_id.parent_id.user_id:
+ data['user_id'] = case.section_id.parent_id.user_id.id
else:
raise osv.except_osv(_('Error !'), _('You can not escalate, You are already at the top level regarding your sales-team category.'))
self.write(cr, uid, [case.id], data)
@@ -439,6 +440,7 @@ class crm_case_section(osv.osv):
'active': fields.boolean('Active', help="If the active field is set to \
true, it will allow you to hide the sales team without removing it."),
'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"),
+ 'change_responsible': fields.boolean('Change Responsible', help="Set responsible of this Sales team on escalation to this team"),
'user_id': fields.many2one('res.users', 'Responsible User'),
'member_ids':fields.many2many('res.users', 'sale_member_rel', 'section_id', 'member_id', 'Team Members'),
'reply_to': fields.char('Reply-To', size=64, help="The email address put \
diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py
index 1f11f2c4c0c..1ca37a426a2 100644
--- a/addons/crm/crm_action_rule.py
+++ b/addons/crm/crm_action_rule.py
@@ -24,7 +24,6 @@ import re
import os
import base64
import tools
-import mx.DateTime
from tools.translate import _
from osv import fields
@@ -80,6 +79,26 @@ 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)
+ #Cheking for history
+ regex = action.regex_history
+ result_history = True
+ if regex:
+ res = False
+ ptrn = re.compile(str(regex))
+ for history in obj.message_ids:
+ _result = ptrn.search(str(history.name))
+ if _result:
+ res = True
+ break
+ result_history = res
+ ok = ok and (not regex or result_history)
+
+ res_count = True
+ if action.trg_max_history:
+ res_count = False
+ if len(obj.message_ids) >= action.trg_max_history:
+ res_count = True
+ ok = ok and res_count
return ok
def do_action(self, cr, uid, action, model_obj, obj, context={}):
diff --git a/addons/crm/crm_meeting_menu.xml b/addons/crm/crm_meeting_menu.xml
index bf1a8459655..027ebed0a7a 100644
--- a/addons/crm/crm_meeting_menu.xml
+++ b/addons/crm/crm_meeting_menu.xml
@@ -105,7 +105,7 @@
tree,form
[('ref','like','crm.meeting,')]
- {'default_sent_by_uid': uid}
+ {"search_default_user_id":uid}
diff --git a/addons/document/security/ir.model.access.csv b/addons/document/security/ir.model.access.csv
index 245bcbffeab..9684932b2a6 100644
--- a/addons/document/security/ir.model.access.csv
+++ b/addons/document/security/ir.model.access.csv
@@ -9,6 +9,7 @@
"access_document_directory_content_type_group_system","document.directory.content.type group system","model_document_directory_content_type","base.group_user",1,0,0,0
"access_document_storage_group_document_manager","document.storage document manager","model_document_storage","group_document_manager",1,1,1,1
"access_document_storage_group_system","document.storage group system","model_document_storage","base.group_user",1,0,0,0
+"access_document_directory_dctx_all","document.directory.dctx all","model_document_directory_dctx",,1,0,0,0
"access_document_directory_dctx_group_document_manager","document.directory.dctx document manager","model_document_directory_dctx","group_document_manager",1,1,1,1
"access_document_directory_dctx_group_system","document.directory.dctx group system","model_document_directory_dctx","base.group_system",1,1,1,1
"access_report_document_user_group_document_manager","report.document.user document manager","model_report_document_user","document.group_document_manager",1,0,0,0
diff --git a/addons/event/__init__.py b/addons/event/__init__.py
index 275c10657ff..ce8b64ed9a9 100644
--- a/addons/event/__init__.py
+++ b/addons/event/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,12 +15,13 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
import event
import wizard
import report
+import res_partner
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py
index 7cd7d4ae2c6..634484deecb 100644
--- a/addons/event/__openerp__.py
+++ b/addons/event/__openerp__.py
@@ -53,6 +53,7 @@
'wizard/event_make_invoice_view.xml',
'wizard/partner_event_registration_view.xml',
'board_association_view.xml',
+ 'res_partner_view.xml',
],
'demo_xml': ['event_demo.xml', 'board_association_demo.xml'],
'test': ['test/test_event.yml'],
diff --git a/addons/event/event.py b/addons/event/event.py
index b74f874e6b5..73ff7f6755a 100644
--- a/addons/event/event.py
+++ b/addons/event/event.py
@@ -176,11 +176,13 @@ class event_event(osv.osv):
'note': fields.text('Notes', help="Description or Summary of Event"),
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
"unit_price": fields.float('Cost'),
- 'partner_id': fields.many2one('res.partner','Teacher'),
+ 'main_speaker_id': fields.many2one('res.partner','Main Speaker'),
+ 'speaker_ids':fields.many2many('res.partner', 'event_speaker_rel', 'speaker_id', 'partner_id', 'Other Speakers'),
'address_id': fields.many2one('res.partner.address','Location Room'),
- 'teacher_confirmed': fields.boolean('Teacher Confirmed'),
+ 'speaker_confirmed': fields.boolean('Speaker Confirmed'),
'country_id': fields.related('address_id', 'country_id',
type='many2one', relation='res.country', string='Country'),
+ 'language': fields.char('Language',size=64),
}
diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml
index 20047d00f73..97b122d5c6a 100644
--- a/addons/event/event_view.xml
+++ b/addons/event/event_view.xml
@@ -57,18 +57,20 @@
-
-
+
+
-
+
+
+
-
+
@@ -120,9 +122,11 @@
-
+
+
+
diff --git a/addons/event/report/report_event_registration.py b/addons/event/report/report_event_registration.py
index d9232136c3a..9af9347a76d 100644
--- a/addons/event/report/report_event_registration.py
+++ b/addons/event/report/report_event_registration.py
@@ -43,6 +43,7 @@ class report_event_registration(osv.osv):
'type': fields.many2one('event.type', 'Event Type'),
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, required=True),
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
+ 'speaker_id':fields.many2one('res.partner', 'Speaker', readonly=True),
}
_order = 'date desc'
def init(self, cr):
@@ -57,6 +58,7 @@ class report_event_registration(osv.osv):
c.event_id as event_id,
e.date_begin as date,
e.user_id as user_id,
+ e.main_speaker_id as speaker_id,
to_char(e.date_begin, 'YYYY') as year,
to_char(e.date_begin, 'MM') as month,
to_char(e.date_begin, 'YYYY-MM-DD') as day,
@@ -75,7 +77,7 @@ class report_event_registration(osv.osv):
group by
to_char(e.date_begin, 'YYYY'),
to_char(e.date_begin, 'MM'),
- t.id, e.id, e.date_begin,
+ t.id, e.id, e.date_begin,e.main_speaker_id,
e.register_max, e.type, e.state, c.event_id, e.user_id,
to_char(e.date_begin, 'YYYY-MM-DD')
)""")
diff --git a/addons/event/report/report_event_registration_view.xml b/addons/event/report/report_event_registration_view.xml
index 2931bc28aa8..9e00040fa97 100644
--- a/addons/event/report/report_event_registration_view.xml
+++ b/addons/event/report/report_event_registration_view.xml
@@ -10,6 +10,7 @@
+
@@ -85,7 +86,8 @@
-
+
+
diff --git a/addons/event/res_partner.py b/addons/event/res_partner.py
new file mode 100644
index 00000000000..23075ba1927
--- /dev/null
+++ b/addons/event/res_partner.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import fields,osv
+
+class res_partner(osv.osv):
+ _inherit = 'res.partner'
+
+ _columns = {
+ 'speaker': fields.boolean('Speaker'),
+ 'event_ids': fields.one2many('event.event','main_speaker_id',readonly=True),
+ 'event_registration_ids': fields.one2many('event.registration','partner_id',readonly=True),
+ }
+
+res_partner()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/event/res_partner_view.xml b/addons/event/res_partner_view.xml
new file mode 100644
index 00000000000..0b6ace47b19
--- /dev/null
+++ b/addons/event/res_partner_view.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+ res.partner.speaker.info.inherit
+ res.partner
+ form
+
+
+
+
+
+
+
+
+ res.partner.event.info.inherit
+ res.partner
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py
index 2c778241daf..7187de5d1a5 100644
--- a/addons/mail_gateway/mail_gateway.py
+++ b/addons/mail_gateway/mail_gateway.py
@@ -158,9 +158,9 @@ class mailgate_message(osv.osv):
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
'message': fields.text('Description'),
'email_from': fields.char('From', size=128, help="Email From"),
- 'email_to': fields.text('To', help="Email Recipients"),
- 'email_cc': fields.text('Cc', help="Carbon Copy Email Recipients"),
- 'email_bcc': fields.text('Bcc', help='Blind Carbon Copy Email Recipients'),
+ 'email_to': fields.char('To', help="Email Recipients", size=256),
+ 'email_cc': fields.char('Cc', help="Carbon Copy Email Recipients", size=256),
+ 'email_bcc': fields.char('Bcc', help='Blind Carbon Copy Email Recipients', size=256),
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email.", select=True),
'references': fields.text('References', readonly=True, help="References emails."),
'description': fields.text('Description'),
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index a67ca004f09..802ef47124d 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -160,7 +160,7 @@ class project_issue(osv.osv, crm.crm_case):
\nWhen the case is over, the state is set to \'Done\'.\
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
- 'email_cc': fields.text('Watchers Emails', size=252, help="These people\
+ 'email_cc': fields.char('Watchers Emails', size=256, help="These people\
will receive a copy of the future" \
" communication between partner and users by email"),
'date_open': fields.datetime('Opened', readonly=True),
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index 0bdee911cee..cbf24b18f76 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -154,9 +154,9 @@
-
+
-
+
-
+
-
+
-
-
+
+
@@ -142,10 +142,11 @@
- Purchase Orders
+ Purchase Analysis
purchase.report
form
tree,graph
+
{'search_default_month':1,'search_default_group_partner_id':1,'search_default_group_product_id': 1, 'search_default_orders': 1, 'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py
index db05650354b..532c9918b60 100644
--- a/addons/purchase_requisition/purchase_requisition.py
+++ b/addons/purchase_requisition/purchase_requisition.py
@@ -129,10 +129,14 @@ class purchase_order(osv.osv):
}
def wkf_confirm_order(self, cr, uid, ids, context={}):
res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context)
+ proc_obj=self.pool.get('procurement.order')
for po in self.browse(cr, uid, ids, context):
if po.requisition_id and (po.requisition_id.exclusive=='exclusive'):
for order in po.requisition_id.purchase_ids:
if order.id<>po.id:
+ proc_ids = proc_obj.search(cr, uid, [('purchase_id', '=', order.id)])
+ if proc_ids and po.state=='confirmed':
+ proc_obj.wirte(cr,uid,proc_ids,{'purchase_id':po.id})
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'purchase.order', order.id, 'purchase_cancel', cr)
self.pool.get('purchase.requisition').write(cr, uid, [po.requisition_id.id], {'state':'done','date_end':time.strftime('%Y-%m-%d %H:%M:%S')})
@@ -155,14 +159,17 @@ product_product()
class procurement_order(osv.osv):
_inherit = 'procurement.order'
-
+ _columns = {
+ 'requisition_id' : fields.many2one('purchase.requisition','Latest Requisition')
+ }
def make_po(self, cr, uid, ids, context=None):
sequence_obj = self.pool.get('ir.sequence')
res = super(procurement_order, self).make_po(cr, uid, ids, context=context)
for proc_id, po_id in res.items():
procurement = self.browse(cr, uid, proc_id)
+ requisition_id=False
if procurement.product_id.purchase_requisition:
- self.pool.get('purchase.requisition').create(cr, uid, {
+ requisition_id=self.pool.get('purchase.requisition').create(cr, uid, {
'name': sequence_obj.get(cr, uid, 'purchase.order.requisition'),
'origin': procurement.name,
'date_end': procurement.date_planned,
@@ -174,6 +181,7 @@ class procurement_order(osv.osv):
})],
'purchase_ids': [(6,0,[po_id])]
})
+ self.write(cr,uid,proc_id,{'requisition_id':requisition_id})
return res
procurement_order()
diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml
index 76aa70aaf42..b8e488ac0cf 100644
--- a/addons/purchase_requisition/purchase_requisition_view.xml
+++ b/addons/purchase_requisition/purchase_requisition_view.xml
@@ -168,6 +168,17 @@
-
+
+
+ procurement.form.inherit
+ form
+ procurement.order
+
+
+
+
+
+
+
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index 8c24b5000ee..0880cdb76d1 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -74,7 +74,7 @@ class sale_report(osv.osv):
tools.drop_view_if_exists(cr, 'sale_report')
cr.execute("""
create or replace view sale_report as (
- select el.*,
+ select el.*,
-- (select count(1) from sale_order_line where order_id = s.id) as nbr,
(select 1) as nbr,
s.date_order as date,
@@ -86,28 +86,46 @@ class sale_report(osv.osv):
s.user_id as user_id,
s.shop_id as shop_id,
s.company_id as company_id,
- extract(epoch from (s.date_confirm-s.create_date))/(24*60*60)::decimal(16,2) as delay,
+ extract(epoch from avg(date_trunc('day',s.date_confirm)-date_trunc('day',s.create_date)))/(24*60*60)::decimal(16,2) as delay,
s.state,
s.shipped,
s.shipped::integer as shipped_qty_1,
s.pricelist_id as pricelist_id,
s.project_id as analytic_account_id
- from
- sale_order s,
- (
- select l.id as id,
- l.product_id as product_id,
- u.name as uom_name,
- sum(l.product_uom_qty * u.factor) as product_uom_qty,
- sum(l.product_uom_qty*l.price_unit) as price_total,
- (sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty * u.factor)*count(l.product_id))::decimal(16,2) as price_average,
- pt.categ_id, l.order_id
- from
- sale_order_line l
- left join product_uom u on (u.id=l.product_uom)
- left join product_template pt on (pt.id=l.product_id)
- group by l.id, l.order_id, l.product_id, u.name, pt.categ_id) el
- where s.id = el.order_id
+ from
+ sale_order s,
+ (
+ select l.id as id,
+ l.product_id as product_id,
+ u.name as uom_name,
+ sum(l.product_uom_qty * u.factor) as product_uom_qty,
+ sum(l.product_uom_qty*l.price_unit) as price_total,
+ (sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty * u.factor)*count(l.product_id))::decimal(16,2) as price_average,
+ pt.categ_id, l.order_id
+ from
+ sale_order_line l
+ left join product_uom u on (u.id=l.product_uom)
+ left join product_template pt on (pt.id=l.product_id)
+ group by l.id, l.order_id, l.product_id, u.name, pt.categ_id) el
+ where s.id = el.order_id
+ group by el.id,
+ el.product_id,
+ el.uom_name,
+ el.product_uom_qty,
+ el.price_total,
+ el.price_average,
+ el.categ_id,
+ el.order_id,
+ s.date_order,
+ s.date_confirm,
+ s.partner_id,
+ s.user_id,
+ s.shop_id,
+ s.company_id,
+ s.state,
+ s.shipped,
+ s.pricelist_id,
+ s.project_id
)
""")
sale_report()
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index 6ab414aad8b..a4658bc3a1c 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -20,11 +20,11 @@
-
-
-
+
+
+
-
+
@@ -122,6 +122,7 @@
form
tree,graph
+
{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}