diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index 1adefb2d59d..2671fc92581 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -42,6 +42,7 @@ class analytic_user_funct_grid(osv.osv): return {} value = {} + prod = False if product_id: prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context) emp = emp_obj.browse(cr, uid, emp_id[0], context=context) diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py index 36c304f072a..7b410b04628 100644 --- a/addons/lunch/lunch.py +++ b/addons/lunch/lunch.py @@ -35,6 +35,16 @@ class lunch_order(osv.Model): _description = 'Lunch Order' _order = 'date desc' + def name_get(self, cr, uid, ids, context=None): + if not ids: + return [] + res = [] + for elmt in self.browse(cr, uid, ids, context=context): + name = _("Lunch Order") + name = name + ' ' + str(elmt.id) + res.append((elmt.id, name)) + return res + def _price_get(self, cr, uid, ids, name, arg, context=None): """ get and sum the order lines' price diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml index a72bf75de6c..c4683001d46 100644 --- a/addons/lunch/lunch_view.xml +++ b/addons/lunch/lunch_view.xml @@ -84,6 +84,39 @@ + + + cashmove tree + lunch.cashmove + + + + + + + + + + + + cashmove form + lunch.cashmove + +
+ + + + + + + +
+
+
+ + New Order @@ -110,6 +143,19 @@ + + + cashmove tree + lunch.cashmove + + + + + + + + + @@ -118,6 +164,7 @@ tree {"search_default_is_mine_group":1} +

Here you can see your cash moves.
A cash moves can be either an expense or a payment. @@ -174,6 +221,7 @@ tree,form {"search_default_group_by_user":1} +

Click to create a new payment. @@ -195,6 +243,7 @@ tree,form {"search_default_is_payment":1} +

Click to create a payment. @@ -386,38 +435,7 @@ - - - cashmove tree - lunch.cashmove - - - - - - - - - - - - cashmove form - lunch.cashmove - -

- - - - - - - -
-
-
- + alert tree diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 914889579a1..4280983f288 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -641,14 +641,14 @@ class mail_message(osv.Model): - no model, no res_id, I create a private message OR - pid in message_follower_ids if model, res_id OR - mail_notification (parent_id.id, pid) exists, uid has been notified of the parent, OR - - uid have write access on the related document if model, res_id, OR + - uid have write or create access on the related document if model, res_id, OR - otherwise: raise - write: if - author_id == pid, uid is the author, OR - - uid has write access on the related document if model, res_id + - uid has write or create access on the related document if model, res_id - otherwise: raise - unlink: if - - uid has write access on the related document if model, res_id + - uid has write or create access on the related document if model, res_id - otherwise: raise """ def _generate_model_record_ids(msg_val, msg_ids=[]): @@ -722,7 +722,8 @@ class mail_message(osv.Model): model_obj = self.pool.get(model) mids = model_obj.exists(cr, uid, doc_dict.keys()) if operation in ['create', 'write', 'unlink']: - model_obj.check_access_rights(cr, uid, 'write') + if not model_obj.check_access_rights(cr, uid, 'write', raise_exception=False): + model_obj.check_access_rights(cr, uid, 'create') model_obj.check_access_rule(cr, uid, mids, 'write', context=context) else: model_obj.check_access_rights(cr, uid, operation)