diff --git a/addons/account/report/account_report.py b/addons/account/report/account_report.py
index b7d3441913f..1136300f065 100644
--- a/addons/account/report/account_report.py
+++ b/addons/account/report/account_report.py
@@ -132,7 +132,7 @@ class report_aged_receivable(osv.osv):
while (last_month_date > fy_start_date):
LIST_RANGES.append(today + " to " + last_month_date.strftime('%Y-%m-%d'))
- today = (last_month_date- 1).strftime('%Y-%m-%d')
+ today = (last_month_date- relativedelta(days=1)).strftime('%Y-%m-%d')
last_month_date = datetime.strptime(today, '%Y-%m-%d') - relativedelta(months=1)
LIST_RANGES.append(today +" to " + fy_start_date.strftime('%Y-%m-%d'))
diff --git a/addons/account_voucher/test/sales_receipt.yml b/addons/account_voucher/test/sales_receipt.yml
index af10d614730..628d1795bc8 100644
--- a/addons/account_voucher/test/sales_receipt.yml
+++ b/addons/account_voucher/test/sales_receipt.yml
@@ -42,11 +42,7 @@
if l.reconcile_id:
reconciled = True
break
- if not reconciled:
- print "Info: Voucher is not paid"
- else:
- print "Info: Voucher is paid"
-
+ assert (not reconciled), "Found reconciled move lines, should not be"
-
I create and post a voucher payment of amount 30000.0 for the partner Seagate
-
@@ -74,8 +70,6 @@
assert (voucher_id.state=='draft'), "Voucher is not in draft state"
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'account.voucher', voucher_id.id, 'proforma_voucher', cr)
-
-
-
I check that move lines are reconciled meaning voucher is paid
-
@@ -85,7 +79,4 @@
if l.reconcile_id:
reconciled = True
break
- if not reconciled:
- print "Info: Voucher is not paid"
- else:
- print "Info: Voucher is paid"
\ No newline at end of file
+ assert reconciled, "Found unreconciled move lines/unpaid voucher"
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index a13fbf9a582..3e2daa586c1 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -113,6 +113,8 @@ the rule to mark CC(mail to any other person defined in actions)."),
'filter_id':fields.many2one('ir.filters', 'Filter', required=False),
'act_email_from' : fields.char('Email From', size=64, required=False,
help="Use a python expression to specify the right field on which one than we will use for the 'From' field of the header"),
+ 'act_email_to' : fields.char('Email To', size=64, required=False,
+ help="Use a python expression to specify the right field on which one than we will use for the 'To' field of the header"),
}
_defaults = {
@@ -356,13 +358,20 @@ the rule to mark CC(mail to any other person defined in actions)."),
emails += (action.act_email_cc or '').split(',')
if action.act_mail_to_email:
emails += (action.act_mail_to_email or '').split(',')
+
+ locals_for_emails = {
+ 'user' : self.pool.get('res.users').browse(cr, uid, uid, context=context),
+ 'obj' : obj,
+ }
+
+ if action.act_email_to:
+ emails.append(safe_eval(action.act_email_to, {}, locals_for_emails))
+
emails = filter(None, emails)
if len(emails) and action.act_mail_body:
emails = list(set(emails))
- email_from = safe_eval(action.act_email_from, {}, {
- 'user' : self.pool.get('res.users').browse(cr, uid, uid, context=context),
- 'obj' : obj,
- })
+ email_from = safe_eval(action.act_email_from, {}, locals_for_emails)
+
def to_email(text):
return re.findall(r'([^ ,<@]+@[^> ,]+)', text or '')
emails = to_email(','.join(filter(None, emails)))
diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml
index 755f6680d34..01951b3c9b8 100644
--- a/addons/base_action_rule/base_action_rule_view.xml
+++ b/addons/base_action_rule/base_action_rule_view.xml
@@ -65,12 +65,13 @@
-
+
-
-
-
-
+
+
+
+
+
diff --git a/addons/base_calendar/wizard/base_calendar_invite_attendee.py b/addons/base_calendar/wizard/base_calendar_invite_attendee.py
index 98369962ab7..c92a40e72b2 100644
--- a/addons/base_calendar/wizard/base_calendar_invite_attendee.py
+++ b/addons/base_calendar/wizard/base_calendar_invite_attendee.py
@@ -36,11 +36,11 @@ class base_calendar_invite_attendee(osv.osv_memory):
_columns = {
'type': fields.selection([('internal', 'Internal User'), \
('external', 'External Email'), \
- ('partner', 'Partner Contacts')], 'Type', required=True),
+ ('partner', 'Partner Contacts')], 'Type', required=True, help="Select whom you want to Invite"),
'user_ids': fields.many2many('res.users', 'invite_user_rel',
'invite_id', 'user_id', 'Users'),
'partner_id': fields.many2one('res.partner', 'Partner'),
- 'email': fields.char('Email', size=124),
+ 'email': fields.char('Email', size=124, help="Provide external email address who will receive this invitation."),
'contact_ids': fields.many2many('res.partner.address', 'invite_contact_rel',
'invite_id', 'contact_id', 'Contacts'),
'send_mail': fields.boolean('Send mail?', help='Check this if you want to \
diff --git a/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml b/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml
index 494787bbf97..ef7193e05fe 100644
--- a/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml
+++ b/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml
@@ -10,42 +10,31 @@
form
diff --git a/addons/base_report_creator/base_report_creator_view.xml b/addons/base_report_creator/base_report_creator_view.xml
index 8752a573725..ad438c710b4 100644
--- a/addons/base_report_creator/base_report_creator_view.xml
+++ b/addons/base_report_creator/base_report_creator_view.xml
@@ -143,34 +143,9 @@
-
-
-
- base_report_creator.report.simple.tree
- base_report_creator.report
- tree
-
-
-
-
-
-
-
-
- base_report_creator.report
- tree
-
-
-
+
diff --git a/addons/base_report_designer/base_report_designer_installer.xml b/addons/base_report_designer/base_report_designer_installer.xml
index 21537d3d63c..4ea4970d19a 100644
--- a/addons/base_report_designer/base_report_designer_installer.xml
+++ b/addons/base_report_designer/base_report_designer_installer.xml
@@ -72,21 +72,10 @@
{'menu':True}
-
-
-
-
-
-
-
-
diff --git a/addons/base_synchro/__openerp__.py b/addons/base_synchro/__openerp__.py
index 69fcb839715..bd285821e2b 100644
--- a/addons/base_synchro/__openerp__.py
+++ b/addons/base_synchro/__openerp__.py
@@ -24,9 +24,12 @@
"version":"0.1",
"author":"Tiny",
"category":"Generic Modules/Base",
+ "description": """Synchronization with all objects.""",
"depends":["base"],
"demo_xml":[],
- "update_xml":["base_synchro_wizard.xml","base_synchro_view.xml"],
+ "update_xml":[ "wizard/base_synchro_view.xml",
+ "base_synchro_view.xml",
+ "security/ir.model.access.csv",],
"active":False,
"installable":True,
}
diff --git a/addons/base_synchro/base_synchro_obj.py b/addons/base_synchro/base_synchro_obj.py
index 5093c8f787e..64fad4cd687 100755
--- a/addons/base_synchro/base_synchro_obj.py
+++ b/addons/base_synchro/base_synchro_obj.py
@@ -42,7 +42,7 @@ class base_synchro_server(osv.osv):
base_synchro_server()
class base_synchro_obj(osv.osv):
- '''Class to store the operations done by wizart'''
+ '''Class to store the operations done by wizard'''
_name = "base.synchro.obj"
_description = "Register Class"
_columns = {
@@ -66,6 +66,10 @@ class base_synchro_obj(osv.osv):
#
# Return a list of changes: [ (date, id) ]
#
+
+ def get_ids(self, cr, uid, object, dt, domain=[], context={}):
+ return self._get_ids(cr, uid, object, dt, domain, context)
+
def _get_ids(self, cr, uid, object, dt, domain=[], context={}):
result = []
if dt:
diff --git a/addons/base_synchro/base_synchro_view.xml b/addons/base_synchro/base_synchro_view.xml
index 97995106070..e35a43837fa 100755
--- a/addons/base_synchro/base_synchro_view.xml
+++ b/addons/base_synchro/base_synchro_view.xml
@@ -30,6 +30,37 @@
+
+ base.synchro.obj.line.form
+ base.synchro.obj.line
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Filters
+ ir.actions.act_window
+ base.synchro.obj.line
+ form
+
+
+
+
Synchronized instances
@@ -56,7 +87,7 @@
-
+
@@ -81,6 +112,37 @@
+
+ base.synchro.obj.line.form
+ base.synchro.obj
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Filters
+ ir.actions.act_window
+ base.synchro.obj
+ form
+
+
+
+
Synchronized objects
ir.actions.act_window
@@ -115,15 +177,15 @@
form
diff --git a/addons/base_synchro/base_synchro_wizard.xml b/addons/base_synchro/base_synchro_wizard.xml
deleted file mode 100644
index b26b3bbae2b..00000000000
--- a/addons/base_synchro/base_synchro_wizard.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/addons/base_synchro/security/ir.model.access.csv b/addons/base_synchro/security/ir.model.access.csv
new file mode 100644
index 00000000000..fa0f00e8ccd
--- /dev/null
+++ b/addons/base_synchro/security/ir.model.access.csv
@@ -0,0 +1,5 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"base_synchro_server","base.synchro.server","model_base_synchro_server","base.group_system",1,1,1,1
+" base_synchro_obj"," base.synchro.obj","model_base_synchro_obj","base.group_system",1,1,1,1
+"base_synchro_obj_avoid","base.synchro.obj.avoid","model_base_synchro_obj_avoid","base.group_system",1,1,1,1
+"base_synchro_obj_line","base.synchro.obj.line","model_base_synchro_obj_line","base.group_system",1,1,1,1
diff --git a/addons/base_synchro/wizard/__init__.py b/addons/base_synchro/wizard/__init__.py
index 7ff450acd76..3deff83f9e3 100644
--- a/addons/base_synchro/wizard/__init__.py
+++ b/addons/base_synchro/wizard/__init__.py
@@ -19,4 +19,5 @@
#
##############################################################################
import base_synchro
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_synchro/wizard/base_synchro.py b/addons/base_synchro/wizard/base_synchro.py
index 3a394d4ba3b..c83ec7df0e9 100644
--- a/addons/base_synchro/wizard/base_synchro.py
+++ b/addons/base_synchro/wizard/base_synchro.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+## -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
@@ -18,7 +18,6 @@
# along with this program. If not, see .
#
##############################################################################
-import wizard
import osv
from datetime import date
import time
@@ -27,26 +26,7 @@ import xmlrpclib
import re
import tools
import threading
-
-acc_synchro_form = '''
-
'''
-
-acc_synchro_fields = {
- 'server_url': {'string':'Server URL', 'type':'many2one', 'relation':'base.synchro.server','required':True},
- 'user_id': {'string':'Send Result To', 'type':'many2one', 'relation':'res.users', 'default': lambda uid,data,state: uid},
-}
-
-finish_form ='''
-
-'''
+from osv import osv, fields
class RPCProxyOne(object):
def __init__(self, server, ressource):
@@ -66,13 +46,26 @@ class RPCProxy(object):
def get(self, ressource):
return RPCProxyOne(self.server, ressource)
-class wizard_cost_account_synchro(wizard.interface):
+class base_synchro(osv.osv_memory):
+ """Base Synchronization """
+ _name = 'base.synchro'
+
+ _columns = {
+ 'server_url': fields.many2one('base.synchro.server', "Server URL", required=True),
+ 'user_id': fields.many2one('res.users', "Send Result To",),
+ }
+
+ _defaults = {
+ 'user_id': lambda self,cr,uid,context: uid,
+ }
+
start_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
report = []
report_total = 0
report_create = 0
report_write = 0
- def _synchronize(self, cr, uid, server, object, context):
+
+ def synchronize(self, cr, uid, server, object, context):
pool = pooler.get_pool(cr.dbname)
self.meta = {}
ids = []
@@ -80,14 +73,14 @@ class wizard_cost_account_synchro(wizard.interface):
pool2 = pool
#try:
if object.action in ('d','b'):
- ids = pool1.get('base.synchro.obj')._get_ids(cr, uid,
+ ids = pool1.get('base.synchro.obj').get_ids(cr, uid,
object.model_id.model,
object.synchronize_date,
eval(object.domain),
{'action':'d'}
)
if object.action in ('u','b'):
- ids += pool2.get('base.synchro.obj')._get_ids(cr, uid,
+ ids += pool2.get('base.synchro.obj').get_ids(cr, uid,
object.model_id.model,
object.synchronize_date,
eval(object.domain),
@@ -109,7 +102,7 @@ class wizard_cost_account_synchro(wizard.interface):
if object.model_id.model=='crm.case.history':
fields = ['email','description','log_id']
value = pool_src.get(object.model_id.model).read(cr, uid, [id], fields)[0]
- value = self._data_transform(cr, uid, pool_src, pool_dest, object.model_id.model, value, action)
+ value = self.data_transform(cr, uid, pool_src, pool_dest, object.model_id.model, value, action)
id2 = self.get_id(cr, uid, object.id, id, action, context)
#
# Transform value
@@ -133,7 +126,7 @@ class wizard_cost_account_synchro(wizard.interface):
else:
print value
idnew = pool_dest.get(object.model_id.model).create(cr, uid, value)
- synid = pool.get('base.synchro.obj.line').create(cr, uid, {
+ synid = self.pool.get('base.synchro.obj.line').create(cr, uid, {
'obj_id': object.id,
'local_id': (action=='u') and id or idnew,
'remote_id': (action=='d') and id or idnew
@@ -141,25 +134,20 @@ class wizard_cost_account_synchro(wizard.interface):
self.report_total+=1
self.report_create+=1
self.meta = {}
- return 'finish'
+ return True
- #
- # IN: object and ID
- # OUT: ID of the remote object computed:
- # If object is synchronised, read the sync database
- # Otherwise, use the name_search method
- #
def get_id(self, cr, uid, object_id, id, action, context={}):
pool = pooler.get_pool(cr.dbname)
+ line_pool = pool.get('base.synchro.obj.line')
field_src = (action=='u') and 'local_id' or 'remote_id'
field_dest = (action=='d') and 'local_id' or 'remote_id'
- rid = pool.get('base.synchro.obj.line').search(cr, uid, [('obj_id','=',object_id), (field_src,'=',id)], context=context)
+ rid = line_pool.search(cr, uid, [('obj_id','=',object_id), (field_src,'=',id)], context=context)
result = False
if rid:
- result = pool.get('base.synchro.obj.line').read(cr, uid, rid, [field_dest], context=context)[0][field_dest]
+ result = line_pool.read(cr, uid, rid, [field_dest], context=context)[0][field_dest]
return result
- def _relation_transform(self, cr, uid, pool_src, pool_dest, object, id, action, context={}):
+ def relation_transform(self, cr, uid, pool_src, pool_dest, object, id, action, context={}):
if not id:
return False
pool = pooler.get_pool(cr.dbname)
@@ -186,7 +174,14 @@ class wizard_cost_account_synchro(wizard.interface):
print self.report.append('WARNING: Record "%s" on relation %s not found, set to null.' % (names,object))
return result
- def _data_transform(self, cr, uid, pool_src, pool_dest, object, data, action='u', context={}):
+ #
+ # IN: object and ID
+ # OUT: ID of the remote object computed:
+ # If object is synchronised, read the sync database
+ # Otherwise, use the name_search method
+ #
+
+ def data_transform(self, cr, uid, pool_src, pool_dest, object, data, action='u', context={}):
self.meta.setdefault(pool_src, {})
if not object in self.meta[pool_src]:
self.meta[pool_src][object] = pool_src.get(object).fields_get(cr, uid, context)
@@ -201,12 +196,12 @@ class wizard_cost_account_synchro(wizard.interface):
del data[f]
elif ftype == 'many2one':
if data[f]:
- df = self._relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], data[f][0], action, context)
+ df = self.relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], data[f][0], action, context)
data[f] = df
if not data[f]:
del data[f]
elif ftype == 'many2many':
- res = map(lambda x: self._relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], x, action, context), data[f])
+ res = map(lambda x: self.relation_transform(cr, uid, pool_src, pool_dest, fields[f]['relation'], x, action, context), data[f])
data[f] = [(6, 0, res)]
del data['id']
return data
@@ -215,21 +210,22 @@ class wizard_cost_account_synchro(wizard.interface):
# Find all objects that are created or modified after the synchronize_date
# Synchronize these obejcts
#
- def _upload_download(self, db_name, uid, data, context):
- cr = pooler.get_db(db_name).cursor()
+
+
+ def upload_download(self, cr, uid, ids, context):
start_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
+ syn_obj = self.browse(cr, uid, ids)[0]
pool = pooler.get_pool(cr.dbname)
- server = pool.get('base.synchro.server').browse(cr, uid, data['form']['server_url'], context)
+ server = pool.get('base.synchro.server').browse(cr, uid, ids, context)[0]
for object in server.obj_ids:
dt = time.strftime('%Y-%m-%d %H:%M:%S')
- self._synchronize(cr, uid, server, object, context)
+ self.synchronize(cr, uid, server, object, context)
if object.action=='b':
time.sleep(1)
dt = time.strftime('%Y-%m-%d %H:%M:%S')
- pool.get('base.synchro.obj').write(cr, uid, [object.id], {'synchronize_date': dt})
- cr.commit()
+ self.pool.get('base.synchro.obj').write(cr, uid, [object.id], {'synchronize_date': dt})
end_date = time.strftime('%Y-%m-%d, %Hh %Mm %Ss')
- if 'user_id' in data['form'] and data['form']['user_id']:
+ if 'user_id' in syn_obj.user_id:
request = pooler.get_pool(cr.dbname).get('res.request')
if not self.report:
self.report.append('No exception.')
@@ -248,32 +244,26 @@ Exceptions:
request.create(cr, uid, {
'name' : "Synchronization report",
'act_from' : uid,
- 'act_to' : data['form']['user_id'],
+ 'act_to' : syn_obj.user_id,
'body': summary,
})
- cr.commit()
- cr.close()
- return 'finish'
+ return True
- def _upload_download_multi_thread(self, cr, uid, data, context):
- threaded_synchronization = threading.Thread(target=self._upload_download, args=(cr.dbname, uid, data, context))
- threaded_synchronization.start()
- return 'finish'
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':acc_synchro_form, 'fields':acc_synchro_fields, 'state':[('end','Cancel'),('upload_download','Synchronize')]}
- },
- 'upload_download': {
- 'actions': [],
- 'result':{'type':'choice', 'next_state': _upload_download_multi_thread}
- },
- 'finish': {
- 'actions': [],
- 'result':{'type':'form', 'arch':finish_form,'fields':{},'state':[('end','Ok')]}
- },
- }
-wizard_cost_account_synchro('account.analytic.account.transfer')
+ def upload_download_multi_thread(self, cr, uid, data, context):
+ threaded_synchronization = threading.Thread(target=self.upload_download, args=(cr, uid, data, context))
+ threaded_synchronization.run()
+ data_obj = self.pool.get('ir.model.data')
+ id2 = data_obj._get_id(cr, uid, 'base_synchro', 'view_base_synchro_finish')
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'base.synchro',
+ 'views': [(id2, 'form')],
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ }
+base_synchro()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/base_synchro/wizard/base_synchro_view.xml b/addons/base_synchro/wizard/base_synchro_view.xml
new file mode 100644
index 00000000000..291e2c4385e
--- /dev/null
+++ b/addons/base_synchro/wizard/base_synchro_view.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+ Base Synchronization
+ base.synchro
+ form
+
+
+
+
+
+
+ Base Synchronization
+ ir.actions.act_window
+ base.synchro
+ form
+ form
+ new
+
+
+
+
+ Base Synchronization
+ base.synchro
+ form
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/board/board_view.xml b/addons/board/board_view.xml
index 984a17caa51..d48ddd6a025 100644
--- a/addons/board/board_view.xml
+++ b/addons/board/board_view.xml
@@ -1,9 +1,6 @@
-
board.note.search
@@ -23,7 +20,7 @@
-
+
@@ -33,11 +30,11 @@
-
+
-
+
@@ -113,7 +110,7 @@
-
+
board.board.search
board.board
@@ -136,19 +133,13 @@
-
+ id="menu_view_board_form" parent="base.reporting_menu" sequence="1"/>
New
-
@@ -16,7 +15,6 @@
Qualification
-
@@ -24,7 +22,6 @@
Proposition
-
@@ -32,7 +29,6 @@
Negotiation
-
@@ -40,7 +36,6 @@
Win
-
@@ -48,10 +43,15 @@
Lost
-
+
+ Sales Department
+ Sales
+
+
+
Telesales
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 6ea8eea959f..c1e37445c6c 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -55,8 +55,7 @@
-
+
-
-
+
+ on_change="onchange_stage_id(stage_id)"
+ domain="[('object_id.model', '=', 'crm.lead')]"
+ readonly="1" />
diff --git a/addons/crm/crm_phonecall_data.xml b/addons/crm/crm_phonecall_data.xml
index 097540bada4..0e2bb6511c5 100644
--- a/addons/crm/crm_phonecall_data.xml
+++ b/addons/crm/crm_phonecall_data.xml
@@ -16,23 +16,5 @@
-
-
- Planned
-
-
-
-
- Held
-
-
-
-
- Not Held
-
-
-
diff --git a/addons/crm/crm_phonecall_demo.xml b/addons/crm/crm_phonecall_demo.xml
index 824c40454be..683cbd9735f 100644
--- a/addons/crm/crm_phonecall_demo.xml
+++ b/addons/crm/crm_phonecall_demo.xml
@@ -16,7 +16,6 @@
-
@@ -32,7 +31,6 @@
-
@@ -48,7 +46,6 @@
-
@@ -64,7 +61,6 @@
-
@@ -80,7 +76,6 @@
-
@@ -96,7 +91,6 @@
-
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
index 061888d02fb..bb15b3631b8 100644
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -48,6 +48,10 @@
+
+
+
+
@@ -97,8 +101,6 @@
-
-
@@ -113,7 +115,6 @@