From 8f86a405626530b5e9f138da358d91de9d3200e8 Mon Sep 17 00:00:00 2001 From: gfcapalbo Date: Fri, 19 Jun 2015 11:36:07 +0200 Subject: [PATCH 1/3] [FIX] event: add string for events and registrations fields --- addons/event/res_partner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/event/res_partner.py b/addons/event/res_partner.py index 88249c5a7cd..2ddb08e5115 100644 --- a/addons/event/res_partner.py +++ b/addons/event/res_partner.py @@ -26,8 +26,8 @@ class res_partner(osv.osv): _columns = { 'speaker': fields.boolean('Speaker', help="Check this box if this contact is a speaker."), - 'event_ids': fields.one2many('event.event','main_speaker_id', readonly=True), - 'event_registration_ids': fields.one2many('event.registration','partner_id', readonly=True), + 'event_ids': fields.one2many('event.event', 'main_speaker_id', 'Events', readonly=True), + 'event_registration_ids': fields.one2many('event.registration', 'partner_id', 'Registrations', readonly=True), } From 816be76ee6e84cf5426245535bda59e1f70626ec Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 22 Jun 2015 14:31:33 +0200 Subject: [PATCH 2/3] [FIX] consider user's timezone in default date proposal Fixes #6316 --- addons/account_voucher/account_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index cc3bf481b40..be279aa6fe5 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -427,7 +427,7 @@ class account_voucher(osv.osv): 'state': 'draft', 'pay_now': 'pay_now', 'name': '', - 'date': lambda *a: time.strftime('%Y-%m-%d'), + 'date': fields.date.context_today, 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.voucher',context=c), 'tax_id': _get_tax, 'payment_option': 'without_writeoff', From 6acd5ef91c3ee6d82679d68a9701d87fc2776a50 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 23 Jun 2015 15:02:23 +0200 Subject: [PATCH 3/3] [FIX] expression: internal domain operators require different parsing Ensure the absence of internal domain operators is correctly propagated throughout the domain parsing. --- openerp/osv/expression.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py index 4715d9268c4..1e3ac1d0034 100644 --- a/openerp/osv/expression.py +++ b/openerp/osv/expression.py @@ -490,7 +490,7 @@ class ExtendedLeaf(object): # i.e.: many2one: 'state_id': current field name # -------------------------------------------------- - def __init__(self, leaf, model, join_context=None): + def __init__(self, leaf, model, join_context=None, internal=False): """ Initialize the ExtendedLeaf :attr [string, tuple] leaf: operator or tuple-formatted domain @@ -529,7 +529,7 @@ class ExtendedLeaf(object): self._models.append(item[0]) self._models.append(model) # check validity - self.check_leaf() + self.check_leaf(internal) def __str__(self): return '' % (str(self.leaf), self.model._table, ','.join(self._get_context_debug())) @@ -575,7 +575,7 @@ class ExtendedLeaf(object): # Leaf manipulation # -------------------------------------------------- - def check_leaf(self): + def check_leaf(self, internal=False): """ Leaf validity rules: - a valid leaf is an operator or a leaf - a valid leaf has a field objects unless @@ -584,7 +584,7 @@ class ExtendedLeaf(object): - left is id, operator is 'child_of' - left is in MAGIC_COLUMNS """ - if not is_operator(self.leaf) and not is_leaf(self.leaf, True): + if not is_operator(self.leaf) and not is_leaf(self.leaf, internal): raise ValueError("Invalid leaf %s" % str(self.leaf)) def is_operator(self): @@ -603,14 +603,14 @@ class ExtendedLeaf(object): self.leaf = normalize_leaf(self.leaf) return True -def create_substitution_leaf(leaf, new_elements, new_model=None): +def create_substitution_leaf(leaf, new_elements, new_model=None, internal=False): """ From a leaf, create a new leaf (based on the new_elements tuple and new_model), that will have the same join context. Used to insert equivalent leafs in the processing stack. """ if new_model is None: new_model = leaf.model new_join_context = [tuple(context) for context in leaf.join_context] - new_leaf = ExtendedLeaf(new_elements, new_model, join_context=new_join_context) + new_leaf = ExtendedLeaf(new_elements, new_model, join_context=new_join_context, internal=internal) return new_leaf class expression(object): @@ -1062,7 +1062,7 @@ class expression(object): 'model', right, ) - push(create_substitution_leaf(leaf, ('id', inselect_operator, (subselect, params)), working_model)) + push(create_substitution_leaf(leaf, ('id', inselect_operator, (subselect, params)), working_model, internal=True)) else: push_result(leaf)