From 7b36357001d797c2869032f561690ccd47e8475a Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Thu, 3 Jan 2013 11:39:35 +0100 Subject: [PATCH 1/6] [FIX] Lunch name changed to have the good breadcrumb lp bug: https://launchpad.net/bugs/1095566 fixed bzr revid: api@openerp.com-20130103103935-i1vdmukol420r62p --- addons/lunch/lunch.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py index f61ecc8eb7d..1c78633ccac 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 From 0145fe1d069f9d1e9b869098a1ca6baca149f89a Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Thu, 3 Jan 2013 12:30:50 +0100 Subject: [PATCH 2/6] [FIX] Lunch : button create removed lp bug: https://launchpad.net/bugs/1095568 fixed bzr revid: api@openerp.com-20130103113050-fie0zx1lx5vs388a --- addons/lunch/lunch_view.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml index 8974099a294..c07f26f025b 100644 --- a/addons/lunch/lunch_view.xml +++ b/addons/lunch/lunch_view.xml @@ -109,6 +109,19 @@ + + + cashmove tree + lunch.cashmove + + + + + + + + + @@ -117,6 +130,7 @@ tree {"search_default_is_mine":1} +

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

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

Click to create a payment. From cba3bacef61627296b3aa4ff072ec60be50aee0a Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Thu, 3 Jan 2013 13:26:46 +0100 Subject: [PATCH 3/6] [FIX] Lunch : button create removed lp bug: https://launchpad.net/bugs/1095568 fixed bzr revid: api@openerp.com-20130103122646-fj3ykurbbyk6x2br --- addons/lunch/lunch_view.xml | 66 +++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml index c07f26f025b..5cdc1f36715 100644 --- a/addons/lunch/lunch_view.xml +++ b/addons/lunch/lunch_view.xml @@ -83,6 +83,39 @@ + + + cashmove tree + lunch.cashmove + + + + + + + + + + + + cashmove form + lunch.cashmove + +

+ + + + + + + +
+
+
+ + New Order @@ -401,38 +434,7 @@ - - - cashmove tree - lunch.cashmove - - - - - - - - - - - - cashmove form - lunch.cashmove - -
- - - - - - - -
-
-
- + alert tree From 29683cad2b5fa9411f84b3a0a42e7f5e2db045e7 Mon Sep 17 00:00:00 2001 From: chirag patel Date: Thu, 28 Mar 2013 18:38:33 +0530 Subject: [PATCH 4/6] [FIX] Fixed local variable 'prod' referenced before assignment. bzr revid: cpa@tinyerp.com-20130328130833-a3pohp88pxa6q8a7 --- addons/analytic_user_function/analytic_user_function.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index 0573292c1f6..90b80935c72 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) From a6410e1bcf99d9da790672a33f5b78fbc9052e8e Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 21 Aug 2013 16:37:14 +0200 Subject: [PATCH 5/6] [IMP] mail: beeing more permissive on the condition to post new message, allow also if have only the create access bzr revid: mat@openerp.com-20130821143714-9a1isp0ylwko275k --- addons/mail/mail_message.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 914889579a1..405f3c793c4 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,8 +722,12 @@ 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') - model_obj.check_access_rule(cr, uid, mids, 'write', context=context) + if not model_obj.check_access_rights(cr, uid, 'write', raise_exception=False): + model_obj.check_access_rights(cr, uid, 'create') + try: + model_obj.check_access_rule(cr, uid, mids, 'write', context=context) + except orm.except_orm, e: + model_obj.check_access_rule(cr, uid, mids, 'create', context=context) else: model_obj.check_access_rights(cr, uid, operation) model_obj.check_access_rule(cr, uid, mids, operation, context=context) From b03203fd3a99e2a2f61783ec98e696a9b44a383c Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 21 Aug 2013 17:39:18 +0200 Subject: [PATCH 6/6] [FIX] mail: check create access only for acess rights, not access rules (too permissive) bzr revid: mat@openerp.com-20130821153918-pdtf4mhcdycfdf3p --- addons/mail/mail_message.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 405f3c793c4..4280983f288 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -724,10 +724,7 @@ class mail_message(osv.Model): if operation in ['create', 'write', 'unlink']: if not model_obj.check_access_rights(cr, uid, 'write', raise_exception=False): model_obj.check_access_rights(cr, uid, 'create') - try: - model_obj.check_access_rule(cr, uid, mids, 'write', context=context) - except orm.except_orm, e: - model_obj.check_access_rule(cr, uid, mids, 'create', context=context) + model_obj.check_access_rule(cr, uid, mids, 'write', context=context) else: model_obj.check_access_rights(cr, uid, operation) model_obj.check_access_rule(cr, uid, mids, operation, context=context)