diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 3fc6aff1536..acefb10fd13 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -304,7 +304,10 @@ - + + + diff --git a/addons/crm/doc/crm_kanban_avatar.rst b/addons/crm/doc/crm_kanban_avatar.rst new file mode 100644 index 00000000000..90998b0b1b9 --- /dev/null +++ b/addons/crm/doc/crm_kanban_avatar.rst @@ -0,0 +1,4 @@ +CRM kanban avatar specs +======================= + +Kanban view of opportunities has been updated to use the newly-introduced avatar_mini field of res.users. The avatar is placed in the right-side of the containing kanban box. diff --git a/addons/crm/doc/index.rst b/addons/crm/doc/index.rst new file mode 100644 index 00000000000..b67e59ac1e5 --- /dev/null +++ b/addons/crm/doc/index.rst @@ -0,0 +1,6 @@ +:orphan: + +CRM module documentation +======================== + +.. include:: index.rst.inc diff --git a/addons/crm/doc/index.rst.inc b/addons/crm/doc/index.rst.inc new file mode 100644 index 00000000000..42b8c576854 --- /dev/null +++ b/addons/crm/doc/index.rst.inc @@ -0,0 +1,8 @@ + +CRM Module +'''''''''' + +.. toctree:: + :maxdepth: 1 + + crm_kanban_avatar diff --git a/addons/hr/doc/hr_employee_img.rst b/addons/hr/doc/hr_employee_img.rst new file mode 100644 index 00000000000..0c7ca0bd9c6 --- /dev/null +++ b/addons/hr/doc/hr_employee_img.rst @@ -0,0 +1,8 @@ +HR photo specs +============== + +This revision modifies the photo for HR employees. Two fields now exist in the hr.employee model: + - photo, a binary field holding the image + - photo_mini, a binary field holding an automatically resized version of the avatar. Dimensions of the resized avatar are 180x150. + +Employee photo should be used only when dealing with employees, using the photo_mini field. When dealing with users, use the res.users avatar_mini field instead. diff --git a/addons/hr/doc/index.rst b/addons/hr/doc/index.rst new file mode 100644 index 00000000000..0a7d4a7132d --- /dev/null +++ b/addons/hr/doc/index.rst @@ -0,0 +1,6 @@ +:orphan: + +HR module documentation +======================= + +.. include:: index.rst.inc diff --git a/addons/hr/doc/index.rst.inc b/addons/hr/doc/index.rst.inc new file mode 100644 index 00000000000..9e5d4c277c8 --- /dev/null +++ b/addons/hr/doc/index.rst.inc @@ -0,0 +1,8 @@ + +HR Module +''''''''' + +.. toctree:: + :maxdepth: 1 + + hr_employee_img diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 30ca6a69239..27e429c8206 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -149,24 +149,28 @@ class hr_employee(osv.osv): _description = "Employee" _inherits = {'resource.resource': "resource_id"} + def onchange_photo_mini(self, cr, uid, ids, value, context=None): + return {'value': {'photo': value, 'photo_mini': self._photo_resize(cr, uid, value) } } + + def _set_photo_mini(self, cr, uid, id, name, value, args, context=None): + return self.write(cr, uid, [id], {'photo': value}, context=context) + + def _photo_resize(self, cr, uid, photo, context=None): + image_stream = io.BytesIO(photo.decode('base64')) + img = Image.open(image_stream) + img.thumbnail((180, 150), Image.ANTIALIAS) + img_stream = StringIO.StringIO() + img.save(img_stream, "JPEG") + return img_stream.getvalue().encode('base64') + def _get_photo_mini(self, cr, uid, ids, name, args, context=None): result = {} - for obj in self.browse(cr, uid, ids, context=context): - if not obj.photo: - result[obj.id] = False - continue - - image_stream = io.BytesIO(obj.photo.decode('base64')) - img = Image.open(image_stream) - img.thumbnail((180, 150), Image.ANTIALIAS) - img_stream = StringIO.StringIO() - img.save(img_stream, "JPEG") - result[obj.id] = img_stream.getvalue().encode('base64') + for hr_empl in self.browse(cr, uid, ids, context=context): + if not hr_empl.photo: + result[hr_empl.id] = False + else: + result[hr_empl.id] = self._photo_resize(cr, uid, hr_empl.photo, context=context) return result - - def _set_photo_mini(self, cr, uid, id, name, value, args, context=None): - self.write(cr, uid, [id], {'photo': value}, context=context) - return True _columns = { 'country_id': fields.many2one('res.country', 'Nationality'), @@ -244,11 +248,11 @@ class hr_employee(osv.osv): def _get_photo(self, cr, uid, context=None): photo_path = addons.get_module_resource('hr','images','photo.png') - return open(photo_path, 'rb').read().encode('base64') + return self._photo_resize(cr, uid, open(photo_path, 'rb').read().encode('base64')) _defaults = { 'active': 1, - 'photo': _get_photo, + 'photo_mini': _get_photo, 'marital': 'single', 'color': 0, } diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 81f1c655d33..c2961f2ccde 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -33,7 +33,7 @@ - + @@ -135,7 +135,7 @@
- +

()

diff --git a/addons/project/__openerp__.py b/addons/project/__openerp__.py index fc196890f78..96a7dc4f28f 100644 --- a/addons/project/__openerp__.py +++ b/addons/project/__openerp__.py @@ -67,9 +67,6 @@ Dashboard for project members that includes: 'test/project_process.yml', 'test/task_process.yml', ], - 'css': [ - 'static/src/css/project_task.css', - ], 'installable': True, 'auto_install': False, 'application': True, diff --git a/addons/project/doc/index.rst b/addons/project/doc/index.rst new file mode 100644 index 00000000000..d3e68870773 --- /dev/null +++ b/addons/project/doc/index.rst @@ -0,0 +1,6 @@ +:orphan: + +Project module documentation +============================ + +.. include:: index.rst.inc diff --git a/addons/project/doc/index.rst.inc b/addons/project/doc/index.rst.inc new file mode 100644 index 00000000000..4d9fcc34b5b --- /dev/null +++ b/addons/project/doc/index.rst.inc @@ -0,0 +1,8 @@ + +Project Module +'''''''''''''' + +.. toctree:: + :maxdepth: 1 + + task_kanban_avatar diff --git a/addons/project/doc/task_kanban_avatar.rst b/addons/project/doc/task_kanban_avatar.rst new file mode 100644 index 00000000000..af0a460f51c --- /dev/null +++ b/addons/project/doc/task_kanban_avatar.rst @@ -0,0 +1,4 @@ +Task kanban avatar specs +======================== + +Kanban view of tasks has been updated to use the newly-introduced avatar_mini field of res.users. The avatar is placed in the right-side of the containing kanban box. diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 9f791f81053..3716187dedc 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -344,46 +344,45 @@ oe_kanban_color_green
-
- -
-
- - - - - -
- - - - -
-
-
- - - , - - - - - - - ! - -
-
+ + + + + + +
+ + + + + + +
+
+
+ + + , + + + + + + + ! +
+
diff --git a/addons/project/static/src/css/project_task.css b/addons/project/static/src/css/project_task.css deleted file mode 100644 index c029df7b2ba..00000000000 --- a/addons/project/static/src/css/project_task.css +++ /dev/null @@ -1,21 +0,0 @@ -.openerp .oe_proj_task_content_box { - margin-right: 41px; -} - -.openerp .oe_proj_task_avatar_box { - float: right; - width: 40px; -} - -.openerp .oe_kanban_avatar { - display: block; - width: 40px; - height: auto; - clip: rect(5px, 40px, 45px, 0px); -} - -.openerp .oe_kanban_avatar_wide { - height: 40px; - width: auto; - clip: rect(0px, 45px, 40px, 05px); -}