diff --git a/addons/account/account.py b/addons/account/account.py
index 04a0bb5da68..61319f7f973 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1965,13 +1965,12 @@ class account_add_tmpl_wizard(osv.osv_memory):
if not tids or not tids[0]['parent_id']:
return False
ptids = tmpl_obj.read(cr, uid, [tids[0]['parent_id'][0]],['code'])
+ res = None
if not ptids or not ptids[0]['code']:
raise osv.except_osv(_('Error !'), _('Cannot locate parent code for template account!'))
res = acc_obj.search(cr,uid,[('code','=',ptids[0]['code'])])
- if res:
- return res[0]
- else:
- return False
+
+ return res and res[0] or False
_columns = {
'cparent_id':fields.many2one('account.account', 'Parent target', help="Creates an account with the selected template under this existing parent.", required=True),
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 31872e27ef4..dbfbeedf0a8 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -12,9 +12,11 @@
[('object_id.model', '=', 'crm.lead')]
{'object_id':'crm.lead'}
-
+
+
+
@@ -26,10 +28,11 @@
[('object_id.model', '=', 'crm.lead')]
{'object_id':'crm.lead'}
-
+
+
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index e84bbb673ee..e2decc30340 100644
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -13,8 +13,8 @@
{'object_id':'crm.meeting'}
-
+
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index 8b5cc42c502..407c3c53cf4 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -14,8 +14,8 @@
+ id="menu_crm_case_opportunity-act" name="Categories"
+ parent="menu_crm_config_opportunity" />
@@ -29,8 +29,8 @@
+ id="menu_crm_opportunity_stage_act" name="Stages"
+ parent="menu_crm_config_opportunity" />
@@ -44,8 +44,8 @@
+ id="menu_crm_opportunity_resource_act" name="Resource"
+ parent="menu_crm_config_opportunity" />
@@ -329,7 +329,7 @@
-
+
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index 65b77ed5abe..c5813a38b09 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -13,8 +13,8 @@
{'object_id':'crm.phonecall'}
-
+
@@ -27,10 +27,9 @@
{'object_id':'crm.phonecall'}
-
-
+
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
index 52450419fd2..f854981858c 100644
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -1,8 +1,20 @@
-
+
+
+
+
+
+
+
+
+
@@ -117,9 +129,7 @@
-
-
-
+
crm.case.categ.form
@@ -156,11 +166,11 @@
form
-
+ id="menu_crm_case_section_act" sequence="4"
+ parent="base.menu_crm_config_sales" />
+
@@ -201,8 +211,6 @@
form
-
Cases by section
@@ -342,10 +350,11 @@
form
tree,form
-
+ groups="base.group_extended" sequence="5"
+ parent="base.menu_crm_config_sales" />
view.users.form.crm.modif.inherited1
diff --git a/addons/crm/wizard/crm_forward_to_partner.py b/addons/crm/wizard/crm_forward_to_partner.py
index 156ab3311f4..945066506d7 100644
--- a/addons/crm/wizard/crm_forward_to_partner.py
+++ b/addons/crm/wizard/crm_forward_to_partner.py
@@ -107,8 +107,8 @@ class crm_lead_forward_to_partner(osv.osv_memory):
#TODO: ids and context are not comming
res = False
msg_val = ''
- res_id = False # Comes from context
- model = None # Comes from context
+ res_id = context.get('active_id')
+ model = context.get('active_model')
model_pool = self.pool.get(model)
if not res_id or not model:
return res
diff --git a/addons/crm/wizard/crm_forward_to_partner_view.xml b/addons/crm/wizard/crm_forward_to_partner_view.xml
index 1e8c6fc8583..b6295cfa3a9 100644
--- a/addons/crm/wizard/crm_forward_to_partner_view.xml
+++ b/addons/crm/wizard/crm_forward_to_partner_view.xml
@@ -9,7 +9,7 @@
@@ -56,11 +56,11 @@
hr_installer_action_replace
tree
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml
index 36524395355..75da20cef20 100644
--- a/addons/hr/hr_view.xml
+++ b/addons/hr/hr_view.xml
@@ -106,7 +106,7 @@
search
-
@@ -114,12 +114,12 @@
-
-
-
+
+
+
-
-
+
+
@@ -358,15 +358,15 @@
search
-
-
-
@@ -374,7 +374,7 @@
-
diff --git a/addons/hr_attendance/hr_attendance_view.xml b/addons/hr_attendance/hr_attendance_view.xml
index 8b9a68575b0..e3db974ebb5 100644
--- a/addons/hr_attendance/hr_attendance_view.xml
+++ b/addons/hr_attendance/hr_attendance_view.xml
@@ -48,16 +48,16 @@
search
-
-
+
+
-
-
-
+
+
+
diff --git a/addons/hr_contract/hr_contract_view.xml b/addons/hr_contract/hr_contract_view.xml
index e4e8259bda4..40cebb98ef2 100644
--- a/addons/hr_contract/hr_contract_view.xml
+++ b/addons/hr_contract/hr_contract_view.xml
@@ -133,21 +133,21 @@
-
+
hr.contract.view.search
hr.contract
search
-
-
-
-
+
+
+
+
-
-
+
+
@@ -217,7 +217,7 @@
-
+
hr.contract.type.view.form
hr.contract.type
form
@@ -228,7 +228,7 @@
-
+
hr.contract.type.view.tree
hr.contract.type
tree
@@ -250,7 +250,7 @@
-
+
diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml
index d02c76bc44c..a3e4cac2a5f 100644
--- a/addons/hr_evaluation/hr_evaluation_view.xml
+++ b/addons/hr_evaluation/hr_evaluation_view.xml
@@ -13,8 +13,8 @@
-
-
+
+
@@ -243,15 +243,15 @@
-
-
-
+
+
+
-
-
@@ -261,12 +261,12 @@
-
-
-
-
+
+
+
+
-
+
@@ -344,10 +344,10 @@
-
+
-
+
diff --git a/addons/hr_evaluation/report/hr_evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
index 6ccd1e80ab9..5406a7a3fbd 100644
--- a/addons/hr_evaluation/report/hr_evaluation_report_view.xml
+++ b/addons/hr_evaluation/report/hr_evaluation_report_view.xml
@@ -42,32 +42,32 @@
-
-
-
-
@@ -75,16 +75,16 @@
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
index fa57cfdd1a5..dc1a6723786 100644
--- a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
+++ b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py
@@ -115,31 +115,19 @@ class hr_si_project(osv.osv_memory):
# get the latest action (sign_in or out) for this employee
cr.execute('select action from hr_attendance where employee_id=%s and action in (\'sign_in\',\'sign_out\') order by name desc limit 1', (emp_id,))
res = (cr.fetchone() or ('sign_out',))[0]
+ in_out = res == 'sign_out' and 'out' or 'in'
#TODO: invert sign_in et sign_out
- if res == 'sign_out':
- model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_timesheet_sign_in')])
- resource_id = obj_model.read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
- return {
- 'name': 'Sign in / Sign out',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr.sign.in.project',
- 'views': [(False,'tree'), (resource_id,'form')],
- 'type': 'ir.actions.act_window',
- 'target': 'new'
- }
- else:
- model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_timesheet_sign_out')])
- resource_id = obj_model.read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
- return {
- 'name': 'Sign in / Sign out',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'hr.sign.out.project',
- 'views': [(False,'tree'), (resource_id,'form')],
- 'type': 'ir.actions.act_window',
- 'target': 'new'
- }
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_hr_timesheet_sign_%s' % in_out)])
+ resource_id = obj_model.read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
+ return {
+ 'name': 'Sign in / Sign out',
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'hr.sign.%s.project' % in_out,
+ 'views': [(False,'tree'), (resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new'
+ }
def _get_empid(self, cr, uid, context=None):
emp_obj = self.pool.get('hr.employee')
@@ -153,10 +141,7 @@ class hr_si_project(osv.osv_memory):
emp_obj = self.pool.get('hr.employee')
data = self.read(cr, uid, ids, [], context)[0]
emp_id = data['emp_id']
- try:
- success = emp_obj.attendance_action_change(cr, uid, [emp_id], type = 'sign_in' ,dt=data['date'] or False)
- except except_osv, e:
- raise osv.except_osv(e.name, e.value)
+ success = emp_obj.attendance_action_change(cr, uid, [emp_id], type = 'sign_in' ,dt=data['date'] or False)
return {}
def default_get(self, cr, uid, fields_list, context=None):
@@ -166,4 +151,4 @@ class hr_si_project(osv.osv_memory):
hr_si_project()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml
index 8aa0802fcda..90ee35d21e2 100644
--- a/addons/idea/idea_view.xml
+++ b/addons/idea/idea_view.xml
@@ -61,15 +61,15 @@
-
+
-
-
+ action="action_idea_select"/>
@@ -139,7 +139,7 @@
-
+
@@ -153,10 +153,10 @@
-
-
-
-
+
+
+
+
@@ -218,20 +218,20 @@
-
-
+
+
-
+
-
+
@@ -249,7 +249,7 @@
-
+
@@ -263,9 +263,9 @@
-
-
@@ -273,10 +273,10 @@
-
-
-
-
+
+
+
+
diff --git a/addons/mail_gateway/mail_gateway_view.xml b/addons/mail_gateway/mail_gateway_view.xml
index 611416055f7..e5b7b426fe9 100644
--- a/addons/mail_gateway/mail_gateway_view.xml
+++ b/addons/mail_gateway/mail_gateway_view.xml
@@ -165,13 +165,9 @@
+
-
-
+
-
+
-
+
-
+
+
+
@@ -121,7 +121,7 @@
-
+
@@ -139,19 +139,19 @@
search
-
-
+
+
-
-
+
+
-
-
-
-
+
+
+
+
@@ -165,12 +165,12 @@
{'group_by': [], 'search_default_draft': 1, 'search_default_test': 1}
-
+
-
+
-
+